Пример #1
0
function get_top($order = 'postforum')
{
    $req = mysql_query("SELECT * FROM `users` WHERE `{$order}` > 0 ORDER BY `{$order}` DESC LIMIT 9");
    if (mysql_num_rows($req)) {
        $out = '';
        while ($res = mysql_fetch_assoc($req)) {
            $out .= $i % 2 ? '<div class="list2">' : '<div class="list1">';
            $out .= functions::display_user($res, array('header' => '<b>' . $res[$order] . '</b>')) . '</div>';
            ++$i;
        }
        return $out;
    } else {
        return '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
    }
}
Пример #2
0
            $fls = @filesize('../files/forum/attach/' . $res['filename']);
            $fls = round($fls / 1024, 0);
            $att_ext = strtolower(functions::format('./files/forum/attach/' . $res['filename']));
            $pic_ext = array('gif', 'jpg', 'jpeg', 'png');
            if (in_array($att_ext, $pic_ext)) {
                // Если картинка, то выводим предпросмотр
                $file = '<div><a href="index.php?act=file&amp;id=' . $res['id'] . '">';
                $file .= '<img src="thumbinal.php?file=' . urlencode($res['filename']) . '" alt="' . $lng_forum['click_to_view'] . '" /></a></div>';
            } else {
                // Если обычный файл, выводим значок и ссылку
                $file = ($res['del'] ? '<img src="../images/del.png" width="16" height="16" />' : '') . '<img src="../images/system/' . $res['filetype'] . '.png" width="16" height="16" />&#160;';
            }
            $file .= '<a href="index.php?act=file&amp;id=' . $res['id'] . '">' . htmlspecialchars($res['filename']) . '</a><br />';
            $file .= '<small><span class="gray">' . $lng_forum['size'] . ': ' . $fls . ' kb.<br />' . $lng_forum['downloaded'] . ': ' . $res['dlcount'] . ' ' . $lng_forum['time'] . '</span></small>';
            $arg = array('iphide' => 1, 'sub' => $file, 'body' => $text);
            echo functions::display_user($res_u, $arg);
            echo '</div>';
        }
        echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
        if ($total > $kmess) {
            // Постраничная навигация
            echo '<p>' . functions::display_pagination('index.php?act=files&amp;' . (isset($_GET['new']) ? 'new' : 'do=' . $do) . $lnk . '&amp;', $start, $total, $kmess) . '</p>' . '<p><form action="index.php" method="get">' . '<input type="hidden" name="act" value="files"/>' . '<input type="hidden" name="do" value="' . $do . '"/>' . $input . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
        }
    } else {
        echo '<div class="list1">' . $lng['list_empty'] . '</div>';
    }
} else {
    /*
    -----------------------------------------------------------------
    Выводим список разделов, в которых есть файлы
    -----------------------------------------------------------------
Пример #3
0
 * @copyright   Copyright (C) 2008-2011 JohnCMS Community
 * @license     LICENSE.txt (see attached file)
 * @version     VERSION.txt (see attached file)
 * @author      http://johncms.com/about
 */
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
История активности
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng_profile['activity'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng_profile['activity'] . '</div>';
$menu = array(!$mod ? '<b>' . $lng['messages'] . '</b>' : '<a href="profile.php?act=activity&amp;user='******'id'] . '">' . $lng['messages'] . '</a>', $mod == 'topic' ? '<b>' . $lng['themes'] . '</b>' : '<a href="profile.php?act=activity&amp;mod=topic&amp;user='******'id'] . '">' . $lng['themes'] . '</a>', $mod == 'comments' ? '<b>' . $lng['comments'] . '</b>' : '<a href="profile.php?act=activity&amp;mod=comments&amp;user='******'id'] . '">' . $lng['comments'] . '</a>');
echo '<div class="topmenu">' . functions::display_menu($menu) . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
switch ($mod) {
    case 'comments':
        /*
        -----------------------------------------------------------------
        Список сообщений в Гостевой
        -----------------------------------------------------------------
        */
        $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `user_id` = '" . $user['id'] . "'" . ($rights >= 1 ? '' : " AND `adm` = '0'")), 0);
        echo '<div class="phdr"><b>' . $lng['comments'] . '</b></div>';
        if ($total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('profile.php?act=activity&amp;mod=comments&amp;user='******'id'] . '&amp;', $start, $total, $kmess) . '</div>';
        }
        $req = mysql_query("SELECT * FROM `guest` WHERE `user_id` = '" . $user['id'] . "'" . ($rights >= 1 ? '' : " AND `adm` = '0'") . " ORDER BY `id` DESC LIMIT {$start}, {$kmess}");
        if (mysql_num_rows($req)) {
            $i = 0;
Пример #4
0
         echo '<p><a href="index.php?act=say&amp;id=' . $id . '&amp;yes&amp;cyt">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $type1['refid'] . '">' . $lng_forum['not_agree'] . '</a></p>';
         require '../incfiles/end.php';
         exit;
     }
 }
 $msg_pre = functions::checkout($msg, 1, 1);
 if ($set_user['smileys']) {
     $msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0);
 }
 $msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre);
 echo '<div class="phdr"><b>' . $lng_forum['topic'] . ':</b> ' . $th1['text'] . '</div>';
 $qt = str_replace("<br/>", "\r\n", $qt);
 $qt = trim(preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '', $qt));
 $qt = functions::checkout($qt, 0, 2);
 if (!empty($_POST['msg']) && !isset($_POST['submit'])) {
     echo '<div class="list1">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
 }
 echo '<form name="form" action="index.php?act=say&amp;id=' . $id . '&amp;start=' . $start . (isset($_GET['cyt']) ? '&amp;cyt' : '') . '" method="post"><div class="gmenu">';
 if (isset($_GET['cyt'])) {
     // Форма с цитатой
     echo '<p><b>' . $type1['from'] . '</b> <span class="gray">(' . $vr . ')</span></p>' . '<p><h3>' . $lng_forum['cytate'] . '</h3>' . '<textarea rows="' . $set_user['field_h'] . '" name="citata">' . (empty($_POST['citata']) ? $qt : functions::checkout($_POST['citata'])) . '</textarea>' . '<br /><small>' . $lng_forum['cytate_help'] . '</small></p>';
 } else {
     // Форма с репликой
     echo '<p><h3>' . $lng_forum['reference'] . '</h3>' . '<input type="radio" value="0" ' . (!$txt ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>,<br />' . '<input type="radio" value="2" ' . ($txt == 2 ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_1'] . ',<br />' . '<input type="radio" value="3" ' . ($txt == 3 ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_2'] . ' (<a href="index.php?act=post&amp;id=' . $type1['id'] . '">' . $vr . '</a>) ' . $lng_forum['reply_3'] . ',<br />' . '<input type="radio" value="4" ' . ($txt == 4 ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_4'] . '</p>';
 }
 echo '<p><h3>' . $lng_forum['post'] . '</h3>';
 if (!$is_mobile) {
     echo '</p><p>' . bbcode::auto_bb('form', 'msg');
 }
 echo '<textarea rows="' . $set_user['field_h'] . '" name="msg">' . (empty($_POST['msg']) ? '' : functions::checkout($_POST['msg'])) . '</textarea></p>' . '<p><input type="checkbox" name="addfiles" value="1" ' . (isset($_POST['addfiles']) ? 'checked="checked" ' : '') . '/> ' . $lng_forum['add_file'];
 if ($set_user['translit']) {
Пример #5
0
 * @author      http://johncms.com/about
 */
defined('_IN_JOHNCMS') or die('Error: restricted access');
require '../incfiles/head.php';
$topic_vote = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_vote` WHERE `type` = '1' AND `topic` = '{$id}'"), 0);
if ($topic_vote == 0) {
    echo functions::display_error($lng['error_wrong_data']);
    require '../incfiles/end.php';
    exit;
} else {
    $topic_vote = mysql_fetch_array(mysql_query("SELECT `name`, `time`, `count` FROM `cms_forum_vote` WHERE `type` = '1' AND `topic` = '{$id}' LIMIT 1"));
    echo '<div  class="phdr">' . $lng_forum['voting_users'] . ' &laquo;<b>' . htmlentities($topic_vote['name'], ENT_QUOTES, 'UTF-8') . '</b>&raquo;</div>';
    $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_vote_users` WHERE `topic`='{$id}'"), 0);
    $req = mysql_query("SELECT `cms_forum_vote_users`.*, `users`.`rights`, `users`.`lastdate`, `users`.`name`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`id`\n    FROM `cms_forum_vote_users` LEFT JOIN `users` ON `cms_forum_vote_users`.`user` = `users`.`id`\n    WHERE `cms_forum_vote_users`.`topic`='{$id}' LIMIT {$start},{$kmess}");
    $i = 0;
    while ($res = mysql_fetch_array($req)) {
        echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        echo functions::display_user($res, array('iphide' => 1));
        echo '</div>';
        ++$i;
    }
    if ($total == 0) {
        echo '<div class="menu">' . $lng_forum['voting_users_empty'] . '</div>';
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
    if ($total > $kmess) {
        echo '<p>' . functions::display_pagination('index.php?act=users&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</p>' . '<p><form action="index.php?act=users&amp;id=' . $id . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
    }
    echo '<p><a href="index.php?id=' . $id . '">' . $lng_forum['to_topic'] . '</a></p>';
}
require '../incfiles/end.php';
Пример #6
0
     }
     echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
     if ($total > $kmess) {
         echo '<p>' . functions::display_pagination('profile.php?act=karma&amp;mod=new&amp;', $start, $total, $kmess) . '</p>' . '<p><form action="profile.php?act=karma&amp;mod=new" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
     }
     echo '<p><a href="profile.php">' . $lng['profile'] . '</a></p>';
     break;
 default:
     /*
     -----------------------------------------------------------------
     Главная страница Кармы, список отзывов
     -----------------------------------------------------------------
     */
     $type = isset($_GET['type']) ? abs(intval($_GET['type'])) : 0;
     $menu = array($type == 2 ? '<b>' . $lng_karma['all'] . '</b>' : '<a href="profile.php?act=karma&amp;user='******'id'] . '&amp;type=2">' . $lng_karma['all'] . '</a>', $type == 1 ? '<b>' . $lng_karma['positive'] . '</b>' : '<a href="profile.php?act=karma&amp;user='******'id'] . '&amp;type=1">' . $lng_karma['positive'] . '</a>', !$type ? '<b>' . $lng_karma['negative'] . '</b>' : '<a href="profile.php?act=karma&amp;user='******'id'] . '">' . $lng_karma['negative'] . '</a>');
     echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['karma'] . '</div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
     $karma = $user['karma_plus'] - $user['karma_minus'];
     if ($karma > 0) {
         $images = ($user['karma_minus'] ? ceil($user['karma_plus'] / $user['karma_minus']) : $user['karma_plus']) > 10 ? '2' : '1';
         echo '<div class="gmenu">';
     } else {
         if ($karma < 0) {
             $images = ($user['karma_plus'] ? ceil($user['karma_minus'] / $user['karma_plus']) : $user['karma_minus']) > 10 ? '-2' : '-1';
             echo '<div class="rmenu">';
         } else {
             $images = 0;
             echo '<div class="menu">';
         }
     }
     echo '<table  width="100%"><tr><td width="22" valign="top"><img src="' . $set['homeurl'] . '/images/k_' . $images . '.gif"/></td><td>' . '<b>' . $lng['karma'] . ' (' . $karma . ')</b>' . '<div class="sub">' . '<span class="green">' . $lng['vote_for'] . ' (' . $user['karma_plus'] . ')</span> | ' . '<span class="red">' . $lng['vote_against'] . ' (' . $user['karma_minus'] . ')</span>';
     echo '</div></td></tr></table></div>';
