---
title: "Anzeige des Bildes in eigener Extension funzt net!"
url: "https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Bilder","Frage"]
created: "2006-09-18"
last_reply: "2008-01-11"
replies: 12
solved: false
page: 1
pages: 1
lang: "de"
---

# Anzeige des Bildes in eigener Extension funzt net!

Extensions › Entwicklung · 12 Antworten · gestartet 2006-09-18

## Eröffnungsbeitrag

**DonBoolione** · 2006-09-18 · [Beitrag #1](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/1)

Guten Tag erstmal,
ich habe ein Problem und komme nicht mehr von der Stelle: habe eine Extension erstellt, genauso, wie die Video-tutorials von typo3.org es zeigen! einfach nur 'Name des Partners'; 'Link', und das Logo des Partners. Leider wird das Bild nicht angezeigt!
Gemäß Anleitung sieht die Datei 'class.tx_partnergg_pi1.php' nun folgendermaßen aus:
Der **Case 'logo' ist von mir, ebenso die oberen Deklarationen**, der Rest sollte also eigentlich stimmen ;-)

```php
	function getFieldContent($fN)	{ 
	
      $img["file"] = 'uploads/tx_partnergg/'. $row["logo"];
      $img['params'] = $this->pi_classParam('image');
      $img['altText'] = 'Bild';
      $img['titleText'] = $row['title'];
      $img['file.']['maxW']=300;
      $img['file.']['maxH']=200;
      $tempItem['image'] = $this->cObj->IMAGE($img); 
	

		switch($fN) {
			case 'uid':
			
return $this->pi_list_linkSingle($this->internal['currentRow'][$fN],$this->internal['currentRow']['uid'],1);	// The "1" means that the display of single items is CACHED! Set to zero to disable caching.
			break;
			case "details":
				return $this->pi_RTEcssText($this->internal['currentRow']['details']);
			break;


			case "logo":
			$imgTSConfig = $this->conf['imageCObject.'];
			$imgTSConfig['file'] = 'uploads/tx_partnergg'.$this->internal['currentRow'][$fN];
			return $this->cObj->IMAGE($imgTSConfig);
			break;


			default:
				return $this->internal['currentRow'][$fN];
			break;
		}
	}
```

Die Inhalte werden alle normal angezeigt, nur das Logo-feld bleibt leer, im Quelltext steht nur ein leerer Tag.

```html
<a href="index.php?id=45&tx_partnergg_pi1[showUid]=4&cHash=557f786a14">4</a></p></td>
				<td valign="top"><p>GeoInform</p></td>
				<td valign="top"><p>http://www.geoinform.de</p></td>
				<td valign="top"><p></p></td>
			</tr><tr class="tx-partnergg-pi1-listrow-odd">
				<td><p>
```

ansehen kann man sich die Misere unter <http://www.greengate.biz/index.php?id=45>

Bitte um HILFE  #angry#

Bei INCLUDE STATIC from extensions taucht partnergg auch auf, muss ich es dort importieren? Habe ich, aber die Bilder werden trotzdem nicht engezeigt!

Viele Grüße und Dänke
Christian

## Antworten

### [#2](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/2) · FordPrefect · 2006-09-19

Hi,

du kannst ja mal $this->conf ausgeben um zu sehen ob das TS verfügbar ist:

```php
t3lib_div::print_array($this->conf);
```

dann gebe mal das aus:

```php
echo $imgTSConfig['file'] = 'uploads/tx_partnergg'.$this->internal['currentRow'][$fN];
```

Stimmt der Pfad??? Ist die Bilddatei vorhanden?

Grüsse

### [#3](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/3) · DonBoolione · 2006-09-19

Wo soll ich das denn ausgeben lassen? Bzw. wie komme ich an den Output? Bin noch ein bisschen Anfänger  :o

### [#4](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/4) · FordPrefect · 2006-09-19

Hoi,

in der PHP-Datei aus der du den Code kopiert hast.

Grüsse

Ford

### [#5](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/5) · DonBoolione · 2006-09-19

