File size: 2.98Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Форум
=============================================
Official website: http://shcms.ru
=============================================
Данный код защищен авторскими правами
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/system_core.php';
$shcmsengine['title'] = Lang::get('Форум - Моя статистика');
include_once'../template/head.php';
if(!$user_id)
{
engine::errors(Lang::get("Статистика доступна только для пользователей"));
include_once'../template/foot.php';
exit;
}
switch($act):
case '':
$them = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_them` WHERE `user_id` = '$user_id'"),0);
$message = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_user` = '$user_id'"),0);
echo '<div class="posts">'.Lang::get('Мои темы в форуме').' <strong>'.$them.'</strong>:  <small><a href="?act=them">'.Lang::get('Просмотр').'</a></small></div>';
echo '<div class="posts">'.Lang::get('Мои посты в форуме').' <strong>'.$message.'</strong>:  <small><a href="?act=message">'.Lang::get('Просмотр').'</a></small></div>';
break;
case'them':
$thems = mysql_query("SELECT * FROM `forum_them` WHERE `user_id` = '$user_id'");
if(mysql_num_rows($thems) == 0)
{
engine::errors(Lang::get("У вас нет тем на форуме"));
include_once'../template/foot.php';
exit;
}
while($them = mysql_fetch_array($thems))
{
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_them` = '$them[id]'"),0);
echo '<div class="posts"><img src="icon/icon_them/them.gif"> <a href="message.php?id='.$them['id'].'">'.$them['name'].'</a><span class="mainforum">'.$count.'</span></div>';
}
break;
case'message':
$mess = mysql_query("SELECT DISTINCT (`id_them`) FROM `forum_mess` WHERE `id_user` = '$user_id'");
if(mysql_num_rows($mess) == 0)
{
engine::errors(Lang::get("У вас нет постов на форуме"));
include_once'../template/foot.php';
exit;
}
while($messag = mysql_fetch_array($mess))
{
$thems = mysql_fetch_array(mysql_query("SELECT * FROM `forum_them` WHERE `id` = '$messag[id_them]'"));
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_them` = '$thems[id]' AND`id_user` = '$user_id'"),0);
echo '<div class="posts"><img src="icon/icon_them/them.gif"> <a href="message.php?id='.$thems['id'].'">'.$thems['name'].'</a><span class="mainforum">'.$count.'</span></div>';
}
break;
endswitch;
if($act == false) {
echo '<a class="link_str" href="/forum">'.Lang::get('В форум').'</a>';
}else {
echo '<a class="link_str" href="/forum/stat.php">'.Lang::get('Назад').'</a>';
}
include_once'../template/foot.php';
?>