Ich versuche text über dem outputfilter zu ersetzen. Das funktioniert auch soweit. Nur wenn ich den PHP Schnippsel
Code: Alles auswählen
$cat = OOCategory::getCategoryById( $this->getValue( 'category_id'));
Code: Alles auswählen
Fatal error: Using $this when not in object context in /home/camping/public_html/redaxo/include/addons/xoutputfilter/functions/functions.inc.php(243) : eval()'d code on line 2
Code: Alles auswählen
$cat = OOCategory::getCategoryById(45);
Wie kann ich $this->getValue umgehen oder das Problem lösen?
Anbei das komplette Modul:
Code: Alles auswählen
<?php
$cat = OOCategory::getCategoryById( $this->getValue( 'category_id'));
$name = $cat->getValue('art_teaser_hdl');
if ($name == '')
$name = $cat->getName();
$star = $cat->getValue('art_teaser_stern');
$ort = $cat->getValue('art_teaser_text');
$s = array (
'1',
'2',
'3',
'4',
'5'
);
$r = array (
'*',
'**',
'***',
'****',
'*****'
);
$stars = str_replace($s, $r, $star);
$out = '';
$out .= $name.$stars.' in '.$ort.', Lesen Sie mehr auf diese Seite.';
echo "$out";
?>
Eric