Файл: public_html/pages/center_vnim.php
Строк: 240
<?
/*
Автор скрипта: TheSom
Сайт поддержки: http://lovmob.ru
Запрещено распространять скрипт в любом виде и под любым предлогом!
*/
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/start.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/compress.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/sess.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/home.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/settings.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/db_connect.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/ipua.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/fnc.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/user.php';
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/thead.php';
err(); // Вывод ошибок
title();
aut();
echo "<div class='foot'>n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='/info.php'>$user[nick]</a> | Управление Анкетой Дня <br />n";
echo "</div>n";
$arrs=mysql_fetch_array(mysql_query("SELECT * FROM `center_vnim` WHERE `id_user`='".$user['id']."'"));
if(isset($_GET['ok']))
{
header('Location: ?ok2');
}
if(isset($_GET['ok2']))
{
msg('Успешно');
}
if(isset($_GET['del']))
{
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `center_vnim` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$post=mysql_fetch_array(mysql_query("SELECT * FROM `center_vnim` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
mysql_query("DELETE FROM `center_vnim` WHERE `id` = '$post[id]'");
}
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL)
header("Location: ".$_SERVER['HTTP_REFERER']);
else
header("Location: center_vnim.php?".SID);
}
function wtime($timediff){
$oneMinute=60;
$oneHour=60*60;
$oneDay=60*60*24;
$dayfield=floor($timediff/$oneDay);
$hourfield=floor(($timediff-$dayfield*$oneDay)/$oneHour);
$minutefield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour)/$oneMinute);
$secondfield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour-$minutefield*$oneMinute));
$time_1="$hourfield ч. $minutefield м. $secondfield сек.";
return $time_1;
}
$action=htmlspecialchars(trim($_GET['action']));
switch ($action){
default:
$count=mysql_result(mysql_query("SELECT COUNT(*) FROM `center_vnim` WHERE `time` > '$time'"),0);
if (user_access('adm_panel_show')){
echo "<div class='nav2'>- <a href='?action=time'><b>Лидеры [Модерация]</b></a> ($count)</div>n";
}
echo "<div class='reklama'><b><br />У вас отключена <b>Анкета дня. Услуга Анкета дня позволяет показывать вашу анкету (по очереди с другими анкетами дня) на главной странице сайта. Продолжительность услуги 24 часа. Активируйте услугу и вас обязательно заметят!<br/>Стоимость 100 000 баллов</b><br .><br .><img src='/style/gmenu/bitcoin.png' alt='*'><a href='center_vnim.php?action=vip'<b/>Включить Анкету Дня</a> (100 000 баллов)</br></div>n";
break;
case 'vip':
if ($user['balls']>99999){
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']-100000)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("DELETE FROM `center_vnim` WHERE `id_user` = '$user[id]'");
mysql_query("INSERT INTO `center_vnim` (`id_user`, `time`) values('$user[id]', '".($time+86400)."')");
header('Location: ?ok');
}
else
{
echo "<div class='err'>У вас нету 100000 Баллов:!</div>n";
}
break;
echo'<div class="gend"> Последние Анкеты Дня : </div>';
case 'time':
if (user_access('adm_panel_show')){
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `center_vnim` WHERE `time` > '$time'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `center_vnim` WHERE `time` > '$time' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>n";
if ($k_post==0)
{
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Нет нарушенийn";
echo " </td>n";
echo " </tr>n";
}
while ($vip = mysql_fetch_assoc($q))
{
echo " <tr>n";
$ank=get_user($vip['id_user']);
echo " <td class='icon14'>n";
echo "".status($ank['id'])."";
echo " </td>n";
echo " <td class='p_t'>n";
echo "<a href='/info.php?id=$ank[id]'>$ank[nick]</a> n";
echo "".online($ank['id'])."";
echo " </td>n";
echo " </tr>n";
echo " <tr>n";
if ($set['set_show_icon'])echo " <td class='p_m' colspan='2'>n";
else
echo " <td class='p_m'>n";
if (user_access('guest_delete'))echo "<a href='?del&id=$vip[id]'>Удалить</a>n";
}
echo "</table>n";
if ($k_page>1)str("?action=time&",$k_page,$page); // Вывод страниц
}
break;
case 'onl':
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `center_vnim` WHERE `time` > '$time'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `center_vnim` WHERE `time` > '$time' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>n";
if ($k_post==0)
{
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Нет лидеровn";
echo " </td>n";
echo " </tr>n";
}
while ($vip = mysql_fetch_assoc($q))
{
echo " <tr>n";
$ank=get_user($vip['id_user']);
echo " <td class='icon14'>n";
echo "".status($ank['id'])."";
echo " </td>n";
echo " <td class='p_t'>n";
echo "<a href='/info.php?id=$ank[id]'><span style="color:$ank[ncolor]">$ank[nick]</span></a>n";
echo "".medal($ank['id'])." ".online($ank['id'])."";
echo " </td>n";
echo " </tr>n";
echo " <tr>n";
if ($set['set_show_icon'])echo " <td class='p_m' colspan='2'>n";
else
echo " <td class='p_m'>n";
echo "<span class="ank_d">";
if ($ank['pol']==1)
echo "(Муж)n";
else
echo "(Жен) n";
echo "</span>";
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
else
if (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo "<span class="ank_d">$ank[ank_age] лет</span>n";
}
$arr=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `city_id`='$ank[mycity]'"));
if ($arr['name']!=NULL)echo ", <span class="ank_d">$arr[name]</span>n";
echo "<br />";
}
echo "</table>n";
if ($k_page>1)str("?action=onl&",$k_page,$page); // Вывод страниц
break;
}
if (isset($user)){
echo "<div class='gend'> Последние Анкеты Дня :</div>";
echo "</div>n";
$num++;
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `center_vnim` WHERE `time` > '$time'"),0);
if ($k_post==0)
{
echo "<b>Нет Лидеров</b><br />n";
}
$q=mysql_query("SELECT * FROM `center_vnim` WHERE `time` > '$time' ORDER BY rand() LIMIT 10");
while ($vip = mysql_fetch_assoc($q))
{
$ank=get_user($vip['id_user']);
echo '<div class="' . ($num % 2 ? "reklama" : "reklama") . '">';
echo user::avatar($ank['id'], 0) . user::nick($ank['id'], 1, 1, 1) . otkuda($ank['url']) . ' <br/>';
echo 'Будет активна ещё : '.wtime($vip['time']-time()).'</div>';
}
}
echo "<div class='foot'>n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='/info.php'>$user[nick]</a> | Управление Анкетой Дня <br />n";
echo "</div>n";
require_once$_SERVER['DOCUMENT_ROOT'].'/sys/inc/tfoot.php';
?>