echo '<p><a href="index.php?act=say&id=' . $id . '&yes&cyt">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $type1['refid'] . '">' . $lng_forum['not_agree'] . '</a></p>'; require '../incfiles/end.php'; exit; } } $msg_pre = functions::checkout($msg, 1, 1); if ($set_user['smileys']) { $msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0); } $msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre); echo '<div class="phdr"><b>' . $lng_forum['topic'] . ':</b> ' . $th1['text'] . '</div>'; $qt = str_replace("<br/>", "\r\n", $qt); $qt = trim(preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '', $qt)); $qt = functions::checkout($qt, 0, 2); if (!empty($_POST['msg']) && !isset($_POST['submit'])) { echo '<div class="list1">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>'; } echo '<form name="form" action="index.php?act=say&id=' . $id . '&start=' . $start . (isset($_GET['cyt']) ? '&cyt' : '') . '" method="post"><div class="gmenu">'; if (isset($_GET['cyt'])) { // Форма с цитатой echo '<p><b>' . $type1['from'] . '</b> <span class="gray">(' . $vr . ')</span></p>' . '<p><h3>' . $lng_forum['cytate'] . '</h3>' . '<textarea rows="' . $set_user['field_h'] . '" name="citata">' . (empty($_POST['citata']) ? $qt : functions::checkout($_POST['citata'])) . '</textarea>' . '<br /><small>' . $lng_forum['cytate_help'] . '</small></p>'; } else { // Форма с репликой echo '<p><h3>' . $lng_forum['reference'] . '</h3>' . '<input type="radio" value="0" ' . (!$txt ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>,<br />' . '<input type="radio" value="2" ' . ($txt == 2 ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_1'] . ',<br />' . '<input type="radio" value="3" ' . ($txt == 3 ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_2'] . ' (<a href="index.php?act=post&id=' . $type1['id'] . '">' . $vr . '</a>) ' . $lng_forum['reply_3'] . ',<br />' . '<input type="radio" value="4" ' . ($txt == 4 ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_4'] . '</p>'; } echo '<p><h3>' . $lng_forum['post'] . '</h3>'; if (!$is_mobile) { echo '</p><p>' . bbcode::auto_bb('form', 'msg'); } echo '<textarea rows="' . $set_user['field_h'] . '" name="msg">' . (empty($_POST['msg']) ? '' : functions::checkout($_POST['msg'])) . '</textarea></p>' . '<p><input type="checkbox" name="addfiles" value="1" ' . (isset($_POST['addfiles']) ? 'checked="checked" ' : '') . '/> ' . $lng_forum['add_file']; if ($set_user['translit']) {
while (($row = mysql_fetch_assoc($req)) !== false) { echo $i % 2 ? '<div class="list1">' : '<div class="list2">'; $post = $row['text']; $post = functions::checkout($post, 1, 1); if ($set_user['smileys']) { $post = functions::smileys($post, $row['rights'] >= 1 ? 1 : 0); } if ($row['reply']) { $post .= '<div class="reply">' . functions::checkout($row['reply'], 1, 1) . '</div>'; } if ($rights >= 7) { $subtext = '<a href="index.php?act=comments&mod=replay&id=' . $id . '&com=' . $row['mid'] . '">Jawab</a> | <a href="index.php?act=comments&mod=delete&id=' . $id . '&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&id=' . $id . '&', $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'] . ' >>"/></form></p>'; } } else {
case "jpeg": $imagnam = "temp/{$namefile}.temp.jpg"; imageJpeg($im1, $imagnam, $quality); echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; case "png": $imagnam = "temp/{$namefile}.temp.png"; imagePng($im1, $imagnam, $quality); echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; } imagedestroy($im); imagedestroy($im1); $kom = mysql_query("select * from `gallery` where type='km' and refid='" . $newf['id'] . "';"); $kom1 = mysql_num_rows($kom); echo "</a><br/>" . $lng['date'] . ': ' . functions::display_date($newf['time']) . '<br/>' . $lng['description'] . ": {$newf['text']}<br/>"; $al = mysql_query("select * from `gallery` where type = 'al' and id = '" . $newf['refid'] . "';"); $al1 = mysql_fetch_array($al); $rz = mysql_query("select * from `gallery` where type = 'rz' and id = '" . $al1['refid'] . "';"); $rz1 = mysql_fetch_array($rz); echo '<a href="index.php?id=' . $al1['id'] . '">' . $rz1['text'] . ' / ' . $al1['text'] . '</a></div>'; } ++$i; } if ($totalnew > 10) { echo "<hr/>"; $ba = ceil($totalnew / 10); if ($start != 0) { echo '<a href="index.php?act=new&page=' . ($page - 1) . '"><<</a> '; } $asd = $start - 10;
mysql_query("UPDATE `cms_album_files` SET `views` = '{$views}' WHERE `id` = '" . $res['id'] . "'"); } } else { /* ----------------------------------------------------------------- Предпросмотр изображения в списке ----------------------------------------------------------------- */ echo '<a href="album.php?act=show&al=' . $al . '&img=' . $res['id'] . '&user='******'id'] . '&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&img=' . $res['id'] . '&user='******'id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=image_move&img=' . $res['id'] . '&user='******'id'] . '">' . $lng['move'] . '</a>', '<a href="album.php?act=image_delete&img=' . $res['id'] . '&user='******'id'] . '">' . $lng['delete'] . '</a>')); if ($user['id'] == $user_id && $view) { echo ' | <a href="album.php?act=show&al=' . $al . '&user='******'id'] . '&view&img=' . $res['id'] . '&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&img=' . $res['id'] . '">' . $lng['comments'] . '</a> (' . $res['comm_count'] . ')<br />' . '<a href="album.php?act=image_download&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&al=' . $al . '&user='******'id'] . '&' . ($view ? 'view&' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="album.php?act=show&al=' . $al . '&user='******'id'] . ($view ? '&view' : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; } echo '<p><a href="album.php?act=list&user='******'id'] . '">' . $lng_profile['album_list'] . '</a></p>';
if (!$search_t) { // Поиск только в тексте $req_t = mysql_query("SELECT `id`,`text` FROM `forum` WHERE `id` = '" . $res['refid'] . "'"); $res_t = mysql_fetch_assoc($req_t); echo '<b>' . $res_t['text'] . '</b><br />'; } else { // Поиск в названиях тем $req_p = mysql_query("SELECT `text` FROM `forum` WHERE `refid` = '" . $res['id'] . "' ORDER BY `id` ASC LIMIT 1"); $res_p = mysql_fetch_assoc($req_p); foreach ($array as $val) { $res['text'] = ReplaceKeywords($val, $res['text']); } echo '<b>' . $res['text'] . '</b><br />'; } echo '<a href="../users/profile.php?user='******'user_id'] . '">' . $res['from'] . '</a> '; echo ' <span class="gray">(' . functions::display_date($res['time']) . ')</span><br/>'; $text = $search_t ? $res_p['text'] : $res['text']; foreach ($array as $srch) { if (($pos = mb_strpos(strtolower($res['text']), strtolower(str_replace('*', '', $srch)))) !== false) { break; } } if (!isset($pos) || $pos < 100) { $pos = 100; } $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text); $text = functions::checkout(mb_substr($text, $pos - 100, 400), 1); if (!$search_t) { foreach ($array as $val) { $text = ReplaceKeywords($val, $text); }
if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?act=online&' . ($mod ? 'mod=' . $mod . '&' : ''), $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" /> ' . 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&' . ($mod ? 'mod=' . $mod . '&' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=online' . ($mod ? '&mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; }
if (!isset($_GET['yes'])) { $lng_faq = core::load_lng('faq'); echo '<p>' . $lng_faq['forum_rules_text'] . '</p>'; echo '<p><a href="index.php?act=nt&id=' . $id . '&yes">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $id . '">' . $lng_forum['not_agree'] . '</a></p>'; require '../incfiles/end.php'; exit; } } $msg_pre = functions::checkout($msg, 1, 1); if ($set_user['smileys']) { $msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0); } $msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre); echo '<div class="phdr"><a href="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['new_topic'] . '</div>'; if ($msg && $th && !isset($_POST['submit'])) { echo '<div class="list1"><img src="../theme/default/images/op.gif" border="0" alt="op" /> <span style="font-weight: bold">' . $th . '</span></div>' . '<div class="list2">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>'; } echo '<form name="form" action="index.php?act=nt&id=' . $id . '" method="post">' . '<div class="gmenu">' . '<p><h3>' . $lng['section'] . '</h3>' . '<a href="index.php?id=' . $res_c['id'] . '">' . $res_c['text'] . '</a> | <a href="index.php?id=' . $res_r['id'] . '">' . $res_r['text'] . '</a></p>' . '<p><h3>' . $lng_forum['new_topic_name'] . '</h3>'; echo '<select name="tiento"> <option value="0">No Prefix</option> <option value="1">Discuss</option> <option value="2">Share</option> <option value="3">Info</option> <option value="4">Tutorial</option> <option value="5">Help</option> <option value="6">Ask</option> <option value="7">Request</option> <option value="8">Movie</option> <option value="9">Ongoing</option> <option value="10">Completed</option> </select>
} if (!isset($pos) || $pos < 100) { $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&' : '') . 'search=' . urlencode($search) . '&', $start, $total, $kmess) . '</div>' . '<p><form action="search.php?' . ($search_t ? 't=1&' : '') . 'search=' . urlencode($search) . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; } } else { if ($error) { echo functions::display_error($error); } echo '<div class="phdr"><small>' . $lng['search_help'] . '</small></div>'; }
} } // Удаляем посты mysql_query("DELETE FROM `forum` WHERE `type` = 'm' AND `close` = '1' {$sort}"); header('Location: index.php?act=forum&mod=hposts'); } else { $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 'm' AND `close` = '1' {$sort}"), 0); if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?act=forum&mod=hposts&', $start, $total, $kmess) . '</div>'; } $req = mysql_query("SELECT `forum`.*, `forum`.`id` AS `fid`, `forum`.`user_id` AS `id`, `forum`.`from` AS `name`, `forum`.`soft` AS `browser`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`\n FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\n WHERE `forum`.`type` = 'm' AND `forum`.`close` = '1' {$sort} ORDER BY `forum`.`id` DESC LIMIT {$start}, {$kmess}"); if (mysql_num_rows($req)) { $i = 0; while ($res = mysql_fetch_assoc($req)) { $res['ip'] = ip2long($res['ip']); $posttime = ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>'; $page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `refid` = '" . $res['refid'] . "' AND `id` " . ($set_forum['upfp'] ? ">=" : "<=") . " '" . $res['fid'] . "'"), 0) / $kmess); $text = mb_substr($res['text'], 0, 500); $text = functions::checkout($text, 1, 0); $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text); $theme = mysql_fetch_assoc(mysql_query("SELECT `id`, `text` FROM `forum` WHERE `id` = '" . $res['refid'] . "'")); $text = '<b>' . $theme['text'] . '</b> <a href="../forum/index.php?id=' . $theme['id'] . '&page=' . $page . '">>></a><br />' . $text; $subtext = '<span class="gray">' . $lng_forum['filter_to'] . ':</span> '; $subtext .= '<a href="index.php?act=forum&mod=hposts&tsort=' . $theme['id'] . '">' . $lng_forum['by_theme'] . '</a> | '; $subtext .= '<a href="index.php?act=forum&mod=hposts&usort=' . $res['user_id'] . '">' . $lng_forum['by_author'] . '</a>'; echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; echo functions::display_user($res, array('header' => $posttime, 'body' => $text, 'sub' => $subtext)); echo '</div>'; ++$i; } if ($rights == 9) {
$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`, `text` FROM `forum` WHERE `type`='f' AND `id` = '" . $razd['refid'] . "' LIMIT 1"); $frm = mysql_fetch_assoc($q4); $colmes = mysql_query("SELECT `from`, `time` FROM `forum` WHERE `refid` = '" . $res['id'] . "' AND `type` = 'm'" . ($rights >= 7 ? '' : " AND `close` != '1'") . " ORDER BY `time` DESC"); $colmes1 = mysql_num_rows($colmes); $cpg = ceil($colmes1 / $kmess); $nick = mysql_fetch_assoc($colmes); // Значки $icons = array(isset($np) ? !$res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/op.gif" alt=""/>' : '' : '<img src="../theme/' . $set_user['skin'] . '/images/np.gif" alt=""/>', $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, ' ', ' '); echo '<a href="index.php?id=' . $res['id'] . ($cpg > 1 && $set_forum['upfp'] && $set_forum['postclip'] ? '&clip' : '') . ($set_forum['upfp'] && $cpg > 1 ? '&page=' . $cpg : '') . '">' . $res['text'] . '</a> [' . $colmes1 . ']'; if ($cpg > 1) { echo ' <a href="index.php?id=' . $res['id'] . (!$set_forum['upfp'] && $set_forum['postclip'] ? '&clip' : '') . ($set_forum['upfp'] ? '' : '&page=' . $cpg) . '">>></a>'; } echo '<div class="sub">' . $res['from'] . ($colmes1 > 1 ? ' / ' . $nick['from'] : '') . ' <span class="gray">(' . functions::display_date($nick['time']) . ')</span><br />' . '<a href="index.php?id=' . $frm['id'] . '">' . $frm['text'] . '</a> / <a href="index.php?id=' . $razd['id'] . '">' . $razd['text'] . '</a>' . '</div></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=new&', $start, $total, $kmess) . '</div>' . '<p><form action="index.php" method="get">' . '<input type="hidden" name="act" value="new"/>' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; } echo '<p>'; if ($total) { echo '<a href="index.php?act=new&do=reset">' . $lng_forum['unread_reset'] . '</a><br/>'; } echo '<a href="index.php?act=new&do=select">' . $lng_forum['unread_show_for_period'] . '</a></p>'; } } else {
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'] . '&' . $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('&', '&', $this->url)); } else { echo functions::display_error($message['error'], '<a href="' . $this->url . '&mod=reply&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('&mod=reply&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('&', '&', $this->url)); } else { echo functions::display_error($message['error'], '<a href="' . $this->url . '&mod=edit&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('&mod=edit&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('&', '&', $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 . '&mod=del&item=' . $this->item . '&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 . '&mod=del&item=' . $this->item . '&yes&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 . '&', $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 . '&mod=reply&item=' . $res['subid'] . '">' . core::$lng['reply'] . '</a>' : '', $this->access_edit ? '<a href="' . $this->url . '&mod=edit&item=' . $res['subid'] . '">' . core::$lng['edit'] . '</a>' : '', $this->access_delete ? '<a href="' . $this->url . '&mod=del&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 . '&', $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'] . ' >>"/>' . '</form></p>'; } if (!empty($arg['context_bottom'])) { echo $arg['context_bottom']; } } }
* @dev agssbuzz@catroxs.org */ defined('_IN_JOHNCMS') or die('Error: restricted access'); require '../incfiles/head.php'; if (empty($_GET['id'])) { echo functions::display_error($lng['error_wrong_data']); require '../incfiles/end.php'; exit; } // pesan permintaan $req = mysql_query("SELECT `forum`.*, `users`.`sex`, `users`.`rights`, `users`.`lastdate`, `users`.`status`, `users`.`datereg`\nFROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\nWHERE `forum`.`type` = 'm' AND `forum`.`id` = '{$id}'" . ($rights >= 7 ? "" : " AND `forum`.`close` != '1'") . " LIMIT 1"); $res = mysql_fetch_array($req); // Query Alat $them = mysql_fetch_array(mysql_query("SELECT * FROM `forum` WHERE `type` = 't' AND `id` = '" . $res['refid'] . "'")); echo '<div class="phdr"><b>' . $lng_forum['topic'] . ':</b> ' . $them['text'] . '</div><div class="list1">'; echo '<table width="100%" cellpadding="0" cellspacing="0" class="phdr"><tr>' . '<td width="auto"><img src="' . $home . '/images/file.png"> </img> (' . functions::display_date($res['time']) . ')</td>' . '</tr></table><div class="newsx">'; if ($set_user['avatar']) { echo '<table width="100%"><tr><td width="40px" align="left" valign="top">'; if (file_exists('../files/users/avatar/' . $res['user_id'] . '.png')) { echo '<img src="../files/users/avatar/' . $res['user_id'] . '.png" width="32" height="32" alt="' . $res['from'] . '" /> '; } else { echo '<img src="../images/empty.png" width="32" height="32" alt="' . $res['from'] . '" /> '; } echo '</td>'; } // jenis kelamin if ($res['sex']) { echo '<img src="../theme/' . $set_user['skin'] . '/images/' . ($res['sex'] == 'm' ? 'm' : 'w') . '.png" alt="" width="16" height="16"/> '; } else { echo '<img src="../images/del.png" width="12" height="12" /> '; }
* @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'); echo '<div class="phdr"><b>' . $lng_lib['new_articles'] . '</b></div>'; $req = mysql_query("SELECT COUNT(*) FROM `lib` WHERE `time` > '" . (time() - 259200) . "' AND `type` = 'bk' AND `moder` = '1'"); $total = mysql_result($req, 0); if ($total > 0) { $req = mysql_query("SELECT * FROM `lib` WHERE `time` > '" . (time() - 259200) . "' AND `type` = 'bk' AND `moder` = '1' ORDER BY `time` DESC LIMIT " . $start . "," . $kmess); $i = 0; while ($newf = mysql_fetch_array($req)) { echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; echo '<b><a href="?id=' . $newf['id'] . '">' . htmlentities($newf['name'], ENT_QUOTES, 'UTF-8') . '</a></b><br/>'; echo htmlentities($newf['announce'], ENT_QUOTES, 'UTF-8') . '<br />'; echo $lng_lib['added'] . ': ' . $newf['avtor'] . ' (' . functions::display_date($newf['time']) . ')<br/>'; $nadir = $newf['refid']; $dirlink = $nadir; $pat = ""; while ($nadir != "0") { $dnew = mysql_query("select * from `lib` 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 '[<a href="index.php?id=' . $dirlink . '">' . $pat1 . '</a>]</div>'; ++$i; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
$text = functions::smileys($text, $res['rights'] ? 1 : 0); } //seo //echo bbcode::notags($text) . '...<br /><a href="index.php?act=post&id=' . $res['id'] . '">' . $lng_forum['read_all'] . ' >></a>'; echo bbcode::notags($text) . '...<br /><a href="' . $home . '/forum/' . functions::seo($type1['text']) . '_p' . $res['id'] . '.html">' . $lng_forum['read_all'] . ' >></a>'; } else { // Или, обрабатываем тэги и выводим весь текст $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text, $res['rights'] ? 1 : 0); } echo $text; } if ($res['kedit']) { // Если пост редактировался, показываем кем и когда echo '<br /><span class="gray"><small>' . $lng_forum['edited'] . ' <b>' . $res['edit'] . '</b> (' . functions::display_date($res['tedit']) . ') <b>[' . $res['kedit'] . ']</b></small></span>'; } // Если есть прикрепленный файл, выводим его описание $freq = mysql_query("SELECT * FROM `cms_forum_files` WHERE `post` = '" . $res['id'] . "'"); if (mysql_num_rows($freq) > 0) { $fres = mysql_fetch_assoc($freq); $fls = round(@filesize('../files/forum/attach/' . $fres['filename']) / 1024, 2); echo '<br /><span class="gray">' . $lng_forum['attached_file'] . ':'; // Предпросмотр изображений $att_ext = strtolower(functions::format('./files/forum/attach/' . $fres['filename'])); $pic_ext = array('gif', 'jpg', 'jpeg', 'png'); if (in_array($att_ext, $pic_ext)) { echo '<div><a href="index.php?act=file&id=' . $fres['id'] . '">'; echo '<img src="thumbinal.php?file=' . urlencode($fres['filename']) . '" alt="' . $lng_forum['click_to_view'] . '" /></a></div>'; } else { echo '<br /><a href="index.php?act=file&id=' . $fres['id'] . '">' . $fres['filename'] . '</a>';
/* ----------------------------------------------------------------- Список постов Форума ----------------------------------------------------------------- */ $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&user='******'id'] . '&', $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&id=' . $res['id'] . '"> >></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 ? '&mod=' . $mod : '') . '&user='******'id'] . '&', $start, $total, $kmess) . '</div>' . '<p><form action="profile.php?act=activity&user='******'id'] . ($mod ? '&mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; }
function time_parce($var) { return functions::display_date($var[1]); }
} else { // Для гостей обрабатываем имя и фильтруем ссылки $res['name'] = functions::checkout($res['name']); $post = functions::antilink(functions::checkout($res['text'], 0, 2)); } if ($res['edit_count']) { // Если пост редактировался, показываем кем и когда $post .= '<br /><span class="gray"><small>Изм. <b>' . $res['edit_who'] . '</b> (' . functions::display_date($res['edit_time']) . ') <b>[' . $res['edit_count'] . ']</b></small></span>'; } if (!empty($res['otvet'])) { // Ответ Администрации $otvet = functions::checkout($res['otvet'], 1, 1); if ($set_user['smileys']) { $otvet = functions::smileys($otvet, 1); } $post .= '<div class="reply"><b>' . $res['admin'] . '</b>: (' . functions::display_date($res['otime']) . ')<br/>' . $otvet . '</div>'; } if ($rights >= 6) { $subtext = '<a href="index.php?act=otvet&id=' . $res['gid'] . '">' . $lng['reply'] . '</a>' . ($rights >= $res['rights'] ? ' | <a href="index.php?act=edit&id=' . $res['gid'] . '">' . $lng['edit'] . '</a> | <a href="index.php?act=delpost&id=' . $res['gid'] . '">' . $lng['delete'] . '</a>' : ''); } else { $subtext = ''; } $arg = array('header' => $text, 'body' => '<div class="textx">' . $post . '</div>', 'sub' => $subtext); echo functions::display_user($res, $arg); echo '</div>'; } } else { echo '<div class="menu"><p>' . $lng['guestbook_empty'] . '</p></div>'; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>'; if ($total > $kmess) {
} if (isset($_GET['all'])) { $req = mysql_query("SELECT `id` FROM `lib` WHERE `type` = 'bk' AND `moder` = '0'"); while ($res = mysql_fetch_array($req)) { mysql_query("UPDATE `lib` SET `moder` = '1', `time` = '" . time() . "' WHERE `id` = '" . $res['id'] . "'"); } echo '<p>' . $lng_lib['added_all'] . '</p>'; } $req = mysql_query("SELECT COUNT(*) FROM `lib` WHERE `type` = 'bk' AND `moder` = '0'"); $total = mysql_result($req, 0); if ($total > 0) { $req = mysql_query("SELECT * FROM `lib` WHERE `type` = 'bk' AND `moder` = '0' LIMIT " . $start . "," . $kmess); while ($res = mysql_fetch_array($req)) { echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; $tx = $res['soft']; echo "<a href='index.php?id=" . $res['id'] . "'>{$res['name']}</a><br/>" . $lng_lib['added'] . ": {$res['avtor']} (" . functions::display_date($res['time']) . ")<br/>{$tx} <br/>"; $nadir = $res['refid']; $pat = ""; while ($nadir != "0") { $dnew = mysql_query("select `id`, `refid`, `text` from `lib` 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}]<br/><a href='index.php?act=moder&id=" . $res['id'] . "&yes'> " . $lng_lib['approve'] . "</a></div>"; ++$i; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>'; if ($total > $kmess) {
echo '<a href="index.php?id=' . $cat1['id'] . '">' . $cat1['text'] . '</a>(' . $kol . ')</div>'; ++$i; } echo '<div class="phdr">' . $lng['total'] . ': ' . $totalcat . '</div>'; } elseif ($totalbk > 0) { $total = $totalbk; if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&', $start, $total, $kmess) . '</div>'; } $bk = mysql_query("select * from `lib` where type = 'bk' and refid = '" . $id . "' and moder='1' order by `time` desc LIMIT " . $start . "," . $kmess); $i = 0; while ($bk1 = mysql_fetch_array($bk)) { echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; echo '<b><a href="index.php?id=' . $bk1['id'] . '">' . htmlentities($bk1['name'], ENT_QUOTES, 'UTF-8') . '</a></b><br/>'; echo htmlentities($bk1['announce'], ENT_QUOTES, 'UTF-8'); echo '<div class="sub"><span class="gray">' . $lng_lib['added'] . ':</span> ' . $bk1['avtor'] . ' (' . functions::display_date($bk1['time']) . ')<br />'; echo '<span class="gray">' . $lng_lib['reads'] . ':</span> ' . $bk1['count'] . '</div></div>'; ++$i; } echo '<div class="phdr">' . $lng['total'] . ': ' . $totalbk . '</div>'; } else { $total = 0; } // Навигация по страницам if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&', $start, $total, $kmess) . '</div>' . '<p><form action="index.php" method="get"><input type="hidden" name="id" value="' . $id . '"/><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>'; } echo '<p>'; if (($rights == 5 || $rights >= 6) && $id != 0) { $ct = mysql_query("select `id` from `lib` where type='cat' and refid='" . $id . "'"); $ct1 = mysql_num_rows($ct);
$imagnam = "temp/{$namefile}.png"; imagePng($im1, $imagnam, $quality); echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; } imagedestroy($im); imagedestroy($im1); $fotsz = filesize("foto/{$ms['name']}"); $fotsz = round($fotsz / 1024, 2); $sizs = GetImageSize("foto/{$ms['name']}"); $fwidth = $sizs[0]; $fheight = $sizs[1]; echo "<p>" . $lng['description'] . ": {$ms['text']}<br/>"; echo $lng_gal['dimensions'] . ": {$fwidth}*{$fheight} пкс.<br/>"; echo $lng_gal['weight'] . ": {$fotsz} кб.<br/>"; echo $lng['date'] . ': ' . functions::display_date($ms['time']) . '<br/>'; echo $lng_gal['posted_by'] . ": {$ms['avtor']}<br/>"; echo "<a href='foto/{$ms['name']}'>" . $lng['download'] . "</a><br /><br />"; echo "<a href='index.php?id=" . $ms['refid'] . "'>" . $lng['back'] . "</a><br/>"; echo "<a href='index.php'>" . $lng_gal['to_gallery'] . "</a></p>"; break; default: header("location: index.php"); break; } } else { /* ----------------------------------------------------------------- Главная страница Галлереи ----------------------------------------------------------------- */
break; case 5: echo ' Mod '; break; 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&id=" . $mass['id'] . "'>" . $lng['delete'] . "</a>"; } echo '</div>'; ++$i; } echo '<div class="phdr">' . $lng['total'] . ': ' . $countm . '</div>'; // Навигация по страницам if ($countm > $kmess) {
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"/> ' . '<a href="' . htmlspecialchars($res['link']) . '">' . htmlspecialchars($res['link']) . '</a> [' . $res['count'] . ']<br />' . $name . '</p>'; $menu = array('<a href="index.php?act=ads&mod=up&id=' . $res['id'] . '">' . $lng['up'] . '</a>', '<a href="index.php?act=ads&mod=down&id=' . $res['id'] . '">' . $lng['down'] . '</a>', '<a href="index.php?act=ads&mod=edit&id=' . $res['id'] . '">' . $lng['edit'] . '</a>', '<a href="index.php?act=ads&mod=del&id=' . $res['id'] . '">' . $lng['delete'] . '</a>', '<a href="index.php?act=ads&mod=show&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> ' . $array_placing[$res['layout']] . '<br />' . '<span class="gray">' . $lng['to_show'] . ':</span> ' . $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);
if (mb_strlen($last_msg['text']) > 500) { $text = mb_substr($last_msg['text'], 0, 500); $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text, $res['rights'] ? 1 : 0); } $text = bbcode::notags($text); $text .= '...<a href="index.php?act=write&id=' . $row['id'] . '">' . $lng['continue'] . ' >></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&id=' . $row['id'] . '"><b>' . $lng_mail['correspondence'] . '</b></a> (' . $count_message . ') | <a href="index.php?act=ignor&id=' . $row['id'] . '&add">Игнор</a> | <a href="index.php?act=deluser&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&', $start, $total, $kmess) . '</div>' . '<p><form action="index.php" method="get"> <input type="hidden" name="act" value="input"/>
$out .= '<div class="list1">'; } } if ($row['read'] == 0 && $row['from_id'] == $user_id) { $mass_read[] = $row['mid']; } $post = $row['text']; $post = functions::checkout($post, 1, 1); if ($set_user['smileys']) { $post = functions::smileys($post, $row['rights'] >= 1 ? 1 : 0); } if ($row['file_name']) { $post .= '<div class="func">' . $lng_mail['file'] . ': <a href="index.php?act=load&id=' . $row['mid'] . '">' . $row['file_name'] . '</a> (' . formatsize($row['size']) . ')(' . $row['count'] . ')</div>'; } $subtext = '<a href="index.php?act=delete&id=' . $row['mid'] . '">' . $lng['delete'] . '</a>'; $arg = array('header' => '(' . functions::display_date($row['mtime']) . ')', 'body' => $post, 'sub' => $subtext, 'stshide' => 1); core::$user_set['avatar'] = 0; $out .= functions::display_user($row, $arg); $out .= '</div>'; ++$i; } //Ставим метку о прочтении if ($mass_read) { $result = implode(',', $mass_read); mysql_query("UPDATE `cms_mail` SET `read`='1' WHERE `from_id`='{$user_id}' AND `id` IN (" . $result . ")"); } } else { $out .= '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>'; } $out .= '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>'; if ($total > $kmess) {