Wenn ich den Code an das Ende der php-datei hänge, passiert bei

t3lib_div::print_array($this->conf);

leider nix, wenn ich die Seite im Frontend ausgeben lasse!

Bei

echo $imgTSConfig['file'] = 'uploads/tx_partnergg'.$this->internal['currentRow'][$fN];

gibt er über allen anderen Inhalten auf der Webseite

uploads/tx_partnergg

aus...

Der gesamte Quelltext sieht folgendermaßen aus:

```php
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2006 Christian Ottersbach 
*  All rights reserved
* 
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'Partner' for the 'partner_gg' extension.
 *
 * @author	Christian Ottersbach 
 * @package	TYPO3
 * @subpackage	tx_partnergg
 */
class tx_partnergg_pi1 extends tslib_pibase {
	var $prefixId = 'tx_partnergg_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.tx_partnergg_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey = 'partner_gg';	// The extension key.
	var $pi_checkCHash = TRUE;
	
	/**
	 * Main method of your PlugIn
	 *
	 * @param	string		$content: The content of the PlugIn
	 * @param	array		$conf: The PlugIn Configuration
	 * @return	The content that should be displayed on the website
	 */
	function main($content,$conf)	{
		switch((string)$conf['CMD'])	{
			case 'singleView':
				list($t) = explode(':',$this->cObj->currentRecord);
				$this->internal['currentTable']=$t;
				$this->internal['currentRow']=$this->cObj->data;
				return $this->pi_wrapInBaseClass($this->singleView($content,$conf));
			break;
			default:
				if (strstr($this->cObj->currentRecord,'tt_content'))	{
					$conf['pidList'] = $this->cObj->data['pages'];
					$conf['recursive'] = $this->cObj->data['recursive'];
				}
				return $this->pi_wrapInBaseClass($this->listView($content,$conf));
			break;
		}
	}
	
	/**
	 * Shows a list of database entries
	 *
	 * @param	string		$content: content of the PlugIn
	 * @param	array		$conf: PlugIn Configuration
	 * @return	HTML list of table entries
	 */
	function listView($content,$conf)	{
		$this->conf=$conf;		// Setting the TypoScript passed to this function in $this->conf
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();		// Loading the LOCAL_LANG values
		
		$lConf = $this->conf['listView.'];	// Local settings for the listView function
	
		if ($this->piVars['showUid'])	{	// If a single element should be displayed:
			$this->internal['currentTable'] = 'tx_partnergg_partner';
			$this->internal['currentRow'] = $this->pi_getRecord('tx_partnergg_partner',$this->piVars['showUid']);
	
			$content = $this->singleView($content,$conf);
			return $content;
		} else {
			$items=array(
				'1'=> $this->pi_getLL('list_mode_1','Mode 1'),
				'2'=> $this->pi_getLL('list_mode_2','Mode 2'),
				'3'=> $this->pi_getLL('list_mode_3','Mode 3'),
			);
			if (!isset($this->piVars['pointer']))	$this->piVars['pointer']=0;
			if (!isset($this->piVars['mode']))	$this->piVars['mode']=1;
	
				// Initializing the query parameters:
			list($this->internal['orderBy'],$this->internal['descFlag']) = explode(':',$this->piVars['sort']);
			$this->internal['results_at_a_time']=t3lib_div::intInRange($lConf['results_at_a_time'],0,1000,6);		// Number of results to show in a listing.
			$this->internal['maxPages']=t3lib_div::intInRange($lConf['maxPages'],0,1000,3);;		// The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc.
			$this->internal['searchFieldList']='name,details';
			$this->internal['orderByList']='uid,name';
	
				// Get number of records:
			$res = $this->pi_exec_query('tx_partnergg_partner',1);
			list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
	
				// Make listing query, pass query to SQL database:
			$res = $this->pi_exec_query('tx_partnergg_partner');
			$this->internal['currentTable'] = 'tx_partnergg_partner';
	
				// Put the whole list together:
			$fullTable='';	// Clear var;
		#	$fullTable.=t3lib_div::view_array($this->piVars);	// DEBUG: Output the content of $this->piVars for debug purposes. REMEMBER to comment out the IP-lock in the debug() function in t3lib/config_default.php if nothing happens when you un-comment this line!
	
				// Adds the mode selector.
//			$fullTable.=$this->pi_list_modeSelector($items);

				// Adds the whole list table
			$fullTable.=$this->pi_list_makelist($res);
			
				// Adds the result browser:
			$fullTable.=$this->pi_list_browseresults();	
			

	
				// Adds the search box:
			$fullTable.=$this->pi_list_searchBox();
	

	
				// Returns the content from the plugin.
			return $fullTable;
		}
	}
	/**
	 * Display a single item from the database
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	HTML of a single database entry
	 */
	function singleView($content,$conf)	{
		$this->conf=$conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		
	
			// This sets the title of the page for use in indexed search results:
		if ($this->internal['currentRow']['title'])	$GLOBALS['TSFE']->indexedDocTitle=$this->internal['currentRow']['title'];
	
		$content='<div'.$this->pi_classParam('singleView').'>
			<H2>Record "'.$this->internal['currentRow']['uid'].'" from table "'.$this->internal['currentTable'].'":</H2>
			<table>
				<tr>
					<td nowrap="nowrap" valign="top"'.$this->pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('name').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('name').'</p></td>
				</tr>
				<tr>
					<td nowrap="nowrap" valign="top"'.$this->pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('link').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('link').'</p></td>
				</tr>
				<tr>
					<td nowrap="nowrap" valign="top"'.$this->pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('logo').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('logo').'</p></td>
				</tr>
				<tr>
					<td nowrap="nowrap" valign="top"'.$this->pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('details').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('details').'</p></td>
				</tr>
				<tr>
					<td nowrap'.$this->pi_classParam('singleView-HCell').'><p>Last updated:</p></td>
					<td valign="top"><p>'.date('d-m-Y H:i',$this->internal['currentRow']['tstamp']).'</p></td>
				</tr>
				<tr>
					<td nowrap'.$this->pi_classParam('singleView-HCell').'><p>Created:</p></td>
					<td valign="top"><p>'.date('d-m-Y H:i',$this->internal['currentRow']['crdate']).'</p></td>
				</tr>
			</table>
		<p>'.$this->pi_list_linkSingle($this->pi_getLL('back','Back'),0).'</p></div>'.
		$this->pi_getEditPanel();
	
		return $content;
	}
	/**
	 * Returns a single table row for list view
	 *
	 * @param	integer		$c: Counter for odd / even behavior
	 * @return	A HTML table row
	 */
	function pi_list_row($c)	{
		$editPanel = $this->pi_getEditPanel();
		if ($editPanel)	$editPanel='<TD>'.$editPanel.'</TD>';
	
		return '<tr'.($c%2 ? $this->pi_classParam('listrow-odd') : '').'>
				<td><p>'.$this->getFieldContent('uid').'</p></td>
				<td valign="top"><p>'.$this->getFieldContent('name').'</p></td>
				<td valign="top"><p>'.$this->getFieldContent('link').'</p></td>
				<td valign="top"><p>'.$this->getFieldContent('logo').'</p></td>
			</tr>';
	}
	/**
	 * Returns a table row with column names of the table
	 *
	 * @return	A HTML table row
	 */
	function pi_list_header()	{
		return '<tr'.$this->pi_classParam('listrow-header').'>
				<td><p>'.$this->getFieldHeader_sortLink('uid').'</p></td>
				<td><p>'.$this->getFieldHeader_sortLink('name').'</p></td>
				<td nowrap><p>'.$this->getFieldHeader('link').'</p></td>
				<td nowrap><p>'.$this->getFieldHeader('logo').'</p></td>
			</tr>';
	}
	/**
	 * Returns the content of a given field
	 *
	 * @param	string		$fN: name of table field
	 * @return	Value of the field
	 */
	 


	 
	 
	 
	 
	 
	function getFieldContent($fN)	{ 
	
	      $img["file"] = 'uploads/tx_partnergg/'. $row["logo"];
      $img['params'] = $this->pi_classParam('image');
      $img['altText'] = 'Bild';
      $img['titleText'] = $row['title'];
      $img['file.']['maxW']=300;
      $img['file.']['maxH']=200;
      $tempItem['image'] = $this->cObj->IMAGE($img); 
	
		switch($fN) {
			case 'uid':
				return $this->pi_list_linkSingle($this->internal['currentRow'][$fN],$this->internal['currentRow']['uid'],1);	// The "1" means that the display of single items is CACHED! Set to zero to disable caching.
			break;
			case "details":
				return $this->pi_RTEcssText($this->internal['currentRow']['details']);
			break;
			case "logo":
			$imgTSConfig = $this->conf['logoCObject.'];
			$imgTSConfig['file'] = 'uploads/tx_partnergg'.$this->internal['currentRow'][$fN];
			return $this->cObj->IMAGE($imgTSConfig);
			break;
			default:
				return $this->internal['currentRow'][$fN];
			break;
		}
	}
	/**
	 * Returns the label for a fieldname from local language array
	 *
	 * @param	[type]		$fN: ...
	 * @return	[type]		...
	 */
	function getFieldHeader($fN)	{
		switch($fN) {
			
			default:
				return $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');
			break;
		}
	}
	
	/**
	 * Returns a sorting link for a column header
	 *
	 * @param	string		$fN: Fieldname
	 * @return	The fieldlabel wrapped in link that contains sorting vars
	 */
	function getFieldHeader_sortLink($fN)	{
		return $this->pi_linkTP_keepPIvars($this->getFieldHeader($fN),array('sort'=>$fN.':'.($this->internal['descFlag']?0:1)));
	}
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/partner_gg/pi1/class.tx_partnergg_pi1.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/partner_gg/pi1/class.tx_partnergg_pi1.php']);
}
echo $imgTSConfig['file'] = 'uploads/tx_partnergg'.$this->internal['currentRow'][$fN];
?>
```

