Пример #1
0
                } else {
                    $sql = '';
                    $nav = '';
                }
                //Получаем список контактов
                $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact`\n\t\t\t        LEFT JOIN `users` ON `cms_contact`.`from_id`=`users`.`id`\n\t\t\t        WHERE `cms_contact`.`user_id`='" . $user_id . "'\n\t\t\t        AND `cms_contact`.`type`='2'\n\t\t\t        AND `cms_contact`.`friends`='1'\n\t\t\t        AND `cms_contact`.`ban`!='1'{$sql}\n\t\t\t    "), 0);
                if ($total) {
                    $req = mysql_query("SELECT `users`.* FROM `cms_contact`\n\t\t\t\t        LEFT JOIN `users` ON `cms_contact`.`from_id`=`users`.`id`\n\t\t\t\t        WHERE `cms_contact`.`user_id`='" . $user_id . "'\n\t\t\t\t        AND `cms_contact`.`type`='2'\n\t\t\t\t        AND `cms_contact`.`friends`='1'\n\t\t\t\t        AND `cms_contact`.`ban`!='1'{$sql}\n\t\t\t\t        ORDER BY `cms_contact`.`time` DESC\n\t\t\t\t        LIMIT " . $start . "," . $kmess);
                    for ($i = 0; ($row = mysql_fetch_assoc($req)) !== FALSE; ++$i) {
                        echo $i % 2 ? '<div class="list1">' : '<div class="list2">';
                        $subtext = '<a href="../mail/index.php?act=write&amp;id=' . $row['id'] . '">' . $lng['write'] . '</a> | <a href="profile.php?act=friends&amp;do=delete&amp;id=' . $row['id'] . '">' . $lng['delete'] . '</a> | <a href="../mail/index.php?act=ignor&amp;id=' . $row['id'] . '&amp;add">' . $lng_profile['add_ignor'] . '</a>';
                        $count_message = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` WHERE ((`user_id`='{$row['id']}' AND `from_id`='{$user_id}') OR (`user_id`='{$user_id}' AND `from_id`='{$row['id']}')) AND `sys`!='1' AND `spam`!='1' AND `delete`!='{$user_id}';"), 0);
                        $new_count_message = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` WHERE `cms_mail`.`user_id`='{$row['id']}' AND `cms_mail`.`from_id`='{$user_id}' AND `read`='0' AND `sys`!='1' AND `spam`!='1' AND `delete`!='{$user_id}';"), 0);
                        $arg = array('header' => '(' . $count_message . ($new_count_message ? '/<span class="red">+' . $new_count_message . '</span>' : '') . ')', 'sub' => $subtext);
                        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 '<p>' . functions::display_pagination('profile.php?act=friends' . $nav . '&amp;', $start, $total, $kmess) . '</p>' . '<p><form action="profile.php" method="get">' . '<input type="hidden" name="act" value="friends"/>' . ($nav ? '<input type="hidden" name="sort" value="' . $sort . '"/>' : '') . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
                }
                if ($set_mail['cat_friends']) {
                    echo '<div class="menu"><form action="profile.php?act=friends" method="post"><div>' . '<select name="sort">' . '<option value="0">Все</option>' . '<option value="1"' . ($sort == 1 ? ' selected="selected"' : '') . '>' . $lng_profile['friend'] . '</option>' . '<option value="2"' . ($sort == 2 ? ' selected="selected"' : '') . '>' . $lng_profile['classfriend'] . '</option>' . '<option value="3"' . ($sort == 3 ? ' selected="selected"' : '') . '>' . $lng_profile['colleague'] . '</option>' . '<option value="4"' . ($sort == 4 ? ' selected="selected"' : '') . '>' . $lng_profile['best_friend'] . '</option>' . '<option value="5"' . ($sort == 5 ? ' selected="selected"' : '') . '>' . $lng_profile['classmate'] . '</option>' . '<option value="6"' . ($sort == 6 ? ' selected="selected"' : '') . '>' . $lng_profile['relative'] . '</option>' . '</select>' . '<input type="submit" value="' . $lng_profile['sea_friends'] . ' &gt;&gt;"/></div></form></div>';
                }
        }
        echo '<p><a href="profile.php?act=office">' . $lng['personal'] . '</a></p>';
    }
}
Пример #2
0
                $tx = mb_substr(strip_tags($tx), 0, 90);
                $tx = "<br/>{$tx}...";
            } else {
                $tx = "<br/>{$tx}";
            }
        } else {
            $tx = "";
        }
        echo '<img src="' . $filesroot . '/img/' . $imt . '" alt=""/><a href="?act=view&amp;file=' . $newf['id'] . '">' . htmlentities($newf['name'], ENT_QUOTES, 'UTF-8') . '</a> (' . $fsz . ' кб)' . $tx . '<br/>';
        $nadir = $newf['refid'];
        $pat = "";
        while ($nadir != "") {
            $dnew = mysql_query("select * from `download` where type = 'cat' and id = '" . $nadir . "'");
            $dnew1 = mysql_fetch_array($dnew);
            $pat = "{$dnew1['text']}/{$pat}";
            $nadir = $dnew1['refid'];
        }
        $l = mb_strlen($pat);
        $pat1 = mb_substr($pat, 0, $l - 1);
        echo "[{$pat1}]</div>";
        ++$i;
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
    if ($total > 10) {
        echo '<p>' . functions::display_pagination('index.php?act=new&amp;', $start, $total, $kmess) . '</p>';
        echo '<p><form action="index.php" method="get"><input type="hidden" value="new" name="act" /><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
    }
} else {
    echo '<p>' . $lng['list_empty'] . '</p>';
}
echo "<p><a href='index.php?'>" . $lng['back'] . "</a></p>";
Пример #3
0
             $i = 1;
             while (($row = mysql_fetch_assoc($req)) !== false) {
                 echo $i % 2 ? '<div class="list1">' : '<div class="list2">';
                 if (file_exists('../files/blogs/ico_cat_' . $row['id'] . '.jpg') !== false) {
                     echo '<a href="index.php?act=animes&amp;mod=ico&amp;id=' . $row['id'] . '"><img style="margin: 0 0 -3px 0;border: 0px;" src="../files/blogs/ico_cat_' . $row['id'] . '.jpg" alt="" width="16" height="16"/></a>&#160;';
                 }
                 echo htmlentities($row['name'], ENT_QUOTES, 'UTF-8') . ' <a href="../blogs/index.php?id=' . $row['id'] . '">&raquo;</a>';
                 echo '<div class="sub">
      <a href="manage.php?act=up&amp;id=' . $row['id'] . '">Keatas</a> | <a href="manage.php?act=down&amp;id=' . $row['id'] . '">Kebawah</a> | <a href="manage.php?act=edit&amp;id=' . $row['id'] . '">Edit</a> | <a href="manage.php?act=delete&amp;id=' . $row['id'] . '">Hapus</a>
      </div>';
                 echo '</div>';
                 ++$i;
             }
             echo '<div class="phdr">Total Kategori: ' . $total . '</div>';
             if ($total > $kmess) {
                 echo '<p>' . functions::display_pagination('manage.php?', $start, $total, $kmess) . '</p>';
                 echo '<p><form action="index.php" method="get">
      <input type="hidden" name="act" value="mod_news"/>
      <input type="text" name="page" size="2"/>
      <input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
             }
         } else {
             echo '<div class="rmenu">Tidak ada kategori</div>';
         }
         echo '<div class="gmenu"><form action="manage.php?act=add" method="post"><input type="submit" value="Tambah kategori" /></form></div>';
         if ($total) {
             echo '<div class="gmenu"><form action="nulis.php" method="post"><input type="submit" value="Tambah Blogs" /></form></div>';
             echo '<div class="bmenu"><a href="manage.php?act=list">List Anime</a></div>';
             echo '<div class="bmenu"><a href="manage.php?act=clear">Hapus Blog</a></div>';
         }
 }
Пример #4
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>';
Пример #5
0
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=online&amp;' . ($mod ? 'mod=' . $mod . '&amp;' : ''), $start, $total, $kmess) . '</div>';
}
if ($total) {
    $req = mysql_query($sql_list . "{$start}, {$kmess}");
    $i = 0;
    while (($res = mysql_fetch_assoc($req)) !== false) {
        if ($res['id'] == core::$user_id) {
            echo '<div class="gmenu">';
        } else {
            echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        }
        $arg['stshide'] = 1;
        $arg['header'] = ' <span class="gray">(';
        if ($mod == 'history') {
            $arg['header'] .= functions::display_date($res['sestime']);
        } else {
            $arg['header'] .= $res['movings'] . ' - ' . functions::timecount(time() - $res['sestime']);
        }
        $arg['header'] .= ')</span><br /><img src="../images/info.png" width="16" height="16" align="middle" />&#160;' . functions::display_place($res['id'], $res['place']);
        echo functions::display_user($res, $arg);
        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=online&amp;' . ($mod ? 'mod=' . $mod . '&amp;' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=online' . ($mod ? '&amp;mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
Пример #6
0
        case 1:
            echo ' Kil ';
            break;
    }
    $ontime = $mass1['lastdate'];
    $ontime2 = $ontime + 300;
    if (time() > $ontime2) {
        echo '<font color="#FF0000"> [Off]</font>';
    } else {
        echo '<font color="#00AA00"> [ON]</font>';
    }
    echo '(' . functions::display_date($mass['time']) . ')<br/>';
    if ($set_user['smileys']) {
        $tekst = functions::smileys($mass['text'], $mass1['rights'] >= 1 ? 1 : 0);
    } else {
        $tekst = $mass['text'];
    }
    echo "{$tekst}<br/>";
    if ($rights == 5 || $rights >= 6) {
        echo long2ip($mass['ip']) . " - {$mass['soft']}<br/><a href='index.php?act=del&amp;id=" . $mass['id'] . "'>" . $lng['delete'] . "</a>";
    }
    echo '</div>';
    ++$i;
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $countm . '</div>';
// Навигация по страницам
if ($countm > $kmess) {
    echo '<p>' . functions::display_pagination('index.php?act=komm&amp;id=' . $id . '&amp;', $start, $countm, $kmess) . '</p>';
    echo '<p><form action="index.php" method="get"><input type="hidden" name="act" value="komm"/><input type="hidden" name="id" value="' . $id . '"/><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
}
echo '<p><a href="?id=' . $id . '">' . $lng['back'] . '</a></p>';
Пример #7
0
            //print_r($outmass);
            $out .= $post;
            $out .= '<div class="sub"><a href="index.php?act=delete&amp;id=' . $row['id'] . '">' . $lng['delete'] . '</a></div>';
            $out .= '</div>';
        }
        //Ставим метку о прочтении
        if ($mass_read) {
            $result = implode(',', $mass_read);
            mysql_query("UPDATE `cms_mail` SET `read`='1' WHERE `from_id`='{$user_id}' AND `sys`='1' 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=systems&amp;', $start, $total, $kmess) . '</div>';
        $out .= '<p><form action="index.php" method="get">
			<input type="hidden" name="act" value="systems"/>
			<input type="text" name="page" size="2"/>
			<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
    }
}
$textl = $lng['mail'];
require_once '../incfiles/head.php';
echo '<div class="phdr"><b>' . $lng_mail['systems_messages'] . '</b></div>';
echo $out;
echo '<p>';
if ($total) {
    echo '<a href="index.php?act=systems&amp;mod=clear">' . $lng_mail['clear_messages'] . '</a><br/>';
}
echo '<a href="../users/profile.php?act=office">' . $lng['personal'] . '</a></p>';
Пример #8
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>';
        }
}
Пример #9
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'];
             }
     }
 }
Пример #10
0
                $pos = 100;
            }
            $name = $res['name'];
            $text = functions::checkout(mb_substr($res['text'], $pos - 100, 400), 1);
            if ($search_t) {
                foreach ($array as $val) {
                    $name = ReplaceKeywords($val, $name);
                }
            } else {
                foreach ($array as $val) {
                    $text = ReplaceKeywords($val, $text);
                }
            }
            echo '<b><a href="index.php?id=' . $res['id'] . '">' . $name . '</a></b><br />' . $text . ' <div class="sub"><span class="gray">' . $lng_lib['added'] . ':</span> ' . $res['avtor'] . ' <span class="gray">(' . functions::display_date($res['time']) . ')</span><br />' . '<span class="gray">' . $lng_lib['reads'] . ':</span> ' . $res['count'] . '</div></div>';
            ++$i;
        }
    } else {
        echo '<div class="rmenu"><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_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>';
    }
} else {
    if ($error) {
        echo functions::display_error($error);
    }
    echo '<div class="phdr"><small>' . $lng['search_help'] . '</small></div>';
}
echo '<p>' . ($search ? '<a href="search.php">' . $lng['search_new'] . '</a><br />' : '') . '<a href="index.php">' . $lng['library'] . '</a></p>';
require '../incfiles/end.php';
Пример #11
0
    case 'ip':
        $sort = 'ip';
        echo '<a href="index.php?act=usr&amp;sort=id">ID</a> | <a href="index.php?act=usr&amp;sort=nick">' . $lng['nick'] . '</a> | IP</div>';
        $order = '`ip` ASC';
        break;
    default:
        $sort = 'id';
        echo 'ID | <a href="index.php?act=usr&amp;sort=nick">' . $lng['nick'] . '</a> | <a href="index.php?act=usr&amp;sort=ip">IP</a></div>';
        $order = '`id` ASC';
}
$req = mysql_query("SELECT COUNT(*) FROM `users`");
$total = mysql_result($req, 0);
$req = mysql_query("SELECT * FROM `users` WHERE `preg` = 1 ORDER BY {$order} LIMIT " . $start . ", " . $kmess);
$i = 0;
while (($res = mysql_fetch_assoc($req)) !== false) {
    $link = '';
    if ($rights >= 7) {
        $link .= '<a href="../users/profile.php?act=edit&amp;user='******'id'] . '">' . $lng['edit'] . '</a> | <a href="index.php?act=usr_del&amp;id=' . $res['id'] . '">' . $lng['delete'] . '</a> | ';
    }
    $link .= '<a href="../users/profile.php?act=ban&amp;mod=do&amp;user='******'id'] . '">' . $lng['ban_do'] . '</a>';
    echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
    echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>', 'sub' => $link));
    echo '</div>';
    ++$i;
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=usr&amp;sort=' . $sort . '&amp;', $start, $total, $kmess) . '</div>';
    echo '<p><form action="index.php?act=usr&amp;sort=' . $sort . '" 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?act=search_user">' . $lng['search_user'] . '</a><br /><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
Пример #12
0
    if ($total) {
        if ($mod == 'history') {
            $req = mysql_query("SELECT `cms_users_iphistory`.*, `users`.`name`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`id`, `users`.`browser`\n                FROM `cms_users_iphistory` LEFT JOIN `users` ON `cms_users_iphistory`.`user_id` = `users`.`id`\n                WHERE `cms_users_iphistory`.`ip` BETWEEN {$ip1} AND {$ip2} OR `cms_users_iphistory`.`ip_via_proxy` BETWEEN {$ip1} AND {$ip2}\n                GROUP BY `users`.`id`\n                ORDER BY `ip` ASC, `name` ASC LIMIT {$start}, {$kmess}\n            ");
        } else {
            $req = mysql_query("SELECT * FROM `users`\n            WHERE `ip` BETWEEN {$ip1} AND {$ip2} OR `ip_via_proxy` BETWEEN {$ip1} AND {$ip2}\n            ORDER BY `ip` ASC, `name` ASC LIMIT {$start}, {$kmess}");
        }
        $i = 0;
        while (($res = mysql_fetch_assoc($req)) !== false) {
            echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
            echo functions::display_user($res, array('iphist' => 1));
            echo '</div>';
            ++$i;
        }
    } else {
        echo '<div class="menu"><p>' . $lng['not_found'] . '</p></div>';
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
    if ($total > $kmess) {
        // Навигация по страницам
        echo '<div class="topmenu">' . functions::display_pagination('index.php?act=search_ip' . ($mod == 'history' ? '&amp;mod=history' : '') . '&amp;search=' . urlencode($search) . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=search_ip' . ($mod == 'history' ? '&amp;mod=history' : '') . '&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><a href="index.php?act=search_ip">' . $lng['search_new'] . '</a><br /><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
} else {
    // Выводим сообщение об ошибке
    if ($error) {
        echo functions::display_error($error);
    }
    // Инструкции для поиска
    echo '<div class="phdr">' . $lng['search_ip_help'] . '</div>';
    echo '<p><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
}
Пример #13
0
     }
 } else {
     echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
 }
 echo '<div class="phdr">';
 if ($totalcat > 0) {
     echo $lng_dl['folders'] . ': ' . $totalcat;
 }
 echo '&#160;&#160;';
 if ($totalfile > 0) {
     echo $lng_dl['files'] . ': ' . $totalfile;
 }
 echo '</div>';
 // Постраничная навигация
 if ($total > $kmess) {
     echo '<p>' . functions::display_pagination('index.php?cat=' . $cat . '&amp;', $start, $total, $kmess) . '</p>';
 }
 if ($rights == 4 || $rights >= 6) {
     ////////////////////////////////////////////////////////////
     // Выводим ссылки на модерские функции                    //
     ////////////////////////////////////////////////////////////
     echo '<p><div class="func">';
     echo '<a href="?act=makdir&amp;cat=' . $cat . '">' . $lng_dl['make_folder'] . '</a><br/>';
     if (!empty($_GET['cat'])) {
         $delcat = mysql_query("select * from `download` where type = 'cat' and refid = '" . $cat . "';");
         $delcat1 = mysql_num_rows($delcat);
         if ($delcat1 == 0) {
             echo '<a href="index.php?act=delcat&amp;cat=' . $cat . '">' . $lng_dl['delete_folder'] . '</a><br />';
         }
         echo '<a href="index.php?act=ren&amp;cat=' . $cat . '">' . $lng_dl['rename_folder'] . '</a><br />';
         echo '<a href="index.php?act=select&amp;cat=' . $cat . '">' . $lng_dl['upload_file'] . '</a><br />';
Пример #14
0
        /*
        -----------------------------------------------------------------
        Список постов Форума
        -----------------------------------------------------------------
        */
        $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `user_id` = '" . $user['id'] . "' AND `type` = 'm'" . ($rights >= 7 ? '' : " AND `close`!='1'")), 0);
        echo '<div class="phdr"><b>' . $lng['forum'] . '</b>: ' . $lng['messages'] . '</div>';
        if ($total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('profile.php?act=activity&amp;user='******'id'] . '&amp;', $start, $total, $kmess) . '</div>';
        }
        $req = mysql_query("SELECT * FROM `forum` WHERE `user_id` = '" . $user['id'] . "' AND `type` = 'm' " . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `id` DESC LIMIT {$start}, {$kmess}");
        if (mysql_num_rows($req)) {
            $i = 0;
            while ($res = mysql_fetch_assoc($req)) {
                $topic = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $res['refid'] . "'"));
                $section = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $topic['refid'] . "'"));
                $category = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $section['refid'] . "'"));
                $text = mb_substr($res['text'], 0, 300);
                $text = functions::checkout($text, 2, 1);
                $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text);
                echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') . '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $topic['id'] . '">' . $topic['text'] . '</a>' . '<br />' . $text . '...<a href="' . $set['homeurl'] . '/forum/index.php?act=post&amp;id=' . $res['id'] . '"> &gt;&gt;</a>' . '<div class="sub">' . '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $category['id'] . '">' . $category['text'] . '</a> | ' . '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $section['id'] . '">' . $section['text'] . '</a>' . '<br /><span class="gray">(' . functions::display_date($res['time']) . ')</span>' . '</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('profile.php?act=activity' . ($mod ? '&amp;mod=' . $mod : '') . '&amp;user='******'id'] . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="profile.php?act=activity&amp;user='******'id'] . ($mod ? '&amp;mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
Пример #15
0
        $total = count($dir);
        for ($i = $start; $i < $page * $kmess && $i < $total; $i++) {
            $smiley = explode('/', $dir[$i]);
            $smiley = array_pop($smiley);
            $format = functions::format($smiley);
            $smiley_code = str_replace('.' . $format, '', strtolower($smiley));
            echo $i % 2 ? '<div class="menu">' : '<div class="menu">';
            echo functions::smileys(':' . $smiley_code . '') . ' :' . $smiley_code . '<br />
<a href="?act=smileys&amp;mod=unlink&amp;do=' . $do . '&amp;smiley=' . $smiley . '">' . $lng['delete'] . '</a>
| <a href="?act=smileys&amp;mod=rename&amp;do=' . $do . '&amp;smiley=' . $smiley . '">' . $lng['edit'] . '</a>';
            echo '</div>';
        }
        echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div></div>';
        if ($total > $kmess) {
            echo '<div class="topmenu"><form action="?act=smileys&amp;do=' . $do . '&amp;mod=show_cat" method="post">
' . functions::display_pagination('?act=smileys&amp;do=' . $do . '&amp;mod=show_cat&amp;', $start, $total, $kmess) . '
<input type="text" name="page" size="2"/><input type="submit" value="Go!"/></form></div>';
        }
        break;
    case 'upload':
        $c = '../images/smileys/user/' . $do . '/';
        if (!is_dir($c)) {
            echo functions::display_error($lng['error_wrong_data']);
            echo '<p><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
            require_once '../incfiles/end.php';
            exit;
        }
        $name_cat = $lng_smileys[$do] ? $lng_smileys[$do] : $do;
        echo '<div class="mainblok"><div class="phdr"><a href="?act=smileys&amp;do=' . $do . '&amp;mod=show_cat"><b>' . htmlspecialchars($name_cat) . '</b></a>
| Upload</div>';
        if (isset($_POST['submit'])) {
Пример #16
0
                $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 {
    /*
    -----------------------------------------------------------------
    Выводим список разделов, в которых есть файлы
    -----------------------------------------------------------------
    */
    $countnew = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_files` WHERE `time` > '{$new}'" . ($rights >= 7 ? '' : " AND `del` != '1'") . $sql), 0);
    echo '<p>' . ($countnew > 0 ? '<a href="index.php?act=files&amp;new' . $lnk . '">' . $lng['new_files'] . ' (' . $countnew . ')</a>' : $lng_forum['new_files_empty']) . '</p>';
    echo '<div class="phdr">' . $caption . '</div>';
    $link = array();
    $total = 0;
Пример #17
0
            $text .= ' <span style="color:green;">...</span>';
        }
        if ($res['kedit']) {
            $text .= '<br /><span class="gray"><small>' . $lng_forum['edited'] . ' <b>' . $res['edit'] . '</b> (' . date("d.m /H:i", $res['tedit'] + $set_user['sdvig'] * 3600) . ') <b>[' . $res['kedit'] . ']</b></small></span>';
        }
        echo $text;
        $file_req = mysql_query("SELECT * FROM `cms_forum_files` WHERE `post` = '" . $res['id'] . "'");
        if (mysql_num_rows($file_req) > 0) {
            $file_res = mysql_fetch_assoc($file_req);
            $file_ile_size = round(@filesize('../files/forum/attach/' . $file_res['filename']) / 1024, 2);
            echo '<br /><span class="gray">' . $lng_forum['attached_file'] . ':';
            $att_ext = strtolower(functions::format('./files/forum/attach/' . $file_res['filename']));
            $pic_ext = array('gif', 'jpg', 'jpeg', 'png');
            if (in_array($att_ext, $pic_ext)) {
                echo '<div><a href="../forum/index.php?act=file&amp;id=' . $file_res['id'] . '"><img src="../forum/thumbinal.php?file=' . urlencode($file_res['filename']) . '" alt="' . $lng_forum['click_to_view'] . '" /></a></div>';
            } else {
                echo '<br /><a href="../forum/index.php?act=file&amp;id=' . $file_res['id'] . '">' . $file_res['filename'] . '</a>';
            }
            echo ' (' . $file_ile_size . ' кб.)<br/>' . $lng_forum['downloads'] . ': ' . $file_res['dlcount'] . ' ' . $lng_forum['time'] . '</span>';
        }
        echo '</small></div></div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>Masih kosong brot :D</p></div>';
}
echo '<div class="phdr">Всего: ' . $total . '</div>';
if ($total > $kmess) {
    echo '<p>' . functions::display_pagination('journal.php?', $start, $total, $kmess) . '</p>' . '<p><form action="journal.php?" method="post"><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
}
require '../incfiles/end.php';
Пример #18
0
    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>';
