2015-08-05, 05:42 PM
Hello, I've finished a plugin but there's a bug. I know where code is wrong but I can't fix it:
Templates
news
news_list
function news_show(){
global $db, $news, $news_list, $news_content;
$l_news = $db->write_query("SELECT * FROM ".TABLE_PREFIX."news ORDER BY id DESC");
if($db->num_rows($l_news) > 0){
$news_content = "Non ci sono news da mostrare";
} else {
while($row = $db->fetch_array($l_news)){
$news_content .= $row['text'];
}
}
eval('$news_list = "'.$templates->get("news_list").'";');
eval('$news = "'.$templates->get("news").'";');
}
Templates
news
<div class="news">
<div class="msg">
<ul>
{$news_list}
</ul>
</div>
</div>
news_list
<li class="quotes">{$news_content}</li>