Hallo,
ich habe heute mal angefangen meine ersten Extension zu schreiben, nur etwas kleines, aber jetzt suche ich mich bei einem Fehler zu "tode" und hoffe das einer von euch den Fehler schnell finden kann.
Die Ausgabe im Frondend ist fast fertig, nur sollen Bilder ausgegeben werden, bei mir erscheinen aber nur die Namen der Platzhalter (###SPBild###).
Hier der HTML code:
<!-- ###SPONSOREN### begin -->
<table width="168" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="right"><img src="fileadmin\SVU09\images\sponsorenkopf.jpg" width="100%" height="57" alt="" /><font color="#FF0000"></font></td>
</tr>
<tr>
<td width="164">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- ###EINTRAG### begin -->
<tr>
<td>###SPBild###</td>
</tr>
<!-- ###EINTRAG### end -->
</table>
</td>
<td width="4" bgcolor="#5BC029"><font color="#FF0000"></font></td>
</tr>
</table>
<!-- ###SPONSOREN### end -->
und hier noch die pi1 inhalt:
<?php
/***************************************************************
* Copyright notice
*
*
* 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 'Sponsoren' for the 'svusponsoren' extension.
*
* @author
*/
require_once(PATH_tslib.'class.tslib_pibase.php');
class tx_svusponsoren_pi1 extends tslib_pibase {
var $prefixId = 'tx_svusponsoren_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.tx_svusponsoren_pi1.php'; // Path to this script relative to the extension dir.
var $extKey = 'svusponsoren'; // The extension key.
/**
* [Put your description here]
*/
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->pi_USER_INT_obj=1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
$content = "";
$marker = array();
$img_pfad = "uploads/";
$tmpl = $this->cObj->fileResource("fileadmin/SVU09/sponsoren.html");
$tmpl = $this->cObj->getSubpart($tmpl, "###SPONSOREN###");
$tmpl_eintrag = $this->cObj->getSubpart($tmpl, "###EINTRAG###");
$query = "SELECT * FROM tx_svusponsoren_main ";
$query .= " WHERE deleted = 0 AND hidden = 0 ";
$res = mysql(TYPO3_db,$query);
while ($row = mysql_fetch_assoc($res)){
$conf["logo."]["file."]["10."]["file"]=$img_pfad.$row["logo"];
//$marker["###SPBild###"] = $row["logo"];
$marker["###SPBILD###"] = $this->cObj->cObjGetSingle($conf["logo"],$conf["logo."]);
$content .= $this->cObj->substituteMarkerArrayCached($tmpl_eintrag,$marker);
}
$content = $this->cObj->substituteSubpart($tmpl,"###EINTRAG###",$content);
return $content;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/svusponsoren/pi1/class.tx_svusponsoren_pi1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/svusponsoren/pi1/class.tx_svusponsoren_pi1.php']);
}
?>
und hier noch TS
plugin.tx_svusponsoren_pi1
plugin.tx_svusponsoren_pi1 {
testObjekt = IMAGE
testObjekt.file = GIFBUILDER
testObjekt.file {
XY = 100,100
backColor = red
}
templateFile = fileadmin/SVU09/sponsoren.html
bild = IMAGE
bild {
XY = [10.w]+2, [10.h]+2
backColor = black
10 = IMAGE
# Der Pfad zum Bild wird später dynamisch ersetzt.
10.file = unbekannt
10.file.width = 150
10.offset = 1,1
}
# Dieses Bild soll angezeigt werden, wenn kein Foto vorhanden ist.
bild_default = IMAGE
bild_default.file = GIFBUILDER
bild_default.file {
XY = 152, 50
backColor = white
10 = TEXT
10.text = N/A
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontSize = 20
10.fontColor = black
10.niceText = 1
10.offset = 30,25
}
}
vielen Dank