require 'cfg/_all.php';
$flagRobot = 0;
$id=$_GET['id'];
$th_id=$_GET['th_id'];
$tray=array();
$title_page = 'Статьи';
array_push($tray, array($title_page, 'articles.php'));
if(!empty($th_id))
{
$str = make_all_articles($th_id, 0, 0);
}
elseif(!empty($id))
{
$row = qnext(query("SELECT * FROM $DBarticles WHERE id = '$id'"));
$row_cat = qnext(query("select * from $DBth_articles where id='{$row['th_id']}'"));
array_push($tray, array($row_cat['name'], "articles-th-{$row_cat['id']}.html"));
array_push($tray, array($row['name'], ''));
$title_page = $row['name'];
$str .= str_replace('http://rbe.local', '', $row['descr']);
}
else
{
$str .= "Темы статей:
";
$res = query("select * from $DBth_articles");
while($row = qnext($res))
{
$str .= "
{$row['name']}
";
}
}
// ******************* выводим страницу *****************
header ("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT +0300");
$template = new EasyTemplate("tpl/page.html");
$template->assign("TITLE", $title_page);
$template->assign("BAN", Get_ban($id));
$template->assign("KEYWORDS", $title_page);
$template->assign("DESCRIPTION", $title_page);
$template->assign("MENU_MAIN", make_menu_main(0));
$template->assign("CONTENT", '
'.$ad_google_160x600.' |
'.make_tray().''.$title_page.''.$str.' |