Файл: setk/activ.php
Строк: 231
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if ($ank['id']==0)
{
$ank=get_user($ank['id']);
include_once 'sys/inc/thead.php';
$set['title']=$ank['nick'].' - анкета '; // заголовок страницы
aut();
$timediff=mysql_result(mysql_query("SELECT `time` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);
$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));
$sDaysLeft=$dayfield;
$sDaysText = "дн.";
$nDaysLeftLength =strlen($sDaysLeft);
$d_1=substr($sDaysLeft,-1,1);
if (substr($sDaysLeft,-2,1) != 1 && $nDaysLeftLength>1)
{
if ($d_1 == 2 || $d_1== 3 || $d_1== 4)
{
$sDaysText = "дн.";
}
elseif ($d_1== 1)
{
$sDaysText = "дн.";
}
}
if ($nDaysLeftLength==1)
{
if ($d_1==2 || $d_1== 3 || $d_1== 4)
{
$sDaysText = "дн.";
}
elseif ($d_1== 1)
{
$sDaysText = "дн.";
}
}
$sHoursLeft=$hourfield;
$sHoursText = "ч.";
$nHoursLeftLength = strlen($sHoursLeft);
$h_1=substr($sHoursLeft,-1,1);
if (substr($sHoursLeft,-2,1) != 1 && $nHoursLeftLength>1)
{
if ($h_1== 2 || $h_1== 3 || $h_1== 4)
{
$sHoursText = "ч.";
}
elseif ($h_1== 1)
{
$sHoursText = "ч.";
}
}
if ($nHoursLeftLength==1)
{
if ($h_1== 2 || $h_1== 3 || $h_1== 4)
{
$sHoursText = "ч.";
}
elseif ($h_1== 1)
{
$sHoursText = "ч.";
}
}
$sMinsLeft =$minutefield;
$sMinsText = "мин.";
$nMinsLeftLength = strlen($sMinsLeft);
$m_1=substr($sMinsLeft,-1,1);
if ($nMinsLeftLength>1 && substr($sMinsLeft,-2,1) != 1)
{
if ($m_1== 2 || $m_1== 3 || $m_1== 4)
{
$sMinsText = "мин.";
}
else if ($m_1== 1)
{
$sMinsText = "мин.";
}
}
if ($nMinsLeftLength==1)
{
if ($m_1== 2 || $m_1==3 || $m_1== 4)
{
$sMinsText = "мин.";
}
elseif ($m_1== "1")
{
$sMinsText = "мин.";
}
}
$sSecsLeft = $secondfield;
$sSecsText = "сек.";
$s_1=substr($sSecsLeft,-1,1);
$nSecsLeftLength = strlen($sSecsLeft);
if (substr($sSecsLeft,-2,1)!= 1 && $nSecsLeftLength>1)
{
if ($s_1== 2 || $s_1== 3 || $s_1== 4)
{
$sSecsText = "сек.";
}
elseif ($s_1== 1)
{
$sSecsText = "сек.";
}
}
if ($nSecsLeftLength==1)
{
if ($s_1== 2 || $s_1== 3 || $s_1== 4)
{
$sSecsText = "сек.";
}
elseif ($sSecsLeft== "1")
{
$sSecsText = "сек.";
}
}
$displaystring="".
$sDaysLeft." ".
$sDaysText." ".
$sHoursLeft." ".
$sHoursText." ".
$sMinsLeft." ".
$sMinsText." ".
$sSecsLeft." ".
$sSecsText;
if ($timediff<0) $displaystring='дата уже наступила';
if (isset($user) && $user['id']!=$ank['id'])
{mysql_query("UPDATE `user` SET `prosm` = '".($ank['prosm']+1)."' WHERE `id` = '$ank[id]' LIMIT 1");}
echo "<span class="status">$ank[group_name]</span><br />n";
if ($ank['ank_o_sebe']!=NULL)echo "<span class="ank_n">О себе:</span> <span class="ank_d">$ank[ank_o_sebe]</span><br />n";
if(isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && otkuda($_SESSION['refer']))
echo "<div class='foot'>«<a href='$_SESSION[refer]'>".otkuda($_SESSION['refer'])."</a><br />n</div>n";
include_once 'sys/inc/tfoot.php';
exit;
}
$ank=get_user($ank['id']);
if(!$ank){header("Location: /index.php?".SID);exit;}
$ank['rating']=intval(@mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
$set['title']=$ank['nick'].' '; // заголовок страницы
include_once 'sys/inc/thead.php';
title() ;
err();
echo "<div class='act'>";
echo "<a class='act_noactive' href='/info.php?id=".$ank['id']."'>Профиль</a>";
echo'<a class="act_active">Активность</a>';
echo"</div>";
echo "<div class='hide'>";
echo group($ank['id']) . " $ank[nick] ";
echo medal($ank['id']) . " " . online($ank['id']) . " ";
echo'</div>';
$k_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$ank[id]'"),0);
{
{
}
}
echo "<div class='block'>Тем в форуме: $k_them</div>n";
$k_p_forum=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$ank[id]'"),0);
{
{
}
}
echo "<div class='block'>Сообщений в форуме: $k_p_forum</div>n";
$mass[0]=$ank['id'];
$collisions=user_collision($mass,1);
$chat_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_post` WHERE `id_user` = '$ank[id]'"),0);
if (count($collisions)>1 && isset($_GET['all']))
{
$chat_post_coll=0;
for ($i=1;$i<count($collisions);$i++)
{
$chat_post_coll+=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_post` WHERE `id_user` = '$collisions[$i]'"),0);
}
if ($chat_post_coll!=0)
$chat_post="$chat_post +$chat_post_coll*";
}
echo "<div class='block'>Сообщений в чате: $chat_post</div>n";
$komm_loads=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_komm` WHERE `id_user` = '$ank[id]'"),0);
if (count($collisions)>1 && isset($_GET['all']))
{
$komm_loads_coll=0;
for ($i=1;$i<count($collisions);$i++)
{
$komm_loads_coll+=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_komm` WHERE `id_user` = '$collisions[$i]'"),0);
}
if ($komm_loads_coll!=0)
$komm_loads="$komm_loads +$komm_loads_coll*";
}
echo "<div class='block'>Сообщений в зоне обмена: $komm_loads</div>n";
$obmennik=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$ank[id]'"),0);
if (count($collisions)>1 && isset($_GET['all']))
{
$obmennik_coll=0;
for ($i=1;$i<count($collisions);$i++)
{
$obmennik_coll+=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$collisions[$i]'"),0);
}
if ($obmennik_coll!=0)
$obmennik="$obmennik +$obmennik_coll*";
}
echo "<div class='block'>Файлы в зоне обмена $obmennik</div>n";
$news_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$ank[id]'"),0);
if (count($collisions)>1 && isset($_GET['all']))
{
$news_komm_coll=0;
for ($i=1;$i<count($collisions);$i++)
{
$news_komm_coll+=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$collisions[$i]'"),0);
}
if ($news_komm_coll!=0)
$news_komm="$news_komm +$news_komm_coll*";
}
echo "<div class='block'>Сообщений в новостях: $news_komm</div>n";
include_once 'sys/inc/tfoot.php';
?>