also das mit dem includen funktioniert immer noch nicht.
folgende Fehlermeldung erscheitn:
Warning: Unknown: failed to open stream: No such file or directory in /srv/www/htdocs/typo381/typo3conf/ext/page_php_content/pi1/class.tx_pagephpcontent_pi1.php(55) : eval()'d code on line 5
Warning: Unknown: Failed opening 'php/rums.php' for inclusion (include_path='/usr/share/php5') in /srv/www/htdocs/typo381/typo3conf/ext/page_php_content/pi1/class.tx_pagephpcontent_pi1.php(55) : eval()'d code on line 5
(vielleicht muss man einen anderen Pfad wählen, normalerweise wähle ich den pfad relativ zu der datei, die die andere includen soll. nur das php-skript, das die andere includen soll ist ja in der DB abgespeichert als content, daher hab ich keine ahnung, ab welchem verzeichnis ich den pfad angeben muss. Ist jetzt blöd ausgedrückt, hoffe man versteht was ich meine)
hier die class.tx_pagephpcontent_pi1.php, die den fehler erzeugt:
<?php
/***************************************************************
* Copyright notice ....
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Plugin 'PHP Script' for the 'page_php_content' extension.
*
* @author Gary <gniemcew@yahoo.com>
*/
require_once(PATH_tslib."class.tslib_pibase.php");
class tx_pagephpcontent_pi1 extends tslib_pibase
{
var $prefixId = "tx_pagephpcontent_pi1";
var $scriptRelPath = "pi1/class.tx_pagephpcontent_pi1.php";
var $extKey = "page_php_content";
//
// PHP Script Page Content Type
//
// Adds a "PHP Script" non-cached page content type. You can enter a snippet of PHP code as a part of a page and have
// it executed when building a page without writing an extension or going through tag processing with parseFunc.
// Uses the dreaded PHP eval().
//
function ext_getContentVar($key)
{
return $this->cObj->data[$key];
}
function main($content,$conf)
{
$phpCode = $this->ext_getContentVar("tx_pagephpcontent_php_code");
ob_start();
eval("?" . chr(62) . $phpCode . chr(60) . "?"); EDIT: zeile 55
$content = ob_get_contents();
ob_end_clean();
return $content;
}
}
if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/page_php_content/pi1/class.tx_pagephpcontent_pi1.php"]) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/page_php_content/pi1/class.tx_pagephpcontent_pi1.php"]);
}
?>