Hallo Leute,
ich verstehe das System hinter dem Pagebrowser noch nicht. Wie sage ich der 2. DB-Abfrage, welche Datensätze ausgelesen werden sollen (ab Zeile 25)?
Hier mein Kot:
function listRecipients($format) {
global $TYPO3_DB;
//$address = array();
$select_fields = '*';
$from_table = 'tx_ddbfrontend_addresses';
// $where_clause = 'feuser=\''.$TSFE->fe_user->user['uid'].'\'';
$where_clause = '1';
// $where_clause = "firma='%".$this->piVars['sword']."%' OR vorname='%".$this->piVars['sword']."%' OR ort='%".$this->piVars['sword']."%'";
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
$select_fields,
$from_table,
$where_clause='',
$groupBy='',
$orderBy='',
$limit='')
or die(t3lib_div::debug(mysql_error(),'Fehler beim Abfragen der Adressliste'));
$this->internal['res_count'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$this->internal['results_at_a_time'] = 2;
$this->internal['maxPages'] = 5;
$this->internal['showFirstLast'] = 0;
$this->internal['searchFieldList'] = 'firma,vorname,nachname,strasse_nr,ort';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
$select_fields,
$from_table,
$where_clause='',
$groupBy='',
$orderBy='',
$limit='')
or die(t3lib_div::debug(mysql_error(),'Fehler beim Abfragen der Adressliste'));
/*****************************
// Ausgabe als XML
******************************/
if($format == "xml") {
....
}
/*****************************
// Ausgabe als HTML
******************************/
else{
# Subpart auswählen
$subpart = $this->cObj->getSubpart($this->template,'###ADRESSLISTE###');
# eine einzelne Tabellen-Reihe
$singlerow = $this->cObj->getSubpart($subpart,'###LIST_SUBPART###');
$markerArray['###HEAD###'] = $this->pi_getLL('addrlist_head', '', 1);
$markerArray['###TH_AUSWAHL###'] = $this->pi_getLL('auswahl','',1);
$markerArray['###TH_FIRMA###'] = $this->pi_getLL('firma','',1);
$markerArray['###TH_ORT###'] = $this->pi_getLL('ort','',1);
$markerArray['###TH_ANSPRECHPARTNER###'] = $this->pi_getLL('ansprechpartner','',1);
//$markerArray['###TH_FAVORIT###'] = $this->pi_getLL('favorit','',1);
$markerArray['###TH_EMAIL###'] = $this->pi_getLL('email','',1);
$markerArray['###TH_OPTIONEN###'] = $this->pi_getLL('optionen','',1);
$markerArray['###BTN_SELECT###'] = $this->pi_getLL('btn_select','',1);
$markerArray['###ADDRLISTACTION###'] = $this->pi_linkTP_keepPIvars_url();
if($res) {
$liste='';
// $liste .= $this->pi_list_searchbox(); // Suchbox
$n = 0;
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$markerArray['###EVENODD###'] = ($n % 2) ? "tx-ddbfrontend-pi1-row-even" : "tx-ddbfrontend-pi1-row-odd";
$markerArray['###CHECK###'] = "";
$markerArray['###UID###'] = $this->internal['currentRow']['uid'];
//$markerArray['###FAVCHECK###'] = ($row['favorit']=="0") ? "checked" : "";
$markerArray['###FIRMA###'] = ($this->internal['currentRow']['firma']!='') ? $this->internal['currentRow']['firma'] : " ";
$markerArray['###ORT###'] = ($this->internal['currentRow']['ort']!='') ? $this->internal['currentRow']['ort'] : " ";
$markerArray['###NAME###'] = ($this->internal['currentRow']['vorname']!='') ? $this->internal['currentRow']['vorname']." ".$this->internal['currentRow']['nachname'] : $this->internal['currentRow']['nachname'];
$markerArray['###EMAIL###'] = ($this->internal['currentRow']['email']!='') ? $this->internal['currentRow']['email'] : " ";
$markerArray['###EDIT###'] = "[edit]";
$markerArray['###DELETE###'] = "[del]";
$n++;
$liste .= $this->cObj->substituteMarkerArrayCached($singlerow,$markerArray);
}
// $liste .= $this->pi_list_searchbox(); // Suchbox
$liste .= $this->pi_list_browseresults($showResultCount=1,$tableParams='',$wrapArr, $pointerName = 'pointer', $hscText = FALSE);
$subpartArray['###LIST_SUBPART###'] = $liste;
} else {
return $this->pi_getLL('nodata');
}
return $this->cObj->substituteMarkerArrayCached($subpart,$markerArray,$subpartArray,array());
}
}
Der pagebrowser zählt richtig, aber es werden alle Tabelleninhalte gelistet, nicht die als 'results_at_a_time' definierten.
Hab mich zu fast zu Tode gesucht, aber finde die Lösung nicht.
Danke für eure Zeit!
Gruß
Jehu