[TYPO3-german] Extension und relationen der Tabellen

marko.hoffmann at yes-globushaus.de marko.hoffmann at yes-globushaus.de
Thu Apr 19 13:14:21 CEST 2007


Hallo Liste,

ich habe ein kleines Problem bei einer Extension die ich gerade schreibe.
Zuerst einmal zum Aufbau der Datenbank:

Tabelle "species": uid, ..., species
(enthält z.B. als Text: Python regius)

Tabelle "subspecies": uid, ..., species, subspecies
(enthält z.B. 1(uid von species) für species und als Text Mojave für subspecies)

Tabelle "reptiles": uid, ..., species, subspecies, name, image
(enthält z.B. 1(uid von species) für species, 1(uid von subspecies) für subspecies,
als Text DNZ07 für name und Männchen07_1.jpg als image

Nun zu meinem Problem:
In der Ergebnissliste (function makeListItem()) erhalte ich nun die uid's von species und subspecies anstatt den Text. Gibt es eine Möglichkeit ohne großartig mehere Query's in das Script reinzunehmen den eigentlichen Text anzuzeigen?

Code:
function makelist($res)	{
  $items=array();
  // Make list table rows
  while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
    $items[]=$this->makeListItem();
  }

  $out = '<div'.$this->pi_classParam('listrow').'>'.implode(chr(10),$items).'</div>';
  return $out;
}

/**
 * Implodes a single row from a database to a single line
 *
 * @return	Imploded column values
 */
function makeListItem()	{
  $out='
    <p'.$this->pi_classParam('listrowField-name').'>'.$this->getFieldContent('name').'</p>
    <p'.$this->pi_classParam('listrowField-image').'>'.$this->getFieldContent('image').'</p>
    <p'.$this->pi_classParam('listrowField-species').'>'.$this->getFieldContent('species').'</p>
    <p'.$this->pi_classParam('listrowField-subspecies').'>'.$this->getFieldContent('species').'</p>
    <p'.$this->pi_classParam('listrowField-text').'>'.$this->getFieldContent('text').'</p>
  ';
  return	$out;	
}

Danke im voraus für Eure Hilfe.

Marko




More information about the TYPO3-german mailing list