File size: 2.9Kb
<?php
#-----------------------------------------------------#
# ********* ROTORCMS ********* #
# Made by : VANTUZ #
# E-mail : [email protected] #
# Site : http://pizdec.ru #
# WAP-Site : http://visavi.net #
# ICQ : 36-44-66 #
# Вы не имеете право вносить изменения в код скрипта #
# для его дальнейшего распространения #
#-----------------------------------------------------#
require_once ('../includes/start.php');
require_once ('../includes/functions.php');
require_once ('../includes/header.php');
include_once ('../themes/header.php');
if (isset($_GET['start'])) {
$start = abs(intval($_GET['start']));
} else {
$start = 0;
}
if (isset($_GET['act'])) {
$act = check($_GET['act']);
} else {
$act = 'index';
}
switch ($act):
############################################################################################
## Топ тем ##
############################################################################################
case "index":
show_title('site.png', 'Топ популярных тем');
$config['newtitle'] = 'Топ популярных тем';
$total = DB::run() -> querySingle("SELECT count(*) FROM topics;");
if ($total > 0) {
if ($start >= $total) {
$start = last_page($total, $config['forumtem']);
}
$querytopic = DB::run() -> query("SELECT * FROM `topics` WHERE `topics_closed`=? ORDER BY `topics_posts` DESC LIMIT ".$start.", ".$config['forumtem'].";", array(0));
while ($data = $querytopic -> fetch()) {
echo '<div class="b">';
if ($data['topics_locked'] == 1) {
echo '<img src="../images/img/lock.gif" alt="image" /> ';
} elseif ($data['topics_closed'] == 1) {
echo '<img src="../images/img/closed.gif" alt="image" /> ';
} else {
echo '<img src="../images/img/forums.gif" alt="image" /> ';
}
echo '<b><a href="topic.php?tid='.$data['topics_id'].'&'.SID.'">'.$data['topics_title'].'</a></b> ('.$data['topics_posts'].')</div>';
echo '<div>Страницы: ';
forum_navigation('topic.php?tid='.$data['topics_id'].'&', $config['forumpost'], $data['topics_posts']);
echo 'Автор: '.$data['topics_author'].'<br />';
echo 'Сообщение: '.$data['topics_last_user'].' ('.date_fixed($data['topics_last_time']).')</div>';
}
page_strnavigation('top.php?', $config['forumtem'], $start, $total);
} else {
show_error('Созданных тем еще нет!');
}
break;
default:
redirect("top.php?".SID);
endswitch;
echo '<img src="../images/img/reload.gif" alt="image" /> <a href="index.php?'.SID.'">К форумам</a><br />';
include_once ('../themes/footer.php');
?>