if ($total > $kmess) {
    echo '<p>' . functions::display_pagination('profile.php?act=ip&amp;user='******'id'] . '&amp;', $start, $total, $kmess) . '</p>';
    echo '<p><form action="profile.php?act=ip&amp;user='******'id'] . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
Пример #19
0
                         $post .= '<div class="reply">' . functions::checkout($row['reply'], 1, 1) . '</div>';
                     }
                     if ($rights >= 7) {
                         $subtext = '<a href="index.php?act=comments&amp;mod=replay&amp;id=' . $id . '&amp;com=' . $row['mid'] . '">Jawab</a> | <a href="index.php?act=comments&amp;mod=delete&amp;id=' . $id . '&amp;com=' . $row['mid'] . '">Hapus</a>';
                     } else {
                         $subtext = '';
                     }
                     $text = ' <span class="gray">(' . functions::display_date($row['mtime']) . ')</span>';
                     $arg = array('header' => $text, 'body' => $post, 'sub' => $subtext);
                     echo functions::display_user($row, $arg);
                     echo '</div>';
                     ++$i;
                 }
                 echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
                 if ($total > $kmess) {
                     echo '<div class="topmenu">' . functions::display_pagination('index.php?act=comments&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</div>';
                     echo '<p><form action="index.php" method="get">
            <input type="hidden" name="act" value="comments"/>
            <input type="hidden" name="id" value="' . $id . '"/>
            <input type="text" name="page" size="2"/>
            <input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
                 }
             } else {
                 echo '<div class="rmenu">Belum ada komentar,jadilah yg pertamax !</div>';
             }
     }
     echo '<div class="bmenu"><a href="index.php?act=view&amp;id=' . $id . '">Kembali</a></div>';
 } else {
     $textl = 'Blogs';
     require_once '../incfiles/head.php';
     echo functions::display_error('Blogs tidak ada');
Пример #20
0
 $text = functions::checkout(mb_substr($req['text'], $int_start, $int_lenght), 1, 1);
 if ($set_user['smileys']) {
     $text = functions::smileys($text, $rights ? 1 : 0);
 }
 echo '<div class="list2">' . $text . '</div>';
 // Ссылка на комментарии
 if ($set['mod_lib_comm'] || $rights >= 7) {
     $km = mysql_query("select `id` from `lib` where type = 'komm' and refid = '" . $id . "'");
     $km1 = mysql_num_rows($km);
     $comm_link = "<a href='index.php?act=komm&amp;id=" . $id . "'>" . $lng['comments'] . "</a> ({$km1})";
 } else {
     $comm_link = '&#160;';
 }
 echo '<div class="phdr">' . $comm_link . '</div>';
 if ($count_pages > 1) {
     echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&amp;', $start, $count_pages, 1) . '</div><div class="topmenu">' . '<form action="index.php?id=' . $id . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></div>';
 }
 if ($rights == 5 || $rights >= 6) {
     echo '<p><a href="index.php?act=edit&amp;id=' . $id . '">' . $lng['edit'] . '</a><br/>';
     echo '<a href="index.php?act=del&amp;id=' . $id . '">' . $lng['delete'] . '</a></p>';
 }
 echo '<a href="index.php?act=java&amp;id=' . $id . '">' . $lng_lib['download_java'] . '</a><br /><br />';
 $dnam = mysql_query("select `id`, `refid`, `text` from `lib` where type = 'cat' and id = '" . $zag['refid'] . "'");
 $dnam1 = mysql_fetch_array($dnam);
 $catname = "{$dnam1['text']}";
 $dirid = "{$dnam1['id']}";
 $nadir = $zag['refid'];
 while ($nadir != "0") {
     echo "&#187;<a href='index.php?id=" . $nadir . "'>{$catname}</a><br/>";
     $dnamm = mysql_query("select `id`, `refid`, `text` from `lib` where type = 'cat' and id = '" . $nadir . "'");
     $dnamm1 = mysql_fetch_array($dnamm);
Пример #21
0
        echo '<div class="phdr"> <a href="faq.php?act=tags">ВВcode</a> | <b>Upload Gambar</b></div>' . '<form enctype="multipart/form-data" method="post" action="upload_img.php?img"><div class="list1">' . 'Pilih gambar:<br /><input type="file" name="imagefile" value="" />' . '<input type="hidden" name="MAX_FILE_SIZE" value="' . 1024 * $upload_file_size . '" />' . '<br />' . '<p><input type="submit" name="submit" value="Upload" /></p></div></form>' . '<div class="list2"><small>Type file yang diperbolehkan adalah JPG, JPEG, PNG, dan GIF<br />' . 'Ukuran file tidak boleh melebihi ' . $upload_file_size . 'kb.</small></div>' . '<div class="phdr"><b>Gambar</b></div>';
        $array = glob($rootpath . 'files/images/*preview.jpg');
        $total = count($array);
        $end = $start + $kmess;
        if ($end > $total) {
            $end = $total;
        }
        if ($start >= $total) {
            $start = 0;
            $end = $total > $kmess ? $kmess : $total;
        }
        if ($total > 0) {
            for ($i = $start; $i < $end; $i++) {
                $code = preg_replace('#../files/images/(.+?)_preview.jpg#is', '\\1', $array[$i]);
                echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
                echo '<table width="100%" cellspacing="0" cellpadding="0"><tr valign="top"><td>' . '<a href="' . str_replace('_preview', '', $array[$i]) . '"><img src="' . $array[$i] . '" alt="+"  /></a></td>' . '<td align="right"><input type="text" value="[img=' . $code . ']" /></td></tr></table></div>';
            }
        } else {
            echo '<div class="menu">Daftar Kosong!</div>';
        }
        echo '<div class="phdr">Total' . $total . '</div>';
        if ($total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('upload_img.php?', $start, $total, $kmess) . '</div>';
            echo '<p><form action="upload_img.php" method="post"><input type="submit" value="pergi ke halaman &gt;&gt;"/></form></p>';
        }
        echo '<p><a href="faq.php?act=tags">ВВcode</a></p>';
    }
} else {
    header('location: /login.php');
}
require '../incfiles/end.php';
Пример #22
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>';
Пример #23
0
         if ($total > 0) {
             for ($i = $start; $i < $end; $i++) {
                 $ava = preg_replace('#^' . $rootpath . 'images/avatars/' . $id . '/(.*?).png$#isU', '$1', $array[$i], 1);
                 echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
                 echo '<img src="' . $array[$i] . '" alt="" />';
                 if ($user_id) {
                     echo ' - <a href="faq.php?act=avatars&amp;id=' . $id . '&amp;avatar=' . $ava . '">' . $lng['select'] . '</a>';
                 }
                 echo '</div>';
             }
         } else {
             echo '<div class="menu">' . $lng['list_empty'] . '</div>';
         }
         echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
         if ($total > $kmess) {
             echo '<p>' . functions::display_pagination('faq.php?act=avatars&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</p>' . '<p><form action="faq.php?act=avatars&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="faq.php?act=avatars">' . $lng['catalogue'] . '</a><br />' . '<a href="' . $_SESSION['ref'] . '">' . $lng['back'] . '</a></p>';
     }
 } else {
     // Показываем каталоги с Аватарами
     echo '<div class="phdr"><a href="faq.php"><b>F.A.Q.</b></a> | ' . $lng['avatars'] . '</div>';
     $dir = glob($rootpath . 'images/avatars/*', GLOB_ONLYDIR);
     $total = 0;
     $total_dir = count($dir);
     for ($i = 0; $i < $total_dir; $i++) {
         $count = (int) count(glob($dir[$i] . '/*.png'));
         $total = $total + $count;
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         echo '<a href="faq.php?act=avatars&amp;id=' . preg_replace('#^' . $rootpath . 'images/avatars/#isU', '', $dir[$i], 1) . '">' . htmlentities(file_get_contents($dir[$i] . '/name.dat'), ENT_QUOTES, 'utf-8') . '</a> (' . $count . ')</div>';
     }
Пример #24
0
                echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
                $get_ip = $res['ip1'] == $res['ip2'] ? long2ip($res['ip1']) : long2ip($res['ip1']) . ' - ' . long2ip($res['ip2']);
                echo '<a href="index.php?act=ipban&amp;mod=detail&amp;id=' . $res['id'] . '">' . $get_ip . '</a> ';
                switch ($res['ban_type']) {
                    case 2:
                        echo $lng['redirect'];
                        break;
                    case 3:
                        echo $lng['registration'];
                        break;
                    default:
                        echo '<b>' . $lng['blocking'] . '</b>';
                }
                echo '</div>';
                ++$i;
            }
        } else {
            echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
        }
        echo '<div class="rmenu"><form action="index.php?act=ipban&amp;mod=new" method="post"><input type="submit" name="" value="' . $lng['ip_ban_new'] . '" /></form></div>';
        echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
        if ($total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('index.php?act=ipban&amp;', $start, $total, $kmess) . '</div>';
            echo '<p><form action="index.php?act=ipban" method="post"><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
        }
        echo '<p>';
        if ($total > 0) {
            echo '<a href="index.php?act=ipban&amp;mod=search">' . $lng['search'] . '</a><br /><a href="index.php?act=ipban&amp;mod=clear">' . $lng['ip_ban_clean'] . '</a><br />';
        }
        echo '<a href="index.php">' . $lng['admin_panel'] . '</a></p>';
}
Пример #25
0
                 echo '<input type="checkbox" name="delch[]" value="' . $key . '"/>&#160;';
             }
             echo '<a href="?act=languages&amp;mod=edit_phrase&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;key=' . $key . '&amp;symbol=' . $symbol . '&amp;start=' . $start . '">' . $lng['edit'] . '</a>';
             if (isset($lng_edit[$name_module]) && in_array($key, array_keys($lng_edit[$name_module]))) {
                 $reset = true;
                 echo ' | <a href="?act=languages&amp;mod=delete_phrase&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;key=' . $key . '&amp;symbol=' . $symbol . '&amp;start=' . $start . '">' . $panel_lng['default'] . '</a>';
             }
             echo '</div></div>';
             ++$i;
         }
         if ($reset) {
             echo '<div class="rmenu"><input type="submit" value="' . $panel_lng['default'] . '"/></div>';
         }
         echo '</form><div class="phdr">' . $lng['total'] . ': <b>' . $total . '</b></div>';
         if ($total > $kmess) {
             echo '<div class="topmenu">' . functions::display_pagination('?act=languages&amp;mod=search&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;search=' . urlencode($search) . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="?act=languages&amp;mod=search&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;search=' . urlencode($search) . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
         }
     } else {
         echo '<div class="rmenu"><p>' . $lng['list_empty'] . '!</p></div>' . '<div class="phdr"><a href="?act=languages&amp;mod=phrases&amp;language=' . $language . '&amp;module=' . $name_module . '"><b>' . $lng['back'] . '</b></a></div>';
     }
     echo '<p><a href="index.php">' . $lng['admin_panel'] . '</a></p>';
     break;
 case 'edit_phrase':
     /*
     -----------------------------------------------------------------
     Редактируем отдельную фразу языкового модуля
     -----------------------------------------------------------------
     */
     $name_module = isset($_GET['module']) ? ini_file::key_filter($_GET['module']) : false;
     $symbol = isset($_GET['symbol']) ? trim(mb_substr($_GET['symbol'], 0, 1)) : 0;
     $key = isset($_GET['key']) ? ini_file::key_filter($_GET['key']) : 0;
