$template -> AddRow("articles"); for($i=0;($i<(5)) && ($i<$total_result);$i++) { $articles = sql_fetch_object($main_result); $result=sql_query("SELECT title, address FROM ".$SQL_PREFIX."_articles_column WHERE id = '" . $articles->column_ . "';"); $column = sql_fetch_object($result); /* Authors */ $articles->author = explode(';', $articles->authors); for($j=0;$j<(count($articles->author)-1);$j++) { $result = sql_query("SELECT name, item FROM ".$SQL_PREFIX."_authors WHERE id = '" . $articles->author[$j] . "';"); $author = sql_fetch_object($result); if($j != (count($articles->author)-2)) { if($cfg['url_rewrite'] == 1) { $article_authors .= ''. $author->name .', '; } else { $article_authors .= ''. $author->name .', '; } } else { if($cfg['url_rewrite'] == 1) { $article_authors .= ''. $author->name .''; } else { $article_authors .= ''. $author->name .''; } } } $result=sql_query("SELECT id FROM ".$SQL_PREFIX."_comments_articles WHERE idw = '" . $articles->article . "';"); $post['count'] = sql_num_rows($result); $result=sql_query("SELECT type FROM ".$SQL_PREFIX."_articles_types WHERE id = '" . $articles->type . "';"); $row_array = sql_fetch_row($result); $type = $row_array[0]; include('lib/comments.php'); if($articles->date_pub != $articles->date_update) { $articles->updated = 1; } $date = $articles->date_pub; $date_pub = DateFormat($date); $date = $articles->date_update; $date_update = DateFormat($date); /* Normal articles */ if(empty($articles->redir)) { if(!empty($articles->img)) { $template -> AddTag("ARTICLE_IMG_P1", '
'. $articles->title   . '', "articles"); } /* SEO URL */ if($cfg['url_rewrite'] == 1) { $template -> AddTag("ARTICLE_URL", $cfg['server_url'] .'article/'. $column->address .'/'. $articles->item, "articles"); } else { $template -> AddTag("ARTICLE_URL", $cfg['server_url'] .'article.php?item='. $articles->item, "articles"); } $template -> AddTag("ARTICLE_TITLE", $articles->title, "articles"); $template -> AddTag("ARTICLE_DATE_PUB", $date_pub, "articles"); if($articles->updated == 1) { $template -> AddTag("ARTICLE_DATE_UPDATE", ''. $lang[updated] .': '. $date_update .'', "articles"); } $template -> AddTag("ARTICLE_AUTHORS", ', '. $article_authors, "articles"); $template -> AddTag("ARTICLE_TYPE", ', '.$type, "articles"); $template -> AddTag("ARTICLE_COMMENTS", ', '. $post['count'] . ' ' . $post['name'] .'', "articles"); $template -> AddTag("ARTICLE_ANNOTATION", $articles->annotation, "articles"); if(!empty($articles->img)) { $template -> AddTag("ARTICLE_IMG_P2", '
', "articles"); } } /* Redirect articles */ /*if(!empty($articles->redir)) { echo('
'); if(!empty($articles->img)) { echo('
'); echo(''. $articles->title   . ''); echo(''); } echo('

'. $articles->title . '

'); echo('
'. $date . ', '.$type.'
'); echo('
'. $articles->annotation .'
'); if(!empty($articles->img)) {echo('
');} echo('
'); }*/ unset($article_authors); $template -> ParseRow("articles"); } $template -> AddMainTemplate('main.php'); echo($template -> Render());