Файл: lenta.php
Строк: 429
<?
include 'connect.php';
$location = '(Смотрит события)';
if(!$u['id']){
header ("Location: registration.php?err=1");
exit;
}
$location = '(Смотрит события)';
switch($_GET['act'])
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Статусы~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'microblog':
$title = $title.' | События статусов';
include 'head.php';
echo '<div class="title"><img src= "ico/lenta.png"> <a href = "lenta.php?">События</a> / <b> Статусы</b></div>';
echo '<div class="nav">';
echo 'Сортировать</br>';
echo '<a href = "lenta.php?">Все</a> | <b>Статусы</b> | <a href = "lenta.php?act=foto">Фото</a>';
echo '</div>';
if($u['setting_jurnal_list']) $count = $u['setting_jurnal_list']; else $count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta_blog`"), 0);
if($all > 0){
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $count - $count;
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-up" style="float: right; text-decoration: none;" href="page-down"><img src = "ico/page_down.png"></a>';
}
$sort = $_GET['sort'];
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=microblog&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=microblog&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
$result = mysql_query("SELECT * FROM `lenta_blog` ORDER BY `time` $sortq LIMIT $start, $count");
while($lenta = mysql_fetch_assoc($result)){
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$lenta["user"]."'"));
echo $i % 2 ? '<div class="div">' : '<div class="div">';
if($lenta['new'] == 1) echo '<span style="float: right; font-size: small; color: grey"><font color="red">New</font></span>';
echo ''.ico($user['sex'],$user['admin']).' <a href = "page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).' ';
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
echo ' <small>'.vremya($lenta['time']).'</small>';
echo '<br/> '.$lenta['text'].'';
echo '<br/>';
if($lenta['new'] == 1) echo '</div>';
if($lenta['new'] == 1) mysql_query("UPDATE `lenta_blog` SET `new` = 0 WHERE `id` = '".$lenta['id']."'");
echo '</div>';
$i++;
}
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-down" style="float: right; text-decoration: none;" href="page-up"><img src = "ico/page_up.png"></a>';
}
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=microblog&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=microblog&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
echo '</div>';
navigation($page, $total,'lenta.php?act=microblog&sort='.$sort.'&');
}else{
echo '<div class="div"> <img src="ico/error.gif" alt="Ошибка" /> Нет новых событий!</div>';
}
echo '</div>';
include 'foot.php';
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Форум~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'forum':
$title = $title.' | Лента Форум';
include 'head.php';
echo '<div class="title"><img src= "ico/lenta.png"> <a href = "lenta.php?">Лента</a> / <b>Форум</b></div>';
echo '<div class="nav">';
echo 'Сортировать</br>';
echo '<a href = "lenta.php?">Все</a> | <a href = "lenta.php?act=microblog">Статусы</a> | <a href = "lenta.php?act=foto">Фото</a>';
echo '</div>';
if($u['setting_jurnal_list']) $count = $u['setting_jurnal_list']; else $count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta_forum`"), 0);
if($all > 0){
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $count - $count;
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-up" style="float: right; text-decoration: none;" href="page-down"><img src = "ico/page_down.png"></a>';
}
$sort = $_GET['sort'];
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=forum&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=forum&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
$result = mysql_query("SELECT * FROM `lenta_forum` ORDER BY `time` $sortq LIMIT $start, $count");
while($lenta = mysql_fetch_assoc($result)){
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$lenta["user"]."'"));
echo $i % 2 ? '<div class="div">' : '<div class="div">';
if($lenta['new'] == 1) echo '<span style="float: right; font-size: small; color: grey"><font color="red">New</font></span>';
echo ''.ico($user['sex'],$user['admin']).' <a href = "page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).' ';
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
echo ' <small>'.vremya($lenta['time']).'</small>';
echo '<br/> '.$lenta['text'].'';
echo '<br/>';
if($lenta['new'] == 1) echo '</div>';
if($lenta['new'] == 1) mysql_query("UPDATE `lenta_forum` SET `new` = 0 WHERE `id` = '".$lenta['id']."'");
echo '</div>';
$i++;
}
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-down" style="float: right; text-decoration: none;" href="page-up"><img src = "ico/page_up.png"></a>';
}
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=forum&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=forum&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
echo '</div>';
navigation($page, $total,'lenta.php?act=forum&sort='.$sort.'&');
}else{
echo '<div class="div"> <img src="ico/error.gif" alt="Ошибка" /> Нет новых событий!</div>';
}
echo '</div>';
include 'foot.php';
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Дневники~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'blog':
$title = $title.' | Лента Дневники';
include 'head.php';
echo '<div class="title"><img src= "ico/lenta.png"> <a href = "lenta.php?">Лента</a> / <b>Дневники</b></div>';
echo '<div class="nav">';
echo 'Сортировать</br>';
echo '<a href = "lenta.php?">Все</a> | <a href = "lenta.php?act=microblog">Статусы</a> | <a href = "lenta.php?act=foto">Фото</a>';
echo '</div>';
if($u['setting_jurnal_list']) $count = $u['setting_jurnal_list']; else $count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta_diary`"), 0);
if($all > 0){
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $count - $count;
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-up" style="float: right; text-decoration: none;" href="page-down"><img src = "ico/page_down.png"></a>';
}
$sort = $_GET['sort'];
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=blog&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=blog&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
$result = mysql_query("SELECT * FROM `lenta_diary` ORDER BY `time` $sortq LIMIT $start, $count");
while($lenta = mysql_fetch_assoc($result)){
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$lenta["user"]."'"));
echo $i % 2 ? '<div class="div">' : '<div class="div">';
if($lenta['new'] == 1) echo '<span style="float: right; font-size: small; color: grey"><font color="red">New</font></span>';
echo ''.ico($user['sex'],$user['admin']).' <a href = "page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).' ';
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
echo ' <small>'.vremya($lenta['time']).'</small>';
echo '<br/> '.$lenta['text'].'';
echo '<br/>';
if($lenta['new'] == 1) echo '</div>';
if($lenta['new'] == 1) mysql_query("UPDATE `lenta_diary` SET `new` = 0 WHERE `id` = '".$lenta['id']."'");
echo '</div>';
$i++;
}
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-down" style="float: right; text-decoration: none;" href="page-up"><img src = "ico/page_up.png"></a>';
}
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=blog&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=blog&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
echo '</div>';
navigation($page, $total,'lenta.php?act=blog&sort='.$sort.'&');
}else{
echo '<div class="div"> <img src="ico/error.gif" alt="Ошибка" /> Нет новых событий!</div>';
}
echo '</div>';
include 'foot.php';
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Фото~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'foto':
$title = $title.' | События фотографии';
include 'head.php';
echo '<div class="title"><img src= "ico/lenta.png"> <a href = "lenta.php?">События</a> / <b>Фото</b></div>';
echo '<div class="nav">';
echo 'Сортировать</br>';
echo '<a href = "lenta.php?">Все</a> | <a href = "lenta.php?act=microblog">Статусы</a> | <b>Фото</b>';
echo '</div>';
if($u['setting_jurnal_list']) $count = $u['setting_jurnal_list']; else $count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta_foto`"), 0);
if($all > 0){
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $count - $count;
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-up" style="float: right; text-decoration: none;" href="page-down"><img src = "ico/page_down.png"></a>';
}
$sort = $_GET['sort'];
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=foto&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=foto&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
$result = mysql_query("SELECT * FROM `lenta_foto` ORDER BY `time` $sortq LIMIT $start, $count");
while($lenta = mysql_fetch_assoc($result)){
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$lenta["user"]."'"));
echo $i % 2 ? '<div class="div">' : '<div class="div">';
if($lenta['new'] == 1) echo '<span style="float: right; font-size: small; color: grey"><font color="red">New</font></span>';
echo ''.ico($user['sex'],$user['admin']).' <a href = "page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).' ';
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
echo ' <small>'.vremya($lenta['time']).'</small>';
echo '<br/> '.$lenta['text'].'';
echo '<br/>';
if($lenta['new'] == 1) echo '</div>';
if($lenta['new'] == 1) mysql_query("UPDATE `lenta_foto` SET `new` = 0 WHERE `id` = '".$lenta['id']."'");
echo '</div>';
$i++;
}
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-down" style="float: right; text-decoration: none;" href="page-up"><img src = "ico/page_up.png"></a>';
}
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?act=foto&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?act=foto&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
echo '</div>';
navigation($page, $total,'lenta.php?act=blog&sort='.$sort.'&');
}else{
echo '<div class="div"> <img src="ico/error.gif" alt="Ошибка" /> Нет новых событий!</div>';
}
echo '</div>';
include 'foot.php';
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Все~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
default:
$title = $title.' | События';
include 'head.php';
echo '<div class="title"><img src= "ico/lenta.png"> События </div>';
echo '<div class="nav">';
echo 'Сортировать</br>';
echo '<b>Все</b> | <a href = "lenta.php?act=microblog">Статусы</a> | <a href = "lenta.php?act=foto">Фото</a>';
echo '</div>';
if($u['setting_jurnal_list']) $count = $u['setting_jurnal_list']; else $count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta` "), 0);
if($all > 0){
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $count - $count;
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-up" style="float: right; text-decoration: none;" href="page-down"><img src = "ico/page_down.png"></a>';
}
$sort = $_GET['sort'];
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
$result = mysql_query("SELECT * FROM `lenta` ORDER BY `time` $sortq LIMIT $start, $count");
while($lenta = mysql_fetch_assoc($result)){
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$lenta["user"]."'"));
echo $i % 2 ? '<div class="div">' : '<div class="div">';
if($lenta['new'] == 1) echo '<span style="float: right; font-size: small; color: grey"><font color="red">New</font></span>';
echo ''.ico($user['sex'],$user['admin']).' <a href = "page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).' ';
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
echo ' <small>'.vremya($lenta['time']).'</small>';
echo '<br/> '.$lenta['text'].'';
echo '<br/>';
if($lenta['new'] == 1) echo '</div>';
if($lenta['new'] == 1) mysql_query("UPDATE `lenta` SET `new` = 0 WHERE `id` = '".$lenta['id']."'");
echo '</div>';
$i++;
}
echo '<div class="title">';
if ($page != $total) {
echo '<a name="page-down" style="float: right; text-decoration: none;" href="page-up"><img src = "ico/page_up.png"></a>';
}
if($sort == 'time') {
$sortq = 'ASC';
echo '<a href = "lenta.php?&sort=message&page='.$page.'">Новые</a> | <b>Поcледние</b>';
}
if($sort == 'message' || empty($sortq)) {
$sort = 'message';
$sortq = 'DESC';
echo '<b>Новые</b> | <a href = "lenta.php?&sort=time&page='.$page.'">Поcледние</a>';
}
echo '</div>';
echo '</div>';
navigation($page, $total,'lenta.php?&sort='.$sort.'&');
}else{
echo '<div class="div"> <img src="ico/error.gif" alt="Ошибка" /> Нет новых событий!</div>';
}
echo '</div>';
include 'foot.php';
break;
}
?>