---
title: "Extension geht nicht"
url: "https://www.typo3.net/d/82859-extension-geht-nicht"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage","PHP"]
created: "2008-10-15"
last_reply: "2008-10-15"
replies: 4
solved: false
page: 1
pages: 1
lang: "de"
---

# Extension geht nicht

Extensions › Entwicklung · 4 Antworten · gestartet 2008-10-15

## Eröffnungsbeitrag

**freshm.​** · 2008-10-15 · [Beitrag #1](https://www.typo3.net/d/82859-extension-geht-nicht/1)

Hey Leute

Ich hab eine Extension mit kickstart geschrieben aber sie funktioniert nicht.Ich wollte eine einfach eine Box haben.
Hier ist mein code:

```php
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2005 Markus ()
*  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!
***************************************************************/
/**
 * Plugin 'downloadbox' for the 'downloadbox' extension.
 *
 * @author	Markus <>
 */


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

class tx_downloadbox_pi1 extends tslib_pibase {
	var $prefixId = 'tx_downloadbox_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.tx_downloadbox_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey = 'downloadbox';	// The extension key.
	var $pi_checkCHash = TRUE;
	
	/**
	 * [Put your description here]
	 */
	function main($content,$conf)	{
		
	$this->conf=$conf;
                $this->pi_setPiVarDefaults();
                $this->pi_loadLL();

		$box = $this->cObj->data['tx_downloadbox_box'];

		$query = "SELECT content FROM tx_downloadbox_contents WHERE uid=$box";
		
		$dbres = mysql(TYPO3_db,$query);

		$rows = mysql_fetch_array($dbres);
		
	
		$markerArray = array (
			"###BOX_TITLE###" => $rows,
			"###BOX_CONTENT###" => "Downloadbox"
		);

		$content.=$this->cObj->substituteMarkerArray($markerArray);
		return($content);
  }

	}




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

?>
```

Hier ist der tmpl-Code:

```html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<TITLE>Boxs Template</TITLE>
</head>

<body>





<!-- ###GALLERY_TABLE### -->
<table cellspacing="0" cellpadding="5" border="0">
  <!-- ###CONTENT### -->
  <!-- ###GALLERY_TABLE_ROW### -->
  <tr>
    <!-- ###CONTENT_ROW### -->
    <!-- ###GALLERY_TABLE_ITEM### -->
    <td align="center" valign="bottom">###GALLERY_IMAGE###</td>
    <!-- ###GALLERY_TABLE_ITEM### -->
    <!-- ###CONTENT_ROW### -->
  </tr>
  <!-- ###GALLERY_TABLE_ROW### -->
  <!-- ###CONTENT### -->
</table>
<!-- ###GALLERY_TABLE### -->

</BODY>
</HTML>
```

BITTE HELFT MIR

## Antworten

### [#2](https://www.typo3.net/d/82859-extension-geht-nicht/2) · einpraegsam.​net · 2008-10-15

Nachdem ich nun die Überschrift des Threads korrigiert und auch noch deinen Code als solchen ausgezeichnet habe, habe ich nun Zeit, mich deiner Frage zu widmen.

Wo wird bei dir der HTML Code eingelesen?

PS:

```typoscript
$dbres = mysql(TYPO3_db,$query);
$rows = mysql_fetch_array($dbres);
```

Dafür gibts eine TYPO3 API!

### [#3](https://www.typo3.net/d/82859-extension-geht-nicht/3) · freshm.​ · 2008-10-15

> **einpraegsam.net schrieb:**
>
> Nachdem ich nun die Überschrift des Threads korrigiert und auch noch deinen Code als solchen ausgezeichnet habe, habe ich nun Zeit, mich deiner Frage zu widmen.
>
> Wo wird bei dir der HTML Code eingelesen?
>
> PS:
>
> ```typoscript
> $dbres = mysql(TYPO3_db,$query);
> $rows = mysql_fetch_array($dbres);
> ```
>
> Dafür gibts eine TYPO3 API!

Also,ertmals danke für die schnelle Antwort.Der HTML-Code wird bei mir in kickstart in TypoScript definiert.
plugins.tx_ttbox_pi1 {
	templateFile = EXT:tt_box/pi1/default.tmpl
}
was stimmt an meinen Code nicht???  o.O

### [#4](https://www.typo3.net/d/82859-extension-geht-nicht/4) · einpraegsam.​net · 2008-10-15

> **freshm. schrieb:**
>
> ```typoscript
> plugins.tx_ttbox_pi1 {
> 	templateFile = EXT:tt_box/pi1/default.tmpl
> }
> ```

Ich lese nirgends:

```php
$html = $this->cObj->fileResource($conf['templateFile']);
```

Schau dir mal ganz genau diese Anleitung an:
<http://wiki.typo3.org/index.php/Extension_Development,_using_HTML-Templates>

PS: Bitte deinen Code künftig auszeichnen

### [#5](https://www.typo3.net/d/82859-extension-geht-nicht/5) · freshm.​ · 2008-10-15

Danke für deine Antwort und für das coole tutorial(oder documentation) :D
Ich werde versuchen meine Extension zum laufen zu bringen.
Ich hoffe das ich es schaffe 8-) .

Markus

---

Quelle: „Extension geht nicht“, typo3.net, https://www.typo3.net/d/82859-extension-geht-nicht
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
