![]() |
| | LinkBack | Themen-Optionen | Thema bewerten | Ansicht |
|
#1
| |||
| |||
Hallo Leute, es geht um besagte Funktion. Zuerst der Code: Code: function bookshelf() {
$select_fields='*';
$from_table = 'tx_bookshelf_rack';
$where_clause="1 = 1 ";
$groupBy='';
$limit='9999';
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
$row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$next_button=$this->pi_getLL("next");
$prev_button=$this->pi_getLL("last");
$marker['###NEXT_BUTTON###']=$this->pi_linkTP_keepPIvars($next_button,$overrulePIvars,$cache=0,$clearAnyway=0,$altPageId = 0);
$marker['###PREV_BUTTON###']=$this->pi_linkTP_keepPIvars($prev_button,$overrulePIvars,$cache=0,$clearAnyway=0,$altPageId = 0);
$marker['###DATASHEET###'].= $row['book_title']." \n";
$marker['###DATASHEET###'].= $row['author']." \n";
$marker['###DATASHEET###'].= $row['isbn']." \n";
$marker['###DATASHEET###'].= $row['place']." <br /> \n";
$content.=$this->cObj->substituteMarkerArrayCached($this->bookshelf,$marker,array(),array());
return $content; Kann mir da jemand helfen?
__________________ Jedweges Interesse beginnt mit einer dummen Frage. Geändert von turnamo (06.02.08 um 16:36 Uhr). |
|
#2
| |||
| |||
| Schau' Dir am besten mal die Funktion "pi_list_browseresults" an. Zur Nutzung: PHP-Code: PHP-Code: |
|
#3
| |||
| |||
Erstmal vielen dank ! Hab schon ein bißchen rumgesucht. Scheint die richtige Funktion zu sein. Dabei gibt es leider ein Problem: Warning: mysql_fetch_assoc(:sad: supplied argument is not a valid MySQL result resource in /var/www/typo3_src-4.1.2/t3lib/class.t3lib_db.php on line 796 Warning: Cannot modify header information - headers already sent by (output started at /var/www/typo3_src-4.1.2/t3lib/class.t3lib_db.php:796) in /var/www/typo3_src-4.1.2/typo3/sysext/cms/tslib/class.tslib_fe.php on line 2907 Code: function bookshelf() {
$select_fields = '*';
$from_table = 'tx_bookshelf_rack';
$where_clause = "1 = 1";
$groupBy = '';
$this->internal['res_count'] = count('rows');
$this->internal['results_at_a_time'] = 2;
$limit = $this->piVars['pointer'].','.$this->internal['results_at_a_time'];
//function enableFields(tx_bookshelf_rack,$show_hidden=-1,$ignore_array=array(),$noVersionPreview=FALSE));
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
$row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$next_button=$this->pi_getLL("next");
$prev_button=$this->pi_getLL("last");
$marker['###NEXT_BUTTON###']=$this->pi_linkTP_keepPIvars($next_button,$overrulePIvars,$cache=0,$clearAnyway=0,$altPageId = 0);
$marker['###PREV_BUTTON###']=$this->pi_linkTP_keepPIvars($prev_button,$overrulePIvars,$cache=0,$clearAnyway=0,$altPageId = 0);
$marker['###DATASHEET###'].= $row['book_title']." \n";
$marker['###DATASHEET###'].= $row['author']." \n";
$marker['###DATASHEET###'].= $row['isbn']." \n";
$marker['###DATASHEET###'].= $row['place']." <br /> \n";
$content.=$this->cObj->substituteMarkerArrayCached($this->bookshelf,$marker,array(),array());
return $content.$this->pi_list_browseresults;
}
__________________ Jedweges Interesse beginnt mit einer dummen Frage. |
|
#4
| |||
| |||
| Versuchs mal so: Code: function bookshelf() {
$select_fields = '*';
$from_table = 'tx_bookshelf_rack';
$where_clause = "1 = 1 ".$this->cObj->enableFields('tx_bookshelf_rack');
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause);
$this->internal['res_count'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$this->internal['results_at_a_time'] = 2;
$groupBy = '';
$limit = $this->piVars['pointer'].','.$this->internal['results_at_a_time'];
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
$marker['###DATASHEET###'].= $row['book_title']." \n";
$marker['###DATASHEET###'].= $row['author']." \n";
$marker['###DATASHEET###'].= $row['isbn']." \n";
$marker['###DATASHEET###'].= $row['place']." <br /> \n";
}
$content.=$this->cObj->substituteMarkerArrayCached($this->bookshelf,$marker,array(),array());
return $content.$this->pi_list_browseresults;
} |
|
#5
| |||
| |||
| geht leider immernoch nicht. Warning: mysql_fetch_assoc(:sad: supplied argument is not a valid MySQL result resource in /var/www/typo3_src-4.1.2/t3lib/class.t3lib_db.php on line 796
__________________ Jedweges Interesse beginnt mit einer dummen Frage. |
|
#6
| |||
| |||
| Code: function bookshelf() {
$select_fields = '*';
$from_table = 'tx_bookshelf_rack';
$where_clause = "1 = 1 ".$this->cObj->enableFields('tx_bookshelf_rack');
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause);
$this->internal['res_count'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$this->internal['results_at_a_time'] = 2;
$groupBy = '';
if(empty($this->piVars['pointer'])) $this->piVars['pointer'] = 0;
$limit = $this->piVars['pointer'].','.$this->internal['results_at_a_time'];
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
$marker['###DATASHEET###'].= $row['book_title']." \n";
$marker['###DATASHEET###'].= $row['author']." \n";
$marker['###DATASHEET###'].= $row['isbn']." \n";
$marker['###DATASHEET###'].= $row['place']." <br /> \n";
}
$content.=$this->cObj->substituteMarkerArrayCached($this->bookshelf,$marker,array(),array());
return $content.$this->pi_list_browseresults;
} |
|
#7
| |||
| |||
| Die Ausgabe des Datensatzes, oder sogar mehrerer, funktioniert, vielen Dank! Es fehlt nur noch die Leiste mit den Zahlen und dem Weiter bzw. dem ZurückLink, die wie ich dachte die Funktion pi_list_browseresults automatisch erstellt?
__________________ Jedweges Interesse beginnt mit einer dummen Frage. |
|
#8
| |||
| |||
| Zur Nutzung: PHP-Code: Du kannst die Ausgabe dieser Funktion außerdem mittels bestimmter "Sprachvariablen" noch weiter anpassen: (pi1/locallang.xml) <label index="pi_list_browseresults_displays">Datensätze %s bis %s von insgesamt %s:</label> <label index="pi_list_browseresults_noResults">Keine Datensätze gefunden.</label> <label index="pi_list_browseresults_prev">« zurück</label> <label index="pi_list_browseresults_page">Seite</label> <label index="pi_list_browseresults_next">vorwärts »</label> Geändert von ThBodi (06.02.08 um 16:25 Uhr). Grund: Ergänzung |
|
#9
| |||
| |||
| Ich habe angenommen, dass er noch Parameter benötigt und ausprobiert, woraufhin aber nichts passierte. Ich bin mit der Syntax einfach noch viel zu wenig vertraut, hoffe das kommt mit der Übung. Hier nochmal vielen Dank für deine Hilfe! Auch wegen den Sprachvariabeln, werd das mal ausprobieren. Und nochmal der Endstand: Code: /********************************************************
bookshelf()
Displays books of the shelf
********************************************************/
function bookshelf() {
$select_fields = '*';
$from_table = 'tx_bookshelf_rack';
$where_clause = "1 = 1".$this->cObj->enableFields("tx_bookshelf_rack");
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause);
$this->internal['res_count'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$this->internal['results_at_a_time'] = 1;
$groupBy = '';
if(empty($this->piVars['pointer'])) $this->piVars['pointer'] = 0;
$limit = $this->piVars['pointer'].','.$this->internal['results_at_a_time'];
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
$marker['###DATASHEET###'].= $row['book_title']." \n";
$marker['###DATASHEET###'].= $row['author']." \n";
$marker['###DATASHEET###'].= $row['isbn']." \n";
$marker['###DATASHEET###'].= $row['place']." <br /> \n";
}
$content.=$this->cObj->substituteMarkerArrayCached($this->bookshelf,$marker,array(),array());
return $content.$this->pi_list_browseresults();
}
__________________ Jedweges Interesse beginnt mit einer dummen Frage. Geändert von turnamo (06.02.08 um 16:32 Uhr). |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | Thema bewerten |
| |
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| pi_linkTP_keepPIvars title | pommesMajo | TYPO3 4.x Fragen und Probleme | 1 | 20.10.08 09:40 |
| Gelöst Styles und pi_linkTP_keepPIvars? | turnamo | TYPO3 4.x Fragen und Probleme | 0 | 07.02.08 12:40 |
| Link mit pi_linkTP_keepPIvars aber mit Params? | typonewbe | Extension modifizieren oder neu erstellen | 2 | 03.08.07 14:27 |
| pi_linkTP_keepPIvars? Nur Pfad nicht Link? | BENCH | Extension modifizieren oder neu erstellen | 2 | 24.03.07 19:18 |
| $this->pi_linkTP_keepPIvars umwandeln zu linkToPage | mab82 | Extension modifizieren oder neu erstellen | 1 | 04.11.06 18:54 |