Пример #7
0
* @package     JohnCMS
* @link        http://johncms.com
* @copyright   Copyright (C) 2008-2011 JohnCMS Community
* @license     LICENSE.txt (see attached file)
* @version     VERSION.txt (see attached file)
* @author      http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$textl = $lng['users_list'];
$headmod = 'userlist';
require '../incfiles/head.php';
/*
-----------------------------------------------------------------
Выводим список пользователей
-----------------------------------------------------------------
*/
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
echo '<div class="phdr"><a href="index.php"><b>' . $lng['community'] . '</b></a> | ' . $lng['users_list'] . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=userlist&amp;', $start, $total, $kmess) . '</div>';
}
$req = mysql_query("SELECT `id`, `name`, `sex`, `lastdate`, `datereg`, `status`, `rights`, `ip`, `browser`, `rights` FROM `users` WHERE `preg` = 1 ORDER BY `datereg` DESC LIMIT {$start}, {$kmess}");
for ($i = 0; ($res = mysql_fetch_assoc($req)) !== false; $i++) {
    echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
    echo functions::display_user($res) . '</div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=userlist&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=userlist" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
echo '<p><a href="search.php">' . $lng['search_user'] . '</a><br />' . '<a href="index.php">' . $lng['back'] . '</a></p>';
Пример #8
0
        if (!isset($_GET['yes'])) {
            $lng_faq = core::load_lng('faq');
            echo '<p>' . $lng_faq['forum_rules_text'] . '</p>';
            echo '<p><a href="index.php?act=nt&amp;id=' . $id . '&amp;yes">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $id . '">' . $lng_forum['not_agree'] . '</a></p>';
            require '../incfiles/end.php';
            exit;
        }
    }
    $msg_pre = functions::checkout($msg, 1, 1);
    if ($set_user['smileys']) {
        $msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0);
    }
    $msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre);
    echo '<div class="phdr"><a href="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['new_topic'] . '</div>';
    if ($msg && $th && !isset($_POST['submit'])) {
        echo '<div class="list1"><img src="../theme/default/images/op.gif" border="0" alt="op" /> <span style="font-weight: bold">' . $th . '</span></div>' . '<div class="list2">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
    }
    echo '<form name="form" action="index.php?act=nt&amp;id=' . $id . '" method="post">' . '<div class="gmenu">' . '<p><h3>' . $lng['section'] . '</h3>' . '<a href="index.php?id=' . $res_c['id'] . '">' . $res_c['text'] . '</a> | <a href="index.php?id=' . $res_r['id'] . '">' . $res_r['text'] . '</a></p>' . '<p><h3>' . $lng_forum['new_topic_name'] . '</h3>';
    echo '<select name="tiento">
			<option value="0">No Prefix</option>
			<option value="1">Discuss</option>
			<option value="2">Share</option>
			<option value="3">Info</option>
			<option value="4">Tutorial</option>
			<option value="5">Help</option>
			<option value="6">Ask</option>
			<option value="7">Request</option>
			<option value="8">Movie</option>
			<option value="9">Ongoing</option>
			<option value="10">Completed</option>
		</select>
