Output:
- Code: Alles auswählen
if ( !$REX[REDAXO]):
$home = OOCategory::getCategoryById( REX_CATEGORY_ID);
$articles = $home->getArticles( true);
for($i = 0; $i < count( $articles); $i++) {
// keine Startartikel anzeigen
if( $articles[$i]->isStartPage()) {
unset( $articles[$i]);
continue;
}
// Endlosschleife vermeiden
if( $articles[$i]->getId() == REX_ARTICLE_ID) {
unset( $articles[$i]);
continue;
}
}
shuffle( $articles);
$randIndex = mt_rand( 0, count( $articles) -1);
$randArticle = $articles[ $randIndex];
$article = new article();
$article->setArticleId( $randArticle->getId());
echo $article->getArticle();
endif;
?>
Ich bekomme immer ein:
Fatal error: Call to a member function on a non-object in /var/www/vhosts/serveradmin2.de/httpdocs/redaxo/include/classes/class.rex_article.inc.php(250) : eval()'d code on line 30

