Zum Inhalt springen

Extension geht nicht

Erstellt am 15. Oktober 2008 · 4 Antworten · letzte Antwort am 15. Oktober 2008

Tags: PHP, Frage

freshm.​ ·

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
/***************************************************************
*  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:

<!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

einpraegsam.​net ·

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:

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

Dafür gibts eine TYPO3 API!

freshm.​ ·
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:

$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

freshm.​ ·

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

Markus