File size: 4.08Kb
<?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/' . $config['themes'] . '/index.php');
if (isset($_GET['start'])) {
$start = abs(intval($_GET['start']));
} else {
$start = 0;
}
if (isset($_GET['sort'])) {
$sort = check($_GET['sort']);
} else {
$sort = 'read';
}
switch ($sort) {
case 'rated': $order = 'blogs_rating';
break;
case 'comm': $order = 'blogs_comments';
break;
default: $order = 'blogs_read';
}
# ###########################################################################################
# # Топ тем ##
# ###########################################################################################
show_title('site.png', 'Топ популярных блогов');
$config['newtitle'] = 'Топ популярных блогов';
echo '<a href="#down"><img src="../images/img/downs.gif" alt="Вниз" /></a> ';
echo 'Сортировать: ';
if ($order == 'blogs_read') {
echo '<b><a href="top.php?sort=read&' . SID . '">Просмотры</a></b>, ';
} else {
echo '<a href="top.php?sort=read&' . SID . '">Просмотры</a>, ';
}
if ($order == 'blogs_rating') {
echo '<b><a href="top.php?sort=rated&' . SID . '">Оценки</a></b>, ';
} else {
echo '<a href="top.php?sort=rated&' . SID . '">Оценки</a>, ';
}
if ($order == 'blogs_comments') {
echo '<b><a href="top.php?sort=comm&' . SID . '">Комментарии</a></b>';
} else {
echo '<a href="top.php?sort=comm&' . SID . '">Комментарии</a>';
}
echo '<hr />';
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `blogs`;");
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryblog = DB :: $dbh -> query("SELECT `blogs`.*, `cats_id`, `cats_name` FROM `blogs` LEFT JOIN `catsblog` ON `blogs`.`blogs_cats_id`=`catsblog`.`cats_id` ORDER BY " . $order . " DESC LIMIT " . $start . ", " . $config['blogpost'] . ";");
while ($data = $queryblog -> fetch()) {
if ($data['blogs_rating'] > 0) {
$data['blogs_rating'] = '<span style="color:#00aa00">+' . $data['blogs_rating'] . '</span>';
}
if ($data['blogs_rating'] < 0) {
$data['blogs_rating'] = '<span style="color:#ff0000">' . $data['blogs_rating'] . '</span>';
}
echo '<div class="b"><img src="../images/img/edit.gif" alt="image" /> ';
echo '<b><a href="blog.php?act=view&id=' . $data['blogs_id'] . '&' . SID . '">' . $data['blogs_title'] . '</a></b> (' . $data['blogs_rating'] . ')</div>';
echo '<div>Категория: <a href="blog.php?cid=' . $data['cats_id'] . '&' . SID . '">' . $data['cats_name'] . '</a><br />';
echo 'Просмотров: ' . $data['blogs_read'] . '<br />';
echo 'Рейтинг: <b>' . $data['blogs_rating'] . '</b><br />';
echo '<a href="blog.php?act=comments&id=' . $data['blogs_id'] . '&' . SID . '">Комментарии</a> (' . $data['blogs_comments'] . ')</div>';
}
page_strnavigation('top.php?sort=' . $sort . '&', $config['blogpost'], $start, $total);
} else {
show_error('Опубликованных статей еще нет!');
}
echo '<img src="../images/img/reload.gif" alt="image" /> <a href="index.php?' . SID . '">Категории</a><br />';
echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a>';
include_once ('../themes/' . $config['themes'] . '/foot.php');
?>