in dem Upload-ordner liegen auch die Bilder...aber irgendwas scheint mit der Verarbeitung nicht zu stimmen, da ich im Ausgabequelltext keinen (ungültigen) Pfad finde!
Wie kann ich denn ganz simpel über diese Funktion ein Bild anzeigen lassen?

VIELEN VIELEN DANK  ;)

### [#6](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/6) · FordPrefect · 2006-09-19

Hoi,

da liegt der Hund begraben:

Bei
echo $imgTSConfig['file'] = 'uploads/tx_partnergg'.$this->internal['currentRow'][$fN];

gibt er über allen anderen Inhalten auf der Webseite

uploads/tx_partnergg

Da fehlt der Dateiname des Bildes.

Grüsse

Ford

### [#7](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/7) · DonBoolione · 2006-09-19

Aber woran liegt das? Bin genau nach Tutorial vorgegangen! Wie erreiche ich denn, dass er mir den Inhalt des Tabelleninhaltes (den Dateinamen) übergibt? So scheint es ja leider nicht zu funktionieren :-(

### [#8](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/8) · Spyker · 2006-09-21

Fehler:

in dieser Zeile:  $img["file"] = 'uploads/tx_partnergg/'. $row["logo"];

ist die Var $row erst einmal gar nicht verfügbar.

Desweiteren wird Logo gar nicht geladen kann das sein?!!?

Schon mal versucht hier logo mit rein zu schreiben?!!?
Zumindest wird das Logo feld noch nicht aus der DB gelsen

$this->internal['searchFieldList']='name,details';

Beste,
Tim

### [#9](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/9) · jenses · 2006-09-21

> **Spyker schrieb:**
>
> Fehler:
>
> in dieser Zeile:  $img["file"] = 'uploads/tx_partnergg/'. $row["logo"];
>
> ist die Var $row erst einmal gar nicht verfügbar.

Hier lieferst du doch schon (fast) die Lösung des Problems, und stellst sie gleich wieder in Frage.
Es fehlt doch nur  ein Slash in der Pfadangabe:

```php
$imgTSConfig['file'] = 'uploads/tx_partnergg/'.$this->internal['currentRow'][$fN];
```

### [#10](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/10) · FordPrefect · 2006-09-21

> **jenses schrieb:**
>
> Hier lieferst du doch schon (fast) die Lösung des Problems, und stellst sie gleich wieder in Frage.
> Es fehlt doch nur  ein Slash in der Pfadangabe:
>
> ```php
> $imgTSConfig['file'] = 'uploads/tx_partnergg/'.$this->internal['currentRow'][$fN];
> ```

Hi,

problem ist das wenn ich sage

echo $imgTSConfig['file'] = 'uploads/tx_partnergg/'.$this->internal['currentRow'][$fN];

als Ausgabe erscheint: uploads/tx_partnergg/, somit ist die Variable $this->internal['currentRow'][$fN] leer

Grüsse

### [#11](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/11) · DonBoolione · 2006-09-21

Kurios....plötzlich funktioniert es  :o

Poste mal den korrekten Quelltext...Vielen Dank für die Hilfe!

Grüzerl

CO

### [#12](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/12) · DonBoolione · 2006-09-21

Kurios....plötzlich funktioniert es  :o

Poste mal den korrekten Quelltext...Vielen Dank für die Hilfe!

Grüzerl

CO

```php
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2006 Christian Ottersbach <admin@codesigned.net>
*  All rights reserved
* 
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'Partner' for the 'partner_gg' extension.
 *
 * @author	Christian Ottersbach <admin@codesigned.net>
 * @package	TYPO3
 * @subpackage	tx_partnergg
 */
class tx_partnergg_pi1 extends tslib_pibase {
	var $prefixId = 'tx_partnergg_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.tx_partnergg_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey = 'partner_gg';	// The extension key.
	var $pi_checkCHash = TRUE;
	
	/**
	 * Main method of your PlugIn
	 *
	 * @param	string		$content: The content of the PlugIn
	 * @param	array		$conf: The PlugIn Configuration
	 * @return	The content that should be displayed on the website
	 */
	function main($content,$conf)	{
		switch((string)$conf['CMD'])	{
			case 'singleView':
				list($t) = explode(':',$this->cObj->currentRecord);
				$this->internal['currentTable']=$t;
				$this->internal['currentRow']=$this->cObj->data;
				return $this->pi_wrapInBaseClass($this->singleView($content,$conf));
			break;
			default:
				if (strstr($this->cObj->currentRecord,'tt_content'))	{
					$conf['pidList'] = $this->cObj->data['pages'];
					$conf['recursive'] = $this->cObj->data['recursive'];
				}
				return $this->pi_wrapInBaseClass($this->listView($content,$conf));
			break;
		}
	}
	
	/**
	 * Shows a list of database entries
	 *
	 * @param	string		$content: content of the PlugIn
	 * @param	array		$conf: PlugIn Configuration
	 * @return	HTML list of table entries
	 */
	function listView($content,$conf)	{
		$this->conf=$conf;		// Setting the TypoScript passed to this function in $this->conf
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();		// Loading the LOCAL_LANG values
		
		$lConf = $this->conf['listView.'];	// Local settings for the listView function
	
		if ($this->piVars['showUid'])	{	// If a single element should be displayed:
			$this->internal['currentTable'] = 'tx_partnergg_partner';
			$this->internal['currentRow'] = $this->pi_getRecord('tx_partnergg_partner',$this->piVars['showUid']);
	
			$content = $this->singleView($content,$conf);
			return $content;
		} else {
			$items=array(
				'1'=> $this->pi_getLL('list_mode_1','Mode 1'),
				'2'=> $this->pi_getLL('list_mode_2','Mode 2'),
				'3'=> $this->pi_getLL('list_mode_3','Mode 3'),
			);
			if (!isset($this->piVars['pointer']))	$this->piVars['pointer']=0;
			if (!isset($this->piVars['mode']))	$this->piVars['mode']=1;
	
				// Initializing the query parameters:
			list($this->internal['orderBy'],$this->internal['descFlag']) = explode(':',$this->piVars['sort']);
			$this->internal['results_at_a_time']=t3lib_div::intInRange($lConf['results_at_a_time'],0,1000,6);		// Number of results to show in a listing.
			$this->internal['maxPages']=t3lib_div::intInRange($lConf['maxPages'],0,1000,3);;		// The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc.
			$this->internal['searchFieldList']='name,details';
			$this->internal['orderByList']='uid,name';
	
				// Get number of records:
			$res = $this->pi_exec_query('tx_partnergg_partner',1);
			list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
	
				// Make listing query, pass query to SQL database:
			$res = $this->pi_exec_query('tx_partnergg_partner');
			$this->internal['currentTable'] = 'tx_partnergg_partner';
	
				// Put the whole list together:
			$fullTable='';	// Clear var;
		#	$fullTable.=t3lib_div::view_array($this->piVars);	// DEBUG: Output the content of $this->piVars for debug purposes. REMEMBER to comment out the IP-lock in the debug() function in t3lib/config_default.php if nothing happens when you un-comment this line!
	
				// Adds the mode selector.
//			$fullTable.=$this->pi_list_modeSelector($items);

				// Adds the whole list table
			$fullTable.=$this->pi_list_makelist($res);
			
				// Adds the result browser:
			$fullTable.=$this->pi_list_browseresults();	
			

	
				// Adds the search box:
			$fullTable.=$this->pi_list_searchBox();
	

	
				// Returns the content from the plugin.
			return $fullTable;
		}
	}
	/**
	 * Display a single item from the database
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	HTML of a single database entry
	 */
	function singleView($content,$conf)	{
		$this->conf=$conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		
	
			// This sets the title of the page for use in indexed search results:
		if ($this->internal['currentRow']['title'])	$GLOBALS['TSFE']->indexedDocTitle=$this->internal['currentRow']['title'];
	
		$content='<div'.$this->pi_classParam('singleView').'>
			<h2>Record "'.$this->internal['currentRow']['uid'].'" from table "'.$this->internal['currentTable'].'":</h2>
			<table>
				<tr>
					<td nowrap="nowrap" valign="top" this-="">pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('name').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('name').'</p></td>
				</tr>
				<tr>
					<td nowrap="nowrap" valign="top" this-="">pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('link').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('link').'</p></td>
				</tr>
				<tr>
					<td nowrap="nowrap" valign="top" this-="">pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('logo').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('logo').'</p></td>
				</tr>
				<tr>
					<td nowrap="nowrap" valign="top" this-="">pi_classParam('singleView-HCell').'><p>'.$this->getFieldHeader('details').'</p></td>
					<td valign="top"><p>'.$this->getFieldContent('details').'</p></td>
				</tr>
				<tr>
					<td nowrapthis-="">pi_classParam('singleView-HCell').'><p>Last updated:</p></td>
					<td valign="top"><p>'.date('d-m-Y H:i',$this->internal['currentRow']['tstamp']).'</p></td>
				</tr>
				<tr>
					<td nowrapthis-="">pi_classParam('singleView-HCell').'><p>Created:</p></td>
					<td valign="top"><p>'.date('d-m-Y H:i',$this->internal['currentRow']['crdate']).'</p></td>
				</tr>
			</table>
		<p>'.$this->pi_list_linkSingle($this->pi_getLL('back','Back'),0).'</p></div>'.
		$this->pi_getEditPanel();
	
		return $content;
	}
	/**
	 * Returns a single table row for list view
	 *
	 * @param	integer		$c: Counter for odd / even behavior
	 * @return	A HTML table row
	 */
	function pi_list_row($c)	{
		$editPanel = $this->pi_getEditPanel();
		if ($editPanel)	$editPanel='<td>'.$editPanel.'</td>';
	
		return '<tr'.($c%2 this-="">pi_classParam('listrow-odd') : '').'>
				<td><p>'.$this->getFieldContent('uid').'</p></td>
				<td valign="top"><p>'.$this->getFieldContent('name').'</p></td>
				<td valign="top"><p>'.$this->getFieldContent('link').'</p></td>
				<td valign="top"><p>'.$this->getFieldContent('logo').'</p></td>
			</tr>';
	}
	/**
	 * Returns a table row with column names of the table
	 *
	 * @return	A HTML table row
	 */
	function pi_list_header()	{
		return '<tr'.$this->pi_classParam('listrow-header').'>
				<td><p>'.$this->getFieldHeader_sortLink('uid').'</p></td>
				<td><p>'.$this->getFieldHeader_sortLink('name').'</p></td>
				<td nowrap=""><p>'.$this->getFieldHeader('link').'</p></td>
				<td nowrap=""><p>'.$this->getFieldHeader('logo').'</p></td>
			</tr>';
	}
	/**
	 * Returns the content of a given field
	 *
	 * @param	string		$fN: name of table field
	 * @return	Value of the field
	 */
	 


	 
	 
	 
	 
	 
	function getFieldContent($fN)	{ 
	
	   $img["file"] = 'uploads/tx_partnergg/'. $row["logo"];
      $img['params'] = $this->pi_classParam('image');
      $img['altText'] = 'Bild';
      $img['titleText'] = $row['title'];
      $img['file.']['maxW']=300;
      $img['file.']['maxH']=200;
      $tempItem['image'] = $this->cObj->IMAGE($img); 
	
		switch($fN) {
			case 'uid':
				return $this->pi_list_linkSingle($this->internal['currentRow'][$fN],$this->internal['currentRow']['uid'],1);	// The "1" means that the display of single items is CACHED! Set to zero to disable caching.
			break;
			case "details":
				return $this->pi_RTEcssText($this->internal['currentRow']['details']);
			break;
			case "logo":
			$imgTSConfig = $this->conf['logoCObject.'];
			$imgTSConfig['file'] = 'uploads/tx_partnergg/'.$this->internal['currentRow'][$fN]; 
			return $this->cObj->IMAGE($imgTSConfig);
			break;
			default:
				return $this->internal['currentRow'][$fN];
			break;
		}
	}
	/**
	 * Returns the label for a fieldname from local language array
	 *
	 * @param	[type]		$fN: ...
	 * @return	[type]		...
	 */
	function getFieldHeader($fN)	{
		switch($fN) {
			
			default:
				return $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');
			break;
		}
	}
	
	/**
	 * Returns a sorting link for a column header
	 *
	 * @param	string		$fN: Fieldname
	 * @return	The fieldlabel wrapped in link that contains sorting vars
	 */
	function getFieldHeader_sortLink($fN)	{
		return $this->pi_linkTP_keepPIvars($this->getFieldHeader($fN),array('sort'=>$fN.':'.($this->internal['descFlag']?0:1)));
	}
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/partner_gg/pi1/class.tx_partnergg_pi1.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/partner_gg/pi1/class.tx_partnergg_pi1.php']);
}

?>
```

### [#13](https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net/13) · TheFreeman · 2008-01-11

Hallo zusammen,

ich habe ein Ähnliches Problem.
Nur bei mir wird der komplette Pfad richtig übergeben, aber das Bild wird nicht gerendert. :(

Mein PHP:

```php
$mainImgTSConfig = $this->conf['mainImageCObject.'];
$mainImgTSConfig['file'] = 'uploads/tx_dskameraprofile/'.$resKamera['main_img'];
echo $this->cObj->IMAGE(mainImgTSConfig);
```

Ausgabe von der Var **$resKamera['main_img']** ist:

```html
titelbild_frei_02.gif
```

Und der komplett erzeugte Pfad ist auch richtig:

```html
uploads/tx_dskameraprofile/titelbild_frei_02.gif
```

Aber es wird nichts ausgegeben.
Das Bild ist aber da und der Pfad stimmt auch. #angry#

---

Quelle: „Anzeige des Bildes in eigener Extension funzt net!“, typo3.net, https://www.typo3.net/d/50171-anzeige-des-bildes-in-eigener-extension-funzt-net
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
