Файл: theme/selemet/sidebar.php
Строк: 86
<?php
echo '
<div id="slidingMenu">
<div id="slidingMenuContent">
';
defined('_IN_JOHNCMS') or die('Error: restricted access');
if ($user_id) {
$lng_profile = core::load_lng('profile');
$arg = array(
'lastvisit' => 0,
'iphist' => 0,
'iphide' => 0,
);
echo '<div class="user"><a href="/users/profile.php?user=' . $user_id . '">' . functions::display_user($datauser,$arg) . '</a></div>';
echo '<h3>' . $lng_profile['my_mail'] . '</h3>';
//Входящие сообщения
$count_input = mysql_result(mysql_query("
SELECT COUNT(*)
FROM `cms_mail`
LEFT JOIN `cms_contact`
ON `cms_mail`.`user_id`=`cms_contact`.`from_id`
AND `cms_contact`.`user_id`='$user_id'
WHERE `cms_mail`.`from_id`='$user_id'
AND `cms_mail`.`sys`='0' AND `cms_mail`.`delete`!='$user_id'
AND `cms_contact`.`ban`!='1' AND `spam`='0'"), 0);
echo '
<ul>
<li>
<a href="../mail/index.php?act=input">' . $lng_profile['received'] . ' <span class="count">' . $count_input . ($new_mail ? '/<span class="red">+' . $new_mail . '</span>' : '') . '</span></a></li>';
//Исходящие сообщения
$count_output = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` LEFT JOIN `cms_contact` ON `cms_mail`.`from_id`=`cms_contact`.`from_id` AND `cms_contact`.`user_id`='$user_id'
WHERE `cms_mail`.`user_id`='$user_id' AND `cms_mail`.`delete`!='$user_id' AND `cms_mail`.`sys`='0' AND `cms_contact`.`ban`!='1'"), 0);
//Исходящие непрочитанные сообщения
$count_output_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` LEFT JOIN `cms_contact` ON `cms_mail`.`from_id`=`cms_contact`.`from_id` AND `cms_contact`.`user_id`='$user_id'
WHERE `cms_mail`.`user_id`='$user_id' AND `cms_mail`.`delete`!='$user_id' AND `cms_mail`.`read`='0' AND `cms_mail`.`sys`='0' AND `cms_contact`.`ban`!='1'"), 0);
echo '<li><a href="../mail/index.php?act=output">' . $lng_profile['sent'] . ' <span class="count">' . $count_output . ($count_output_new ? '/<span class="red">+' . $count_output_new . '</span>' : '') . '</span></a></li>';
$count_systems = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail`
WHERE `from_id`='$user_id' AND `delete`!='$user_id' AND `sys`='1'"), 0);
//Системные сообщения
$count_systems_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail`
WHERE `from_id`='$user_id' AND `delete`!='$user_id' AND `sys`='1' AND `read`='0'"), 0);
echo '<li><a href="../mail/index.php?act=systems">' . $lng_profile['systems'] . ' <span class="count">' . $count_systems . ($count_systems_new ? '/<span class="red">+' . $count_systems_new . '</span>' : '') . '</span></a></li>';
//Файлы
$count_file = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail`
WHERE (`user_id`='$user_id' OR `from_id`='$user_id') AND `delete`!='$user_id' AND `file_name`!='';"), 0);
echo '<li><a href="../mail/index.php?act=files">' . $lng['files'] . ' <span class="count">' . $count_file . '</span></a></li>';
echo '
<div class="clear"></div>
</ul>
<ul> <li><a href="/users/profile.php?act=stat">' . $lng['statistics'] . '</a></li>';
echo '<li><a href="/users/profile.php?act=settings">' . $lng['system_settings'] . '</a></li>';
echo '<li><a href="' . $set['homeurl'] . '/exit.php">' . $lng['exit'] . '</a></li>';
echo '
<div class="clear"></div>
</ul>';
}
else {echo "это текст для гостей)00";}
echo'</div>
</div>';