Код:
[code]
<?php
$page = 'index';
$locate = 'in_index';
$title = $lang->word('home_1');
require_once(SYS.'/view/header.php');
if($system['open_news'] == 'yes') { $tpl->div('title',' <a href="/news/">'. $lang->word('news') .'</a>'. $stat->news() .'<br/>');
$stat->last_news();
}
if($system['open_forum'] == 'yes') { $tpl->div('title',' <a href="/forum/">'. $lang->word('forum') .'</a> '. $stat->forum() .'<br/>');
}
if($system['show_topics'] == 1) {
$topic_r = $db->query("SELECT * FROM `forum_t`"
->rowCount();
if($topic_r !=0) {
$topic_q = $db->query("SELECT * FROM `forum_t` WHERE `gold` != '1' ORDER BY time_last_post DESC LIMIT 0, 5"
;
$gold = $db->query("SELECT * FROM `forum_t` WHERE `gold` = '1' ORDER BY RAND()"
->rowCount();
if($gold !=0) {
$gold = $db->query("SELECT * FROM `forum_t` WHERE `gold` = '1' ORDER BY RAND()"
->fetch();
echo '<div class=\'gold\'><img src=\'/template/icons/gold.png\' alt=\'GOLD\'/> <a href=\'/forum/topic'.$gold['id'].'/\'>'.$gold['name'].'</a> ['. $db->query("SELECT id FROM `forum_pt` WHERE `topic_id` = '".$gold['id']."'"
->rowCount().'] <a href=\'/forum/topic'.$gold['id'].'/?page=end\'>»</a></div>';
}
while($topic = $topic_q->fetch()) {
echo '<div class="post">';
if ($topic['closed'] == 1 && $topic['attach'] == 1) echo img('pin-closed.png');
else if ($topic['attach'] == 1) echo img('pin.png');
else if ($topic['closed'] == 1) echo img('topic_closed.png');
else echo img('topic.png');
$topic_a = $db->query("SELECT * FROM `forum_pt` WHERE `topic_id` = '". $topic['id']."' ORDER BY time DESC LIMIT 1"
->fetch();
echo '<a href="/forum/topic'. $topic['id'] .'/">'. $topic['name'] .'</a> ['. $db->query("SELECT id FROM `forum_pt` WHERE `topic_id` = '". $topic['id'] ."'"
->rowCount().'] <a href="/forum/topic'. $topic['id'] .'/?page=end">»</a>
</div>';
}
}
}
echo '<div class="title">'.'<a href="/magaz/">Магазин</a> ['.$db->query("select * from `magaz_tovar` "
->rowcount().']</div>';
$magaz_t = $db->query("SELECT * FROM `magaz_tovar` WHERE `pod` = '1'"
->rowCount();
if($magaz_t == 0) {
echo $tpl->div('menu', '<center>Нет новых товаров</center>');
}
else {
$magaz_tt = $db->query("SELECT * FROM `magaz_tovar` WHERE `pod` = '1' ORDER BY `id` DESC LIMIT 3"
;
while($magaz_t = $magaz_tt->fetch()) {
echo '<div class="menu"><img src="/template/icons/shop.png" alt="*"/> <b><a href="/magaz/file/'. $magaz_t['id'] .'/">'. $magaz_t['name'] .'</a></b><br /></div>';
}
}
if($system['open_share'] == 'yes') { $tpl->div('title',' <a href="/share/">'. $lang->word('share') .'</a> '. $stat->share() .'<br/>'); }
$files_q = $db->query("SELECT * FROM `share_files` ORDER BY time DESC LIMIT 3"
;
while($files = $files_q->fetch()) {
echo '<div class="menu">
<img src="/template/icons/box.png" alt="*"/> <b><a href="/share/file/'. $files['id'] .'/">'. $files['name'] .'
</a></b></div>';
}
echo '<div class="title">Меню</div>';
if($system['open_mini_chat'] == 'yes') { $tpl->div('menu', MINI_CHAT_ICON .' <a href="/mini_chat/">'. $lang->word('mini_chat') .'</a> '. $stat->mini_chat() .'<br/>'); }
echo '<div class="menu">'.img('album.png') .'<a href="/work/">Портфолио </a> ['.$db->query("select * from `portfel` "
->rowcount().']</div>';
$tpl->div('menu', USERS_ICON .' <a href="/users/">'. $lang->word('users') .'</a> '. $stat->users() .'<br/>');
echo '</div>';
require_once(SYS.'/view/footer.php');
?>
[/code]
Короче не так как надо работает.Хочу сделать так,что-бы не выявлялись названия скриптов в cat_r=2
Добавлено 20.03.16 в 23:26:42:
Вот как получается