Пример #9
0
// Project site:          http://johncms.com                                  //
// Support site:          http://gazenwagen.com                               //
////////////////////////////////////////////////////////////////////////////////
// Lead Developer:        Oleg Kasyanov   (AlkatraZ)  alkatraz@gazenwagen.com //
// Development Team:      Eugene Ryabinin (john77)    john77@gazenwagen.com   //
//                        Dmitry Liseenko (FlySelf)   flyself@johncms.com     //
////////////////////////////////////////////////////////////////////////////////
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$textl = $lng['profile'] . ' | ' . $lng['guestbook'];
$headmod = 'my_guest';
if ($user_id && $user['id'] == $user_id) {
    $datauser['comm_old'] = $datauser['comm_count'];
}
require '../incfiles/head.php';
$context_top = '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['guestbook'] . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
/*
-----------------------------------------------------------------
Параметры Гостевой
-----------------------------------------------------------------
*/
$arg = array('comments_table' => 'cms_users_guestbook', 'object_table' => 'users', 'script' => 'profile.php?act=guestbook', 'sub_id_name' => 'user', 'sub_id' => $user['id'], 'owner' => $user['id'], 'owner_delete' => true, 'owner_reply' => true, 'title' => $lng['comments'], 'context_top' => $context_top);
/*
-----------------------------------------------------------------
Показываем комментарии
-----------------------------------------------------------------
*/
$comm = new comments($arg);
/*
-----------------------------------------------------------------
Обновляем счетчик непрочитанного
Пример #10
0
$req = mysql_query("SELECT * FROM `users` WHERE `rights` = '7' ORDER BY `name` ASC");
if (mysql_num_rows($req)) {
    echo '<div class="bmenu">' . $lng['administrators'] . '</div>';
    while (($res = mysql_fetch_assoc($req)) !== false) {
        echo $adm % 2 ? '<div class="list2">' : '<div class="list1">';
        echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>'));
        echo '</div>';
        ++$adm;
    }
}
$req = mysql_query("SELECT * FROM `users` WHERE `rights` = '6' ORDER BY `name` ASC");
if (mysql_num_rows($req)) {
    echo '<div class="bmenu">' . $lng['supermoders'] . '</div>';
    while (($res = mysql_fetch_assoc($req)) !== false) {
        echo $smd % 2 ? '<div class="list2">' : '<div class="list1">';
        echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>'));
        echo '</div>';
        ++$smd;
    }
}
$req = mysql_query("SELECT * FROM `users` WHERE `rights` BETWEEN '1' AND '5' ORDER BY `name` ASC");
if (mysql_num_rows($req)) {
    echo '<div class="bmenu">' . $lng['moders'] . '</div>';
    while (($res = mysql_fetch_assoc($req)) !== false) {
        echo $mod % 2 ? '<div class="list2">' : '<div class="list1">';
        echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>'));
        echo '</div>';
        ++$mod;
    }
}
echo '<div class="phdr">' . $lng['total'] . ': ' . ($sw + $adm + $smd + $mod) . '</div>' . '<p><a href="index.php?act=usr">' . $lng['users_list'] . '</a><br />' . '<a href="index.php">' . $lng['admin_panel'] . '</a></p>';
Пример #11
0
     if (mysql_num_rows($req)) {
         $i = 0;
         while ($res = mysql_fetch_assoc($req)) {
             $res['ip'] = ip2long($res['ip']);
             $posttime = ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>';
             $page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `refid` = '" . $res['refid'] . "' AND `id` " . ($set_forum['upfp'] ? ">=" : "<=") . " '" . $res['fid'] . "'"), 0) / $kmess);
             $text = mb_substr($res['text'], 0, 500);
             $text = functions::checkout($text, 1, 0);
             $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text);
             $theme = mysql_fetch_assoc(mysql_query("SELECT `id`, `text` FROM `forum` WHERE `id` = '" . $res['refid'] . "'"));
             $text = '<b>' . $theme['text'] . '</b> <a href="../forum/index.php?id=' . $theme['id'] . '&amp;page=' . $page . '">&gt;&gt;</a><br />' . $text;
             $subtext = '<span class="gray">' . $lng_forum['filter_to'] . ':</span> ';
             $subtext .= '<a href="index.php?act=forum&amp;mod=hposts&amp;tsort=' . $theme['id'] . '">' . $lng_forum['by_theme'] . '</a> | ';
             $subtext .= '<a href="index.php?act=forum&amp;mod=hposts&amp;usort=' . $res['user_id'] . '">' . $lng_forum['by_author'] . '</a>';
             echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
             echo functions::display_user($res, array('header' => $posttime, 'body' => $text, 'sub' => $subtext));
             echo '</div>';
             ++$i;
         }
         if ($rights == 9) {
             echo '<form action="index.php?act=forum&amp;mod=hposts' . $link . '" method="POST"><div class="rmenu"><input type="submit" name="delpost" value="' . $lng['delete_all'] . '" /></div></form>';
         }
     } else {
         echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
     }
     echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
     if ($total > $kmess) {
         echo '<div class="topmenu">' . functions::display_pagination('index.php?act=forum&amp;mod=hposts&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=forum&amp;mod=hposts" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
     }
 }
 break;
Пример #12
0
////////////////////////////////////////////////////////////////////////////////
// JohnCMS                Mobile Content Management System                    //
// Project site:          http://johncms.com                                  //
// Support site:          http://gazenwagen.com                               //
////////////////////////////////////////////////////////////////////////////////
// Lead Developer:        Oleg Kasyanov   (AlkatraZ)  alkatraz@gazenwagen.com //
// Development Team:      Eugene Ryabinin (john77)    john77@gazenwagen.com   //
//                        Dmitry Liseenko (FlySelf)   flyself@johncms.com     //
////////////////////////////////////////////////////////////////////////////////
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
Подробная информация, контактные данные
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng['information'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['information'] . '</div>';
if ($user['id'] == $user_id || $rights >= 7 && $rights > $user['rights']) {
    echo '<div class="topmenu"><a href="profile.php?act=edit&amp;user='******'id'] . '">' . $lng['edit'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>' . '<div class="list2"><p>' . '<h3><img src="../images/contacts.png" width="16" height="16" class="left" />&#160;' . $lng_profile['personal_data'] . '</h3>' . '<ul>';
if (file_exists('../files/users/photo/' . $user['id'] . '_small.jpg')) {
    echo '<a href="../files/users/photo/' . $user['id'] . '.jpg"><img src="../files/users/photo/' . $user['id'] . '_small.jpg" alt="' . $user['name'] . '" border="0" /></a>';
}
echo '<li><span class="gray">' . $lng_profile['name'] . ':</span> ' . (empty($user['imname']) ? '' : $user['imname']) . '</li>' . '<li><span class="gray">' . $lng_profile['birt'] . ':</span> ' . (empty($user['dayb']) ? '' : sprintf("%02d", $user['dayb']) . '.' . sprintf("%02d", $user['monthb']) . '.' . $user['yearofbirth']) . '</li>' . '<li><span class="gray">' . $lng_profile['city'] . ':</span> ' . (empty($user['live']) ? '' : $user['live']) . '</li>' . '<li><span class="gray">' . $lng_profile['about'] . ':</span> ' . (empty($user['about']) ? '' : '<br />' . functions::smileys(bbcode::tags($user['about']))) . '</li>' . '</ul></p><p>' . '<h3><img src="../images/mail.png" width="16" height="16" class="left" />&#160;' . $lng_profile['communication'] . '</h3><ul>' . '<li><span class="gray">' . $lng_profile['phone_number'] . ':</span> ' . (empty($user['mibile']) ? '' : $user['mibile']) . '</li>' . '<li><span class="gray">E-mail:</span> ';
if (!empty($user['mail']) && $user['mailvis'] || $rights >= 7 || $user['id'] == $user_id) {
    echo $user['mail'] . ($user['mailvis'] ? '' : '<span class="gray"> [' . $lng_profile['hidden'] . ']</span>');
}
echo '</li>' . '<li><span class="gray">ICQ:</span> ' . (empty($user['icq']) ? '' : $user['icq']) . '</li>' . '<li><span class="gray">Skype:</span> ' . (empty($user['skype']) ? '' : $user['skype']) . '</li>' . '<li><span class="gray">Jabber:</span> ' . (empty($user['jabber']) ? '' : $user['jabber']) . '</li>' . '<li><span class="gray">' . $lng_profile['site'] . ':</span> ' . (empty($user['www']) ? '' : bbcode::tags($user['www'])) . '</li>' . '</ul></p></div>' . '<div class="phdr"><a href="profile.php?user='******'id'] . '">' . $lng['back'] . '</a></div>';
Пример #13
0
 function __construct($arg = array())
 {
     global $mod, $start, $kmess;
     $this->comments_table = $arg['comments_table'];
     $this->object_table = !empty($arg['object_table']) ? $arg['object_table'] : false;
     if (!empty($arg['sub_id_name']) && !empty($arg['sub_id'])) {
         $this->sub_id = $arg['sub_id'];
         $this->url = $arg['script'] . '&amp;' . $arg['sub_id_name'] . '=' . $arg['sub_id'];
     } else {
         //TODO: Доработать на режим без sub_id
         $this->url = $arg['script'];
     }
     $this->item = isset($_GET['item']) ? abs(intval($_GET['item'])) : false;
     // Получаем данные пользователя
     if (core::$user_id) {
         $this->user_id = core::$user_id;
         $this->rights = core::$user_rights;
         $this->ban = core::$user_ban;
     }
     // Назначение пользовательских прав
     if (isset($arg['owner'])) {
         $this->owner = $arg['owner'];
         if (core::$user_id && $arg['owner'] == core::$user_id && !$this->ban) {
             $this->access_delete = isset($arg['owner_delete']) ? $arg['owner_delete'] : false;
             $this->access_reply = isset($arg['owner_reply']) ? $arg['owner_reply'] : false;
             $this->access_edit = isset($arg['owner_edit']) ? $arg['owner_edit'] : false;
         }
     }
     // Открываем доступ для Администрации
     if ($this->rights >= $this->access_level) {
         $this->access_reply = true;
         $this->access_edit = true;
         $this->access_delete = true;
     }
     switch ($mod) {
         case 'reply':
             /*
             -----------------------------------------------------------------
             Отвечаем на комментарий
             -----------------------------------------------------------------
             */
             if ($this->item && $this->access_reply && !$this->ban) {
                 echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['reply'] . '</div>';
                 $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1");
                 if (mysql_num_rows($req)) {
                     $res = mysql_fetch_assoc($req);
                     $attributes = unserialize($res['attributes']);
                     if (!empty($res['reply']) && $attributes['reply_rights'] > $this->rights) {
                         echo functions::display_error(core::$lng['error_reply_rights'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                     } elseif (isset($_POST['submit'])) {
                         $message = $this->msg_check();
                         if (empty($message['error'])) {
                             $attributes['reply_id'] = $this->user_id;
                             $attributes['reply_rights'] = $this->rights;
                             $attributes['reply_name'] = core::$user_data['name'];
                             $attributes['reply_time'] = time();
                             mysql_query("UPDATE `" . $this->comments_table . "` SET\n                                    `reply` = '" . mysql_real_escape_string($message['text']) . "',\n                                    `attributes` = '" . mysql_real_escape_string(serialize($attributes)) . "'\n                                    WHERE `id` = '" . $this->item . "'\n                                ");
                             header('Location: ' . str_replace('&amp;', '&', $this->url));
                         } else {
                             echo functions::display_error($message['error'], '<a href="' . $this->url . '&amp;mod=reply&amp;item=' . $this->item . '">' . core::$lng['back'] . '</a>');
                         }
                     } else {
                         $text = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user='******'user_id'] . '"><b>' . $attributes['author_name'] . '</b></a>' . ' (' . functions::display_date($res['time']) . ')<br />' . functions::checkout($res['text']);
                         $reply = functions::checkout($res['reply']);
                         echo $this->msg_form('&amp;mod=reply&amp;item=' . $this->item, $text, $reply) . '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>';
                     }
                 } else {
                     echo functions::display_error(core::$lng['error_wrong_data'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                 }
             }
             break;
         case 'edit':
             /*
             -----------------------------------------------------------------
             Редактируем комментарий
             -----------------------------------------------------------------
             */
             if ($this->item && $this->access_edit && !$this->ban) {
                 echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['edit'] . '</div>';
                 $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1");
                 if (mysql_num_rows($req)) {
                     $res = mysql_fetch_assoc($req);
                     $attributes = unserialize($res['attributes']);
                     $user = functions::get_user($res['user_id']);
                     if ($user['rights'] > core::$user_rights) {
                         echo functions::display_error(core::$lng['error_edit_rights'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                     } elseif (isset($_POST['submit'])) {
                         $message = $this->msg_check();
                         if (empty($message['error'])) {
                             $attributes['edit_id'] = $this->user_id;
                             $attributes['edit_name'] = core::$user_data['name'];
                             $attributes['edit_time'] = time();
                             if (isset($attributes['edit_count'])) {
                                 ++$attributes['edit_count'];
                             } else {
                                 $attributes['edit_count'] = 1;
                             }
                             mysql_query("UPDATE `" . $this->comments_table . "` SET\n                                    `text` = '" . mysql_real_escape_string($message['text']) . "',\n                                    `attributes` = '" . mysql_real_escape_string(serialize($attributes)) . "'\n                                    WHERE `id` = '" . $this->item . "'\n                                ");
                             header('Location: ' . str_replace('&amp;', '&', $this->url));
                         } else {
                             echo functions::display_error($message['error'], '<a href="' . $this->url . '&amp;mod=edit&amp;item=' . $this->item . '">' . core::$lng['back'] . '</a>');
                         }
                     } else {
                         $author = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user='******'user_id'] . '"><b>' . $attributes['author_name'] . '</b></a>';
                         $author .= ' (' . functions::display_date($res['time']) . ')<br />';
                         $text = functions::checkout($res['text']);
                         echo $this->msg_form('&amp;mod=edit&amp;item=' . $this->item, $author, $text);
                     }
                 } else {
                     echo functions::display_error(core::$lng['error_wrong_data'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                 }
                 echo '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>';
             }
             break;
         case 'del':
             /*
             -----------------------------------------------------------------
             Удаляем комментарий
             -----------------------------------------------------------------
             */
             if ($this->item && $this->access_delete && !$this->ban) {
                 if (isset($_GET['yes'])) {
                     //TODO: Продумать проверку на удаление постов администрации
                     $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1");
                     if (mysql_num_rows($req)) {
                         $res = mysql_fetch_assoc($req);
                         if (isset($_GET['all'])) {
                             // Удаляем все комментарии выбранного пользователя
                             $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `" . $this->comments_table . "` WHERE `sub_id` = '" . $this->sub_id . "' AND `user_id` = '" . $res['user_id'] . "'"), 0);
                             mysql_query("DELETE FROM `" . $this->comments_table . "` WHERE `sub_id` = '" . $this->sub_id . "' AND `user_id` = '" . $res['user_id'] . "'");
                         } else {
                             // Удаляем отдельный комментарий
                             $count = 1;
                             mysql_query("DELETE FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "'");
                         }
                         // Вычитаем баллы из статистики пользователя
                         $req_u = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $res['user_id'] . "'");
                         if (mysql_num_rows($req_u)) {
                             $res_u = mysql_fetch_assoc($req_u);
                             $count = $res_u['komm'] > $count ? $res_u['komm'] - $count : 0;
                             mysql_query("UPDATE `users` SET `komm` = '{$count}' WHERE `id` = '" . $res['user_id'] . "'");
                         }
                         // Обновляем счетчик комментариев
                         $this->msg_total(1);
                     }
                     header('Location: ' . str_replace('&amp;', '&', $this->url));
                 } else {
                     echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['delete'] . '</div>' . '<div class="rmenu"><p>' . core::$lng['delete_confirmation'] . '<br />' . '<a href="' . $this->url . '&amp;mod=del&amp;item=' . $this->item . '&amp;yes">' . core::$lng['delete'] . '</a> | ' . '<a href="' . $this->url . '">' . core::$lng['cancel'] . '</a><br />' . '<div class="sub">' . core::$lng['clear_user_msg'] . '<br />' . '<span class="red"><a href="' . $this->url . '&amp;mod=del&amp;item=' . $this->item . '&amp;yes&amp;all">' . core::$lng['clear'] . '</a></span>' . '</div></p></div>' . '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>';
                 }
             }
             break;
         default:
             if (!empty($arg['context_top'])) {
                 echo $arg['context_top'];
             }
             /*
             -----------------------------------------------------------------
             Добавляем новый комментарий
             -----------------------------------------------------------------
             */
             if (!$this->ban && !functions::is_ignor($this->owner) && isset($_POST['submit']) && ($message = $this->msg_check(1)) !== false) {
                 if (empty($message['error'])) {
                     // Записываем комментарий в базу
                     $this->add_comment($message['text']);
                     $this->total = $this->msg_total(1);
                     $_SESSION['code'] = $message['code'];
                 } else {
                     // Показываем ошибки, если есть
                     echo functions::display_error($message['error']);
                     $this->total = $this->msg_total();
                 }
             } else {
                 $this->total = $this->msg_total();
             }
             /*
             -----------------------------------------------------------------
             Показываем форму ввода
             -----------------------------------------------------------------
             */
             if (!$this->ban && !functions::is_ignor($this->owner)) {
                 echo $this->msg_form();
             }
             /*
             -----------------------------------------------------------------
             Показываем список комментариев
             -----------------------------------------------------------------
             */
             echo '<div class="phdr"><b>' . $arg['title'] . '</b></div>';
             if ($this->total > $kmess) {
                 echo '<div class="topmenu">' . functions::display_pagination($this->url . '&amp;', $start, $this->total, $kmess) . '</div>';
             }
             if ($this->total) {
                 $req = mysql_query("SELECT `" . $this->comments_table . "`.*, `" . $this->comments_table . "`.`id` AS `subid`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`id`\n                    FROM `" . $this->comments_table . "` LEFT JOIN `users` ON `" . $this->comments_table . "`.`user_id` = `users`.`id`\n                    WHERE `sub_id` = '" . $this->sub_id . "' ORDER BY `subid` DESC LIMIT {$start}, {$kmess}");
                 $i = 0;
                 while (($res = mysql_fetch_assoc($req)) !== false) {
                     $attributes = unserialize($res['attributes']);
                     $res['name'] = $attributes['author_name'];
                     $res['ip'] = $attributes['author_ip'];
                     $res['ip_via_proxy'] = isset($attributes['author_ip_via_proxy']) ? $attributes['author_ip_via_proxy'] : 0;
                     $res['browser'] = $attributes['author_browser'];
                     echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
                     $menu = array($this->access_reply ? '<a href="' . $this->url . '&amp;mod=reply&amp;item=' . $res['subid'] . '">' . core::$lng['reply'] . '</a>' : '', $this->access_edit ? '<a href="' . $this->url . '&amp;mod=edit&amp;item=' . $res['subid'] . '">' . core::$lng['edit'] . '</a>' : '', $this->access_delete ? '<a href="' . $this->url . '&amp;mod=del&amp;item=' . $res['subid'] . '">' . core::$lng['delete'] . '</a>' : '');
                     $text = functions::checkout($res['text'], 1, 1);
                     if (core::$user_set['smileys']) {
                         $text = functions::smileys($text, $res['rights'] >= 1 ? 1 : 0);
                     }
                     if (isset($attributes['edit_count'])) {
                         $text .= '<br /><span class="gray"><small>' . core::$lng['edited'] . ': <b>' . $attributes['edit_name'] . '</b>' . ' (' . functions::display_date($attributes['edit_time']) . ') <b>' . '[' . $attributes['edit_count'] . ']</b></small></span>';
                     }
                     if (!empty($res['reply'])) {
                         $reply = functions::checkout($res['reply'], 1, 1);
                         if (core::$user_set['smileys']) {
                             $reply = functions::smileys($reply, $attributes['reply_rights'] >= 1 ? 1 : 0);
                         }
                         $text .= '<div class="' . ($attributes['reply_rights'] ? '' : 'g') . 'reply"><small>' . '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user='******'reply_id'] . '"><b>' . $attributes['reply_name'] . '</b></a>' . ' (' . functions::display_date($attributes['reply_time']) . ')</small><br/>' . $reply . '</div>';
                     }
                     $user_arg = array('header' => ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>', 'body' => $text, 'sub' => functions::display_menu($menu), 'iphide' => core::$user_rights ? false : true);
                     echo functions::display_user($res, $user_arg);
                     echo '</div>';
                     ++$i;
                 }
             } else {
                 echo '<div class="menu"><p>' . core::$lng['list_empty'] . '</p></div>';
             }
             echo '<div class="phdr">' . core::$lng['total'] . ': ' . $this->total . '</div>';
             if ($this->total > $kmess) {
                 echo '<div class="topmenu">' . functions::display_pagination($this->url . '&amp;', $start, $this->total, $kmess) . '</div>' . '<p><form action="' . $this->url . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . core::$lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
             }
             if (!empty($arg['context_bottom'])) {
                 echo $arg['context_bottom'];
             }
     }
 }
Пример #14
0
 /*
 -----------------------------------------------------------------
 Выводим список пользователей, ожидающих подтверждения регистрации
 -----------------------------------------------------------------
 */
 $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `preg` = '0'"), 0);
 if ($total > $kmess) {
     echo '<div class="topmenu">' . functions::display_pagination('index.php?act=reg&amp;', $start, $total, $kmess) . '</div>';
 }
 if ($total) {
     $req = mysql_query("SELECT * FROM `users` WHERE `preg` = '0' ORDER BY `id` DESC LIMIT {$start},{$kmess}");
     $i = 0;
     while (($res = mysql_fetch_assoc($req)) !== false) {
         $link = array('<a href="index.php?act=reg&amp;mod=approve&amp;id=' . $res['id'] . '">' . $lng['approve'] . '</a>', '<a href="index.php?act=reg&amp;mod=del&amp;id=' . $res['id'] . '">' . $lng['delete'] . '</a>', '<a href="index.php?act=reg&amp;mod=delip&amp;ip=' . $res['ip'] . '">' . $lng['reg_del_ip'] . '</a>');
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>', 'sub' => functions::display_menu($link)));
         echo '</div>';
         ++$i;
     }
 } else {
     echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
 }
 echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
 if ($total > $kmess) {
     echo '<div class="topmenu">' . functions::display_pagination('index.php?act=reg&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=reg" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
 }
 echo '<p>';
 if ($total) {
     echo '<a href="index.php?act=reg&amp;mod=massapprove">' . $lng['reg_approve_all'] . '</a><br /><a href="index.php?act=reg&amp;mod=massdel">' . $lng['reg_del_all'] . '</a><br />';
 }
 echo '<a href="index.php">' . $lng['admin_panel'] . '</a></p>';
Пример #15
0
 * @package     JohnCMS
 * @link        http://johncms.com
 * @copyright   Copyright (C) 2008-2011 JohnCMS Community
 * @license     LICENSE.txt (see attached file)
 * @version     VERSION.txt (see attached file)
 * @author      http://johncms.com/about
 */
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
Статистика
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng['statistics'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['statistics'] . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>' . '<div class="list2">' . '<p><h3><img src="../images/rate.gif" width="16" height="16" class="left" />&#160;' . $lng['statistics'] . '</h3><ul>';
if ($rights >= 7) {
    if (!$user['preg'] && empty($user['regadm'])) {
        echo '<li>' . $lng_profile['awaiting_registration'] . '</li>';
    } elseif ($user['preg'] && !empty($user['regadm'])) {
        echo '<li>' . $lng_profile['registration_approved'] . ': ' . $user['regadm'] . '</li>';
    } else {
        echo '<li>' . $lng_profile['registration_free'] . '</li>';
    }
}
echo '<li><span class="gray">' . ($user['sex'] == 'm' ? $lng_profile['registered_m'] : $lng_profile['registered_w']) . ':</span> ' . date("d.m.Y", $user['datereg']) . '</li>' . '<li><span class="gray">' . ($user['sex'] == 'm' ? $lng_profile['stayed_m'] : $lng_profile['stayed_w']) . ':</span> ' . functions::timecount($user['total_on_site']) . '</li>';
$lastvisit = time() > $user['lastdate'] + 300 ? date("d.m.Y (H:i)", $user['lastdate']) : false;
if ($lastvisit) {
    echo '<li><span class="gray">' . $lng['last_visit'] . ':</span> ' . $lastvisit . '</li>';
}
echo '</ul></p><p>' . '<h3><img src="../images/activity.gif" width="16" height="16" class="left" />&#160;' . $lng_profile['activity'] . '</h3><ul>' . '<li><span class="gray">' . $lng['forum'] . ':</span> <a href="profile.php?act=activity&amp;user='******'id'] . '">' . $user['postforum'] . '</a></li>' . '<li><span class="gray">' . $lng['guestbook'] . ':</span> <a href="profile.php?act=activity&amp;mod=comments&amp;user='******'id'] . '">' . $user['postguest'] . '</a></li>' . '<li><span class="gray">' . $lng['comments'] . ':</span> ' . $user['komm'] . '</li>' . '</ul></p>' . '<p><h3><img src="../images/award.png" width="16" height="16" class="left" />&#160;' . $lng_profile['achievements'] . '</h3>';
Пример #16
0
 -----------------------------------------------------------------
 */
 echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng_ban['infringements_history'] . '</div>';
 // Меню
 $menu = array();
 if ($rights >= 6) {
     $menu[] = '<a href="../' . $set['admp'] . '/index.php?act=ban_panel">' . $lng_ban['ban_panel'] . '</a>';
 }
 if ($rights == 9) {
     $menu[] = '<a href="profile.php?act=ban&amp;mod=delhist&amp;user='******'id'] . '">' . $lng_ban['clear_history'] . '</a>';
 }
 if (!empty($menu)) {
     echo '<div class="topmenu">' . functions::display_menu($menu) . '</div>';
 }
 if ($user['id'] != $user_id) {
     echo '<div class="user"><p>' . functions::display_user($user) . '</p></div>';
 } else {
     echo '<div class="list2"><p>' . $lng_ban['my_infringements'] . '</p></div>';
 }
 $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_ban_users` WHERE `user_id` = '" . $user['id'] . "'"), 0);
 if ($total) {
     $req = mysql_query("SELECT * FROM `cms_ban_users` WHERE `user_id` = '" . $user['id'] . "' ORDER BY `ban_time` DESC LIMIT {$start}, {$kmess}");
     $i = 0;
     while ($res = mysql_fetch_assoc($req)) {
         $remain = $res['ban_time'] - time();
         $period = $res['ban_time'] - $res['ban_while'];
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         echo '<img src="../images/' . ($remain > 0 ? 'red' : 'green') . '.gif" width="16" height="16" align="left" />&#160;' . '<b>' . $lng_ban['ban_' . $res['ban_type']] . '</b>' . ' <span class="gray">(' . date("d.m.Y / H:i", $res['ban_while']) . ')</span>' . '<br />' . functions::checkout($res['ban_reason']) . '<div class="sub">';
         if ($rights > 0) {
             echo '<span class="gray">' . $lng_ban['ban_who'] . ':</span> ' . $res['ban_who'] . '<br />';
         }
Пример #17
0
-----------------------------------------------------------------
*/
if (!$rights && $user_id != $user['id']) {
    echo functions::display_error($lng['access_forbidden']);
    require '../incfiles/end.php';
    exit;
}
/*
-----------------------------------------------------------------
История IP адресов
-----------------------------------------------------------------
*/
echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['ip_history'] . '</div>';
echo '<div class="user"><p>';
$arg = array('lastvisit' => 1, 'header' => '<b>ID:' . $user['id'] . '</b>');
echo functions::display_user($user, $arg);
echo '</p></div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_users_iphistory` WHERE `user_id` = '" . $user['id'] . "'"), 0);
if ($total) {
    $req = mysql_query("SELECT * FROM `cms_users_iphistory` WHERE `user_id` = '" . $user['id'] . "' ORDER BY `time` DESC LIMIT {$start}, {$kmess}");
    $i = 0;
    while (($res = mysql_fetch_assoc($req)) !== false) {
        echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        $link = $rights ? '<a href="' . $set['homeurl'] . '/' . $set['admp'] . '/index.php?act=search_ip&amp;mod=history&amp;ip=' . long2ip($res['ip']) . '">' . long2ip($res['ip']) . '</a>' : long2ip($res['ip']);
        echo $link . ' <span class="gray">(' . date("d.m.Y / H:i", $res['time']) . ')</span></div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
Пример #18
0
 // Считаем комментарии к загрузкам
 $comm_dl = mysql_result(mysql_query("SELECT COUNT(*) FROM `download` WHERE `avtor` = '" . $user['name'] . "' AND `type` = 'komm'"), 0);
 // Считаем посты в личных гостевых
 $comm_gb = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_users_guestbook` WHERE `user_id` = '" . $user['id'] . "'"), 0);
 // Считаем комментарии в личных альбомах
 $comm_al = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_comments` WHERE `user_id` = '" . $user['id'] . "'"), 0);
 $comm_count = $comm_gal + $comm_lib + $comm_dl + $comm_gb + $comm_al;
 // Считаем посты в Гостевой
 $guest_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `user_id` = '" . $user['id'] . "'"), 0);
 // Считаем созданные темы на Форуме
 $forumt_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `user_id` = '" . $user['id'] . "' AND `type` = 't' AND `close` != '1'"), 0);
 // Считаем посты на Форуме
 $forump_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `user_id` = '" . $user['id'] . "' AND `type` = 'm'  AND `close` != '1'"), 0);
 echo '<div class="phdr"><a href="index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng['user_del'] . '</div>';
 // Выводим краткие данные
 echo '<div class="user"><p>' . functions::display_user($user, array('lastvisit' => 1, 'iphist' => 1)) . '</p></div>';
 switch ($mod) {
     case 'del':
         /*
         -----------------------------------------------------------------
         Удаляем личные данные
         -----------------------------------------------------------------
         */
         // Удаляем личную Гостевую
         mysql_query("DELETE FROM `cms_users_guestbook` WHERE `sub_id` = '" . $user['id'] . "'");
         // Удаляем личные Фотоальбомы
         $req = mysql_query("SELECT * FROM `cms_album_files` WHERE `user_id` = '" . $user['id'] . "'");
         if (mysql_num_rows($req)) {
             while ($res = mysql_fetch_assoc($req)) {
                 // Удаляем файлы картинок
                 @unlink('../files/users/album/' . $user['id'] . '/' . $res['img_name']);
Пример #19
0
    echo functions::display_error($lng['error_wrong_data']);
    require '../incfiles/end.php';
    exit;
}
$album = mysql_fetch_assoc($req);
$view = isset($_GET['view']);
/*
-----------------------------------------------------------------
Показываем выбранный альбом с фотографиями
-----------------------------------------------------------------
*/
echo '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | <a href="album.php?act=list&amp;user='******'id'] . '">' . $lng['personal_2'] . '</a></div>';
if ($user['id'] == $user_id || $rights >= 7) {
    echo '<div class="topmenu"><a href="album.php?act=image_upload&amp;al=' . $al . '&amp;user='******'id'] . '">' . $lng_profile['image_add'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user) . '</p></div>' . '<div class="phdr">' . $lng_profile['album'] . ': ' . ($view ? '<a href="album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . '"><b>' . functions::checkout($album['name']) . '</b></a>' : '<b>' . functions::checkout($album['name']) . '</b>');
if (!empty($album['description'])) {
    echo '<div class="sub">' . functions::checkout($album['description'], 1) . '</div>';
}
echo '</div>';
/*
-----------------------------------------------------------------
Проверяем права доступа к альбому
-----------------------------------------------------------------
*/
if ($album['access'] != 2) {
    unset($_SESSION['ap']);
}
if ($album['access'] == 1 && $user['id'] != $user_id && $rights < 6) {
    // Доступ закрыт
    echo functions::display_error($lng['access_forbidden'], '<a href="album.php?act=list&amp;user='******'id'] . '">' . $lng_profile['album_list'] . '</a>');
Пример #20
0
    */
    $search_db = functions::rus_lat(mb_strtolower($search));
    $search_db = strtr($search_db, array('_' => '\\_', '%' => '\\%'));
    $search_db = '%' . $search_db . '%';
    $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `name_lat` LIKE '" . mysql_real_escape_string($search_db) . "'"), 0);
    echo '<div class="phdr"><b>' . $lng['search_results'] . '</b></div>';
    if ($total > $kmess) {
        echo '<div class="topmenu">' . functions::display_pagination('search.php?search=' . urlencode($search) . '&amp;', $start, $total, $kmess) . '</div>';
    }
    if ($total > 0) {
        $req = mysql_query("SELECT * FROM `users` WHERE `name_lat` LIKE '" . mysql_real_escape_string($search_db) . "' ORDER BY `name` ASC LIMIT {$start}, {$kmess}");
        $i = 0;
        while ($res = mysql_fetch_assoc($req)) {
            echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
            $res['name'] = mb_strlen($search) < 2 ? $res['name'] : preg_replace('|(' . preg_quote($search, '/') . ')|siu', '<span style="background-color: #FFFF33">$1</span>', $res['name']);
            echo functions::display_user($res);
            echo '</div>';
            ++$i;
        }
    } else {
        echo '<div class="menu"><p>' . $lng['search_results_empty'] . '</p></div>';
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
    if ($total > $kmess) {
        echo '<div class="topmenu">' . functions::display_pagination('search.php?search=' . urlencode($search) . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="search.php?search=' . urlencode($search) . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
    }
} else {
    if ($error) {
        echo functions::display_error($error);
    }
    echo '<div class="phdr"><small>' . $lng['search_nick_help'] . '</small></div>';
Пример #21
0
                $text = functions::smileys($text, $res['rights'] ? 1 : 0);
            }
            $text = bbcode::notags($text);
            $text .= '...<a href="index.php?act=write&amp;id=' . $row['id'] . '">' . $lng['continue'] . ' &gt;&gt;</a>';
        } else {
            // Или, обрабатываем тэги и выводим весь текст
            $text = functions::checkout($last_msg['text'], 1, 1);
            if ($set_user['smileys']) {
                $text = functions::smileys($text, $res['rights'] ? 1 : 0);
            }
        }
        $arg = array('header' => '<span class="gray">(' . functions::display_date($last_msg['time']) . ')</span>', 'body' => '<div style="font-size: small">' . $text . '</div>', 'sub' => '<p><a href="index.php?act=write&amp;id=' . $row['id'] . '"><b>' . $lng_mail['correspondence'] . '</b></a> (' . $count_message . ') | <a href="index.php?act=ignor&amp;id=' . $row['id'] . '&amp;add">Игнор</a> | <a href="index.php?act=deluser&amp;id=' . $row['id'] . '">' . $lng['delete'] . '</a></p>', 'iphide' => 1);
        if (!$last_msg['read']) {
            echo '<div class="gmenu">';
        } else {
            echo $i % 2 ? '<div class="list1">' : '<div class="list2">';
        }
        echo functions::display_user($row, $arg);
        echo '</div>';
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=input&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="index.php" method="get">
                <input type="hidden" name="act" value="input"/>
                <input type="text" name="page" size="2"/>
                <input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
}
echo '<p><a href="../users/profile.php?act=office">' . $lng['personal'] . '</a></p>';
Пример #22
0
         }
         if ($row['read'] == 0 && $row['from_id'] == $user_id) {
             $mass_read[] = $row['mid'];
         }
         $post = $row['text'];
         $post = functions::checkout($post, 1, 1);
         if ($set_user['smileys']) {
             $post = functions::smileys($post, $row['rights'] >= 1 ? 1 : 0);
         }
         if ($row['file_name']) {
             $post .= '<div class="func">' . $lng_mail['file'] . ': <a href="index.php?act=load&amp;id=' . $row['mid'] . '">' . $row['file_name'] . '</a> (' . formatsize($row['size']) . ')(' . $row['count'] . ')</div>';
         }
         $subtext = '<a href="index.php?act=delete&amp;id=' . $row['mid'] . '">' . $lng['delete'] . '</a>';
         $arg = array('header' => '(' . functions::display_date($row['mtime']) . ')', 'body' => $post, 'sub' => $subtext, 'stshide' => 1);
         core::$user_set['avatar'] = 0;
         $out .= functions::display_user($row, $arg);
         $out .= '</div>';
         ++$i;
     }
     //Ставим метку о прочтении
     if ($mass_read) {
         $result = implode(',', $mass_read);
         mysql_query("UPDATE `cms_mail` SET `read`='1' WHERE `from_id`='{$user_id}' AND `id` IN (" . $result . ")");
     }
 } else {
     $out .= '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
 }
 $out .= '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
 if ($total > $kmess) {
     $out .= '<div class="topmenu">' . functions::display_pagination('index.php?act=write&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</div>';
     $out .= '<p><form action="index.php" method="get">