Пример #1
0
 -----------------------------------------------------------------
 Отображаем Гостевую, или Админ клуб
 -----------------------------------------------------------------
 */
 if (!$set['mod_guest']) {
     echo '<div class="alarm">' . $lng['guestbook_closed'] . '</div>';
 }
 echo '<div class="phdr"><b>' . $lng['guestbook'] . '</b></div>';
 if ($rights > 0) {
     $menu = array();
     $menu[] = isset($_SESSION['ga']) ? '<a href="index.php?act=ga">' . $lng['guestbook'] . '</a>' : '<b>' . $lng['guestbook'] . '</b>';
     $menu[] = isset($_SESSION['ga']) ? '<b>' . $lng['admin_club'] . '</b>' : '<a href="index.php?act=ga&amp;do=set">' . $lng['admin_club'] . '</a>';
     if ($rights >= 7) {
         $menu[] = '<a href="index.php?act=clean">' . $lng['clear'] . '</a>';
     }
     echo '<div class="topmenu">' . functions::display_menu($menu) . '</div>';
 }
 // Форма ввода нового сообщения
 if (($user_id || $set['mod_guest'] == 2) && !isset($ban['1']) && !isset($ban['13'])) {
     $token = mt_rand(1000, 100000);
     $_SESSION['token'] = $token;
     echo '<div class="gmenu"><form name="form" action="index.php?act=say" method="post">';
     if (!$user_id) {
         echo $lng['name'] . ' (max 25):<br/><input type="text" name="name" maxlength="25"/><br/>';
     }
     echo '<b>' . $lng['message'] . '</b> <small>(max 5000)</small>:<br/>';
     if (!$is_mobile) {
         echo bbcode::auto_bb('form', 'msg');
     }
     echo '<textarea rows="' . $set_user['field_h'] . '" name="msg"></textarea><br/>';
     if ($set_user['translit']) {
Пример #2
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;
Пример #3
0
                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 />';
                }
                echo '<span class="gray">' . $lng['term'] . ':</span> ' . ($period < 86400000 ? functions::timecount($period) : $lng_ban['ban_time_before_cancel']);
                if ($remain > 0) {
                    echo '<br /><span class="gray">' . $lng['remains'] . ':</span> ' . functions::timecount($remain);
                }
                // Меню отдельного бана
                $menu = array();
                if ($rights >= 7 && $remain > 0) {
                    $menu[] = '<a href="profile.php?act=ban&amp;mod=cancel&amp;user='******'id'] . '&amp;ban=' . $res['id'] . '">' . $lng_ban['ban_cancel_do'] . '</a>';
                }
                if ($rights == 9) {
                    $menu[] = '<a href="profile.php?act=ban&amp;mod=delete&amp;user='******'id'] . '&amp;ban=' . $res['id'] . '">' . $lng_ban['ban_delete_do'] . '</a>';
                }
                if (!empty($menu)) {
                    echo '<div>' . functions::display_menu($menu) . '</div>';
                }
                echo '</div></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 '<p>' . functions::display_pagination('profile.php?act=ban&amp;user='******'id'] . '&amp;', $start, $total, $kmess) . '</p>' . '<p><form action="profile.php?act=ban&amp;user='******'id'] . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
        }
}
Пример #4
0
    if ($new_mail) {
        $list[] = '<a href="' . $home . '/mail/index.php?act=new">' . $lng['mail'] . '</a> (+' . $new_mail . ')';
    }
    if ($datauser['comm_count'] > $datauser['comm_old']) {
        $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=guestbook&amp;user='******'">' . $lng['guestbook'] . '</a> (' . ($datauser['comm_count'] - $datauser['comm_old']) . ')';
    }
    $new_album_comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `user_id` = '" . core::$user_id . "' AND `unread_comments` = 1"), 0);
    if ($new_album_comm) {
        $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/album.php?act=top&amp;mod=my_new_comm">' . $lng['albums_comments'] . '</a>';
    }
    //menampilkan notifikasi forum
    if ($datauser['journal_forum']) {
        $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/journal.php"> Forum</a>&#160;(' . $datauser['journal_forum'] . ')';
    }
    if (!empty($list)) {
        echo '<div class="rmenu">' . $lng['unread'] . ': ' . functions::display_menu($list, ', ') . '</div>';
    }
}
/*
-----------------------------------------------------------------
Qchat
-----------------------------------------------------------------
*/
/*
if (($user_id) && !$ban['1'] && !$ban['12']){
$php_self=$_SERVER['PHP_SELF'];
*/
if ($user_id) {
    if ($headmod != "users" || $headmod == 'users' && $act) {
        if ($headmod != "guestbook" || $headmod == 'guestbook' && $act) {
            if ($headmod != "quickchat" || $headmod == 'quickchat' && $act) {
Пример #5
0
            exit;
        } else {
            if (!$_POST['delch']) {
                header('Location: index.php?act=languages&mod=phrases&language=' . $language . '&module=' . $name_module . '&symbol=' . $symbol . '&start=' . $start);
                exit;
            }
            foreach ($_POST['delch'] as $key) {
                $mass_dell[] = ini_file::key_filter($key);
            }
            $_SESSION['mass_dell'] = $mass_dell;
            echo '<div class="phdr"><b>' . $lng_list[$language] . '</b>: <a href="index.php?act=languages&amp;mod=phrases&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;symbol=' . $symbol . '"><b>' . $panel_lng['phrases'] . '</b></a> | ' . $panel_lng['reset'] . '</div>' . '<div class="rmenu"><p>' . $panel_lng['phrase_resets'] . '</p>' . '<p><form name="form" action="?act=languages&amp;mod=massdel_phrase&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;symbol=' . $symbol . '&amp;start=' . $start . '&amp;yes" method="POST">' . '<input type="submit" name="submit" value="' . $lng['continue'] . '"/>&#160;' . '</form></p>' . '</div>' . '<div class="phdr"><a href="?act=languages&amp;mod=phrases&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;start=' . $start . '"><b>' . $lng['back'] . '</b></a></div>' . '<p><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
        }
        break;
    default:
        /*
        -----------------------------------------------------------------
        Выводим список доступных языков
        -----------------------------------------------------------------
        */
        echo '<div class="phdr"><a href="index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng['language_default'] . '</div>';
        if ($do == 'error') {
            echo '<div class="rmenu"><b>' . $panel_lng['error'] . '!</b></div>';
        }
        echo '<div class="menu"><form action="index.php?act=languages&amp;mod=set" method="post"><p>';
        echo '<table><tr><td>&nbsp;</td><td style="padding-bottom:4px"><h3>' . $lng['language_system'] . '</h3></td></tr>';
        foreach ($lng_desc as $key => $val) {
            $lng_menu = array(!empty($val['author']) ? '<span class="gray">' . $lng['author'] . ':</span> ' . $val['author'] : '', !empty($val['author_email']) ? '<span class="gray">E-mail:</span> ' . $val['author_email'] : '', !empty($val['author_url']) ? '<span class="gray">URL:</span> ' . $val['author_url'] : '', !empty($val['description']) ? '<span class="gray">' . $lng['description'] . ':</span> ' . $val['description'] : '');
            echo '<tr>' . '<td valign="top"><input type="radio" value="' . $key . '" name="iso" ' . ($key == $set['lng'] ? 'checked="checked"' : '') . '/></td>' . '<td style="padding-bottom:6px">' . (file_exists('../images/flags/' . $key . '.gif') ? '<img src="../images/flags/' . $key . '.gif" alt=""/>&#160;' : '') . '<a href="index.php?act=languages&amp;mod=module&amp;language=' . $key . '"><b>' . $val['name'] . '</b></a>&#160;<span class="green">[' . $key . ']</span>' . '<div class="sub">' . functions::display_menu($lng_menu, '<br />') . '</div></td>' . '</tr>';
        }
        echo '<tr><td>&nbsp;</td><td><input type="submit" name="submit" value="' . $lng['save'] . '" /></td></tr>' . '</table></p>' . '</form></div>' . '<div class="phdr">' . $lng['total'] . ': <b>' . count($lng_desc) . '</b></div>' . '<p><a href="index.php?act=languages&amp;refresh">' . $lng['refresh_descriptions'] . '</a><br /><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
}
Пример #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
/*
-----------------------------------------------------------------
Список альбомов юзера
-----------------------------------------------------------------
*/
if (isset($_SESSION['ap'])) {
    unset($_SESSION['ap']);
}
echo '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . $lng['personal_2'] . '</div>';
$req = mysql_query("SELECT * FROM `cms_album_cat` WHERE `user_id` = '" . $user['id'] . "' " . ($user['id'] == $user_id || $rights >= 6 ? "" : "AND `access` > 1") . " ORDER BY `sort` ASC");
$total = mysql_num_rows($req);
if ($user['id'] == $user_id && $total < $max_album || $rights >= 7) {
    echo '<div class="topmenu"><a href="album.php?act=edit&amp;user='******'id'] . '">' . $lng_profile['album_create'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
if ($total) {
    $i = 0;
    while ($res = mysql_fetch_assoc($req)) {
        $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `album_id` = '" . $res['id'] . "'"), 0);
        echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') . '<img src="../images/album-' . $res['access'] . '.gif" width="16" height="16" class="left" />&#160;' . '<a href="album.php?act=show&amp;al=' . $res['id'] . '&amp;user='******'id'] . '"><b>' . functions::checkout($res['name']) . '</b></a>&#160;(' . $count . ')';
        if ($user['id'] == $user_id || $rights >= 6 || !empty($res['description'])) {
            $menu = array('<a href="album.php?act=sort&amp;mod=up&amp;al=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['up'] . '</a>', '<a href="album.php?act=sort&amp;mod=down&amp;al=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['down'] . '</a>', '<a href="album.php?act=edit&amp;al=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=delete&amp;al=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['delete'] . '</a>');
            echo '<div class="sub">' . (!empty($res['description']) ? '<div class="gray">' . functions::checkout($res['description'], 1, 1) . '</div>' : '') . ($user['id'] == $user_id || $rights >= 6 ? functions::display_menu($menu) : '') . '</div>';
        }
        echo '</div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
Пример #8
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'];
             }
     }
 }
Пример #9
0
         echo '<div class="gmenu">' . $lng['settings_saved'] . '</div>';
     }
     if (isset($_GET['reset']) || empty($set_forum)) {
         $set_forum = array();
         $set_forum['farea'] = 0;
         $set_forum['upfp'] = 0;
         $set_forum['preview'] = 1;
         $set_forum['postclip'] = 1;
         $set_forum['postcut'] = 2;
         mysql_query("UPDATE `users` SET `set_forum` = '" . mysql_real_escape_string(serialize($set_forum)) . "' WHERE `id` = '{$user_id}'");
         echo '<div class="rmenu">' . $lng['settings_default'] . '</div>';
     }
     echo '<form action="profile.php?act=settings&amp;mod=forum" method="post">' . '<div class="menu"><p><h3>' . $lng_set['main_settings'] . '</h3>' . '<input name="upfp" type="checkbox" value="1" ' . ($set_forum['upfp'] ? 'checked="checked"' : '') . ' />&#160;' . $lng_set['sorting_return'] . '<br/>' . '<input name="farea" type="checkbox" value="1" ' . ($set_forum['farea'] ? 'checked="checked"' : '') . ' />&#160;' . $lng_set['field_on'] . '<br/>' . '<input name="preview" type="checkbox" value="1" ' . ($set_forum['preview'] ? 'checked="checked"' : '') . ' />&#160;' . $lng['preview'] . '<br/>' . '</p><p><h3>' . $lng_set['clip_first_post'] . '</h3>' . '<input type="radio" value="2" name="postclip" ' . ($set_forum['postclip'] == 2 ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['always'] . '<br />' . '<input type="radio" value="1" name="postclip" ' . ($set_forum['postclip'] == 1 ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['in_not_read'] . '<br />' . '<input type="radio" value="0" name="postclip" ' . (!$set_forum['postclip'] ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['never'] . '</p><p><h3>' . $lng_set['scrap_of_posts'] . '</h3>' . '<input type="radio" value="1" name="postcut" ' . ($set_forum['postcut'] == 1 ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['500_symbols'] . '<br />' . '<input type="radio" value="2" name="postcut" ' . ($set_forum['postcut'] == 2 ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['1000_symbols'] . '<br />' . '<input type="radio" value="3" name="postcut" ' . ($set_forum['postcut'] == 3 ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['3000_symbols'] . '<br />' . '<input type="radio" value="0" name="postcut" ' . (!$set_forum['postcut'] ? 'checked="checked"' : '') . '/>&#160;' . $lng_set['not_to_cut_off'] . '<br />' . '</p><p><input type="submit" name="submit" value="' . $lng['save'] . '"/></p></div></form>' . '<div class="phdr"><a href="profile.php?act=settings&amp;mod=forum&amp;reset">' . $lng['reset_settings'] . '</a></div>' . '<p><a href="../forum/index.php">' . $lng['to_forum'] . '</a></p>';
     break;
 default:
     echo '<div class="phdr"><b>' . $lng['settings'] . '</b> | ' . $lng['common_settings'] . '</div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>';
     if (isset($_POST['submit'])) {
         /*
         -----------------------------------------------------------------
         Записываем новые настройки, заданные пользователем
         -----------------------------------------------------------------
         */
         $set_user['timeshift'] = isset($_POST['timeshift']) ? intval($_POST['timeshift']) : 0;
         $set_user['avatar'] = isset($_POST['avatar']);
         $set_user['smileys'] = isset($_POST['smileys']);
         $set_user['translit'] = isset($_POST['translit']);
         $set_user['digest'] = isset($_POST['digest']);
         $set_user['direct_url'] = isset($_POST['direct_url']);
         $set_user['field_h'] = isset($_POST['field_h']) ? abs(intval($_POST['field_h'])) : 3;
         $set_user['kmess'] = isset($_POST['kmess']) ? abs(intval($_POST['kmess'])) : 10;
         $set_user['quick_go'] = isset($_POST['quick_go']);
Пример #10
0
 echo '<div class="phdr"><a href="index.php"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['unread_last_10'] . '</div>';
 $req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' AND `close` != '1' ORDER BY `time` DESC LIMIT 10");
 if (mysql_num_rows($req)) {
     for ($i = 0; $res = mysql_fetch_assoc($req); ++$i) {
         $q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $res['refid'] . "' LIMIT 1");
         $razd = mysql_fetch_assoc($q3);
         $q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "' LIMIT 1");
         $frm = mysql_fetch_assoc($q4);
         $nikuser = mysql_query("SELECT `from`, `time` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "'ORDER BY `time` DESC");
         $colmes1 = mysql_num_rows($nikuser);
         $cpg = ceil($colmes1 / $kmess);
         $nam = mysql_fetch_assoc($nikuser);
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         // Значки
         $icons = array($res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/pt.gif" alt=""/>' : '', $res['realid'] ? '<img src="../theme/' . $set_user['skin'] . '/images/rate.gif" alt=""/>' : '', $res['edit'] ? '<img src="../theme/' . $set_user['skin'] . '/images/tz.gif" alt=""/>' : '');
         echo functions::display_menu($icons, '&#160;', '&#160;');
         echo '<a href="index.php?id=' . $res['id'] . '">' . $res['text'] . '</a>&#160;[' . $colmes1 . ']';
         if ($cpg > 1) {
             echo '&#160;<a href="index.php?id=' . $res['id'] . '&amp;clip&amp;page=' . $cpg . '">&gt;&gt;</a>';
         }
         echo '<br/><div class="sub"><a href="index.php?id=' . $razd['id'] . '">' . $frm['text'] . '&#160;/&#160;' . $razd['text'] . '</a><br />';
         echo $res['from'];
         if (!empty($nam['from'])) {
             echo '&#160;/&#160;' . $nam['from'];
         }
         echo ' <span class="gray">' . date("d.m.y / H:i", $nam['time']) . '</span>';
         echo '</div></div>';
     }
 } else {
     echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
 }
Пример #11
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>';
Пример #12
0
* @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_JOHNADM') or die('Error: restricted access');
$error = array();
$search_post = isset($_POST['search']) ? trim($_POST['search']) : false;
$search_get = isset($_GET['search']) ? rawurldecode(trim($_GET['search'])) : false;
$search = $search_post ? $search_post : $search_get;
if (isset($_GET['ip'])) {
    $search = trim($_GET['ip']);
}
$menu = array(!$mod ? '<b>' . $lng['ip_actual'] . '</b>' : '<a href="index.php?act=search_ip&amp;search=' . rawurlencode($search) . '">' . $lng['ip_actual'] . '</a>', $mod == 'history' ? '<b>' . $lng['ip_history'] . '</b>' : '<a href="index.php?act=search_ip&amp;mod=history&amp;search=' . rawurlencode($search) . '">' . $lng['ip_history'] . '</a>');
echo '<div class="phdr"><a href="index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng['ip_search'] . '</div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>' . '<form action="index.php?act=search_ip" method="post"><div class="gmenu"><p>' . '<input type="text" name="search" value="' . functions::checkout($search) . '" />' . '<input type="submit" value="' . $lng['search'] . '" name="submit" /><br />' . '</p></div></form>';
if ($search) {
    if (strstr($search, '-')) {
        /*
        -----------------------------------------------------------------
        Обрабатываем диапазон адресов
        -----------------------------------------------------------------
        */
        $array = explode('-', $search);
        $ip = trim($array[0]);
        if (!core::ip_valid($ip)) {
            $error[] = $lng['error_firstip'];
        } else {
            $ip1 = ip2long($ip);
        }
        $ip = trim($array[1]);
Пример #13
0
         echo '</td>';
         if ($user_id && $user_id != $res['user_id']) {
             echo '<td align="right" valign="top">';
             echo '<a href="index.php?act=say&amp;id=' . $res['id'] . '&amp;start=' . $start . '&amp;cyt"><div id="quote_post_1"><div class="quote_post_2">Quote</div></div></a>';
             echo '</td>';
         }
         echo '</table>';
         echo '</div>';
         if (($rights == 3 || $rights >= 6 || $curator) && $rights >= $res['rights'] || $res['user_id'] == $user_id && !$set_forum['upfp'] && $start + $i == $colmes && $res['time'] > time() - 600 || $res['user_id'] == $user_id && $set_forum['upfp'] && $start == 0 && $i == 1 && $res['time'] > time() - 600) {
             // Link untuk mengedit / menghapus posting
             $menu = array('<a href="index.php?act=editpost&amp;id=' . $res['id'] . '">' . $lng['edit'] . '</a>', $rights >= 7 && $res['close'] == 1 ? '<a href="index.php?act=editpost&amp;do=restore&amp;id=' . $res['id'] . '">' . $lng_forum['restore'] . '</a>' : '', $res['close'] == 1 ? '' : '<a href="index.php?act=editpost&amp;do=del&amp;id=' . $res['id'] . '">' . $lng['delete'] . '</a>');
             echo '<div class="sub">';
             if ($rights == 3 || $rights >= 6) {
                 echo '<input type="checkbox" name="delch[]" value="' . $res['id'] . '"/>&#160;';
             }
             echo functions::display_menu($menu);
             if ($res['close']) {
                 echo '<div class="red">' . $lng_forum['who_delete_post'] . ': <b>' . $res['close_who'] . '</b></div>';
             } elseif (!empty($res['close_who'])) {
                 echo '<div class="green">' . $lng_forum['who_restore_post'] . ': <b>' . $res['close_who'] . '</b></div>';
             }
             echo '</div>';
         }
         echo '</div>';
         ++$nomer;
         ++$i;
     }
 }
 if ($rights == 3 || $rights >= 6) {
     echo '<div class="rmenu"><input type="submit" value=" ' . $lng['delete'] . ' "/></div>';
     echo '</form>';
Пример #14
0
        if (core::$user_id) {
            $req = mysql_query("SELECT * FROM `cms_users_data` WHERE `user_id` = '" . core::$user_id . "' AND `key` = 'forum_search' LIMIT 1");
            if (mysql_num_rows($req)) {
                $res = mysql_fetch_assoc($req);
                $history = unserialize($res['val']);
                // Добавляем запрос в историю
                if ($to_history && !in_array($search, $history)) {
                    if (count($history) > 20) {
                        array_shift($history);
                    }
                    $history[] = $search;
                    mysql_query("UPDATE `cms_users_data` SET\n                        `val` = '" . mysql_real_escape_string(serialize($history)) . "'\n                        WHERE `user_id` = '" . core::$user_id . "' AND `key` = 'forum_search'\n                        LIMIT 1\n                    ");
                }
                sort($history);
                foreach ($history as $val) {
                    $history_list[] = '<a href="search.php?search=' . urlencode($val) . '">' . htmlspecialchars($val) . '</a>';
                }
                // Показываем историю запросов
                echo '<div class="topmenu">' . '<b>' . core::$lng['search_history'] . '</b> <span class="red"><a href="search.php?act=reset">[x]</a></span><br />' . functions::display_menu($history_list) . '</div>';
            } elseif ($to_history) {
                $history[] = $search;
                mysql_query("INSERT INTO `cms_users_data` SET\n                    `user_id` = '" . core::$user_id . "',\n                    `key` = 'forum_search',\n                    `val` = '" . mysql_real_escape_string(serialize($history)) . "'\n                ");
            }
        }
        // Постраничная навигация
        if (isset($total) && $total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('search.php?' . ($search_t ? 't=1&amp;' : '') . 'search=' . urlencode($search) . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="search.php?' . ($search_t ? 't=1&amp;' : '') . 'search=' . urlencode($search) . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
        }
        echo '<p>' . ($search ? '<a href="search.php">' . $lng['search_new'] . '</a><br />' : '') . '<a href="index.php">' . $lng['forum'] . '</a></p>';
}
require '../incfiles/end.php';
Пример #15
0
$headmod = 'online';
$textl = $lng['online'];
//$lng_online = core::load_lng('online');
require '../incfiles/head.php';
/*
-----------------------------------------------------------------
Menunjukan yang online
-----------------------------------------------------------------
*/
$menu[] = !$mod ? '<b>' . $lng['users'] . '</b>' : '<a href="index.php?act=online">' . $lng['users'] . '</a>';
$menu[] = $mod == 'history' ? '<b>' . $lng['history'] . '</b>' : '<a href="index.php?act=online&amp;mod=history">' . $lng['history'] . '</a> ';
if (core::$user_rights) {
    $menu[] = $mod == 'guest' ? '<b>' . $lng['guests'] . '</b>' : '<a href="index.php?act=online&amp;mod=guest">' . $lng['guests'] . '</a>';
    $menu[] = $mod == 'ip' ? '<b>' . $lng['ip_activity'] . '</b>' : '<a href="index.php?act=online&amp;mod=ip">' . $lng['ip_activity'] . '</a>';
}
echo '<div class="phdr"><b>' . $lng['who_on_site'] . '</b></div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>';
switch ($mod) {
    case 'ip':
        // Daftar IP yang aktif, dengan hits counter
        $ip_array = array_count_values(core::$ip_count);
        $total = count($ip_array);
        if ($start >= $total) {
            //Memperbaiki permintaan ke halaman tidak ada
            $start = max(0, $total - ($total % $kmess == 0 ? $kmess : $total % $kmess));
        }
        $end = $start + $kmess;
        if ($end > $total) {
            $end = $total;
        }
        arsort($ip_array);
        $i = 0;
Пример #16
0
 if (!empty($res['color'])) {
     $name = '<span style="color:#' . $res['color'] . '">' . $name . '</span>';
 }
 // Если было задано начертание шрифта, то применяем
 $font = $res['bold'] ? 'font-weight: bold;' : false;
 $font .= $res['italic'] ? ' font-style:italic;' : false;
 $font .= $res['underline'] ? ' text-decoration:underline;' : false;
 if ($font) {
     $name = '<span style="' . $font . '">' . $name . '</span>';
 }
 ////////////////////////////////////////////////////////////
 // Выводим рекламмную ссылку с атрибутами                 //
 ////////////////////////////////////////////////////////////
 echo '<p><img src="../images/' . ($res['to'] ? 'red' : 'green') . '.gif" width="16" height="16" class="left"/>&#160;' . '<a href="' . htmlspecialchars($res['link']) . '">' . htmlspecialchars($res['link']) . '</a>&nbsp;[' . $res['count'] . ']<br />' . $name . '</p>';
 $menu = array('<a href="index.php?act=ads&amp;mod=up&amp;id=' . $res['id'] . '">' . $lng['up'] . '</a>', '<a href="index.php?act=ads&amp;mod=down&amp;id=' . $res['id'] . '">' . $lng['down'] . '</a>', '<a href="index.php?act=ads&amp;mod=edit&amp;id=' . $res['id'] . '">' . $lng['edit'] . '</a>', '<a href="index.php?act=ads&amp;mod=del&amp;id=' . $res['id'] . '">' . $lng['delete'] . '</a>', '<a href="index.php?act=ads&amp;mod=show&amp;id=' . $res['id'] . '">' . ($res['to'] ? $lng['to_show'] : $lng['hide']) . '</a>');
 echo '<div class="sub">' . '<div>' . functions::display_menu($menu) . '</div>' . '<p><span class="gray">' . $lng['installation_date'] . ':</span> ' . functions::display_date($res['time']) . '<br />' . '<span class="gray">' . $lng['placing'] . ':</span>&nbsp;' . $array_placing[$res['layout']] . '<br />' . '<span class="gray">' . $lng['to_show'] . ':</span>&nbsp;' . $array_show[$res['view']];
 // Вычисляем условия договора на рекламу
 $agreement = array();
 $remains = array();
 if (!empty($res['count_link'])) {
     $agreement[] = $res['count_link'] . ' ' . $lng['transitions_n'];
     $remains_count = $res['count_link'] - $res['count'];
     if ($remains_count > 0) {
         $remains[] = $remains_count . ' ' . $lng['transitions_n'];
     }
 }
 if (!empty($res['day'])) {
     $agreement[] = functions::timecount($res['day'] * 86400);
     $remains_count = $res['day'] * 86400 - (time() - $res['time']);
     if ($remains_count > 0) {
         $remains[] = functions::timecount($remains_count);
Пример #17
0
                mysql_query("UPDATE `cms_album_files` SET `views` = '{$views}' WHERE `id` = '" . $res['id'] . "'");
            }
        } else {
            /*
            -----------------------------------------------------------------
            Предпросмотр изображения в списке
            -----------------------------------------------------------------
            */
            echo '<a href="album.php?act=show&amp;al=' . $al . '&amp;img=' . $res['id'] . '&amp;user='******'id'] . '&amp;view"><img src="../files/users/album/' . $user['id'] . '/' . $res['tmb_name'] . '" /></a>';
        }
        if (!empty($res['description'])) {
            echo '<div class="gray">' . functions::smileys(functions::checkout($res['description'], 1)) . '</div>';
        }
        echo '<div class="sub">';
        if ($user['id'] == $user_id || core::$user_rights >= 6) {
            echo functions::display_menu(array('<a href="album.php?act=image_edit&amp;img=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=image_move&amp;img=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['move'] . '</a>', '<a href="album.php?act=image_delete&amp;img=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['delete'] . '</a>'));
            if ($user['id'] == $user_id && $view) {
                echo ' | <a href="album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . '&amp;view&amp;img=' . $res['id'] . '&amp;profile">' . $lng_profile['photo_profile'] . '</a>';
            }
        }
        echo vote_photo($res) . '<div class="gray">' . $lng['count_views'] . ': ' . $res['views'] . ', ' . $lng['count_downloads'] . ': ' . $res['downloads'] . '</div>' . '<div class="gray">' . $lng['date'] . ': ' . functions::display_date($res['time']) . '</div>' . '<a href="album.php?act=comments&amp;img=' . $res['id'] . '">' . $lng['comments'] . '</a> (' . $res['comm_count'] . ')<br />' . '<a href="album.php?act=image_download&amp;img=' . $res['id'] . '">' . $lng['download'] . '</a>' . '</div></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('album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . '&amp;' . ($view ? 'view&amp;' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . ($view ? '&amp;view' : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
echo '<p><a href="album.php?act=list&amp;user='******'id'] . '">' . $lng_profile['album_list'] . '</a></p>';
Пример #18
0
-----------------------------------------------------------------
Список посетителей. у которых есть фотографии
-----------------------------------------------------------------
*/
switch ($mod) {
    case 'boys':
        $sql = "WHERE `users`.`sex` = 'm'";
        break;
    case 'girls':
        $sql = "WHERE `users`.`sex` = 'zh'";
        break;
    default:
        $sql = "WHERE `users`.`sex` != ''";
}
$menu = array(!$mod ? '<b>' . $lng['all'] . '</b>' : '<a href="album.php?act=users">' . $lng['all'] . '</a>', $mod == 'boys' ? '<b>' . $lng['mans'] . '</b>' : '<a href="album.php?act=users&amp;mod=boys">' . $lng['mans'] . '</a>', $mod == 'girls' ? '<b>' . $lng['womans'] . '</b>' : '<a href="album.php?act=users&amp;mod=girls">' . $lng['womans'] . '</a>');
echo '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . $lng['list'] . '</div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>';
$total = mysql_result(mysql_query("SELECT COUNT(DISTINCT `user_id`)\n    FROM `cms_album_files`\n    LEFT JOIN `users` ON `cms_album_files`.`user_id` = `users`.`id` {$sql}\n"), 0);
if ($total) {
    $req = mysql_query("SELECT `cms_album_files`.*, COUNT(`cms_album_files`.`id`) AS `count`, `users`.`id` AS `uid`, `users`.`name` AS `nick`\n        FROM `cms_album_files`\n        LEFT JOIN `users` ON `cms_album_files`.`user_id` = `users`.`id` {$sql}\n        GROUP BY `cms_album_files`.`user_id` ORDER BY `users`.`name` ASC LIMIT {$start}, {$kmess}\n    ");
    $i = 0;
    while ($res = mysql_fetch_assoc($req)) {
        echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        echo '<a href="album.php?act=list&amp;user='******'uid'] . '">' . $res['nick'] . '</a> (' . $res['count'] . ')</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('album.php?act=users' . ($mod ? '&amp;mod=' . $mod : '') . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="album.php?act=users' . ($mod ? '&amp;mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';