Пример #26
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>';
Пример #27
0
                    // A?Ac??o@a@??e???????ye?cc??
                    $res['name'] = functions::checkout($res['name']);
                    $text = functions::antilink(functions::checkout($res['text'], 0, 2));
                }
                // Tampilkan text posting
                echo '<div class="textx">' . $text . '</div>';
                echo '<font color="lime">';
                //echo functions::update_time($res['time']);
                echo '</font>';
                // link ke pungsi moderskie
                if ($rights >= 7) {
                    echo '<div class="maintxt"><a href="qchat.php?act=del&amp;id=' . $res['id'] . '">' . $lng['delete'] . '</a></div>';
                }
                echo "</div>";
                ++$i;
            }
            echo "<div class='phdr'><a name='down' id='down'></a><a href='#up'><img src='../theme/default/images/up.png' alt='up' /></a>&nbsp;&nbsp;&nbsp;Total : {$colmes}</div>";
            if ($colmes > $kmess) {
                echo '<div class="topmenu">' . functions::display_pagination('qchat.php?', $start, $colmes, $kmess) . '</div>';
                echo '<form action="qchat.php" method="get"><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . '"/><br /></form>';
            }
            // untuk admin menyediakan link untuk pembersihan
            if ($rights >= 8) {
                echo '<a href="qchat.php?act=clean">' . $lng['clear_all'] . '</a><br />';
            }
        } else {
            echo '<div class="gmenu">' . $lng['guestbook_empty'] . ' </div>';
        }
        break;
}
require_once "../incfiles/end.php";