Thằng share code này chơi xỏ ý mà ![]()
Ai sửa giúp mình code đăng bài viết dùm nhá ![]()
Phiền mọi người tí ... ![]()
PHP
<?php /** * @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 */ define('_IN_JOHNCMS', 1); require('../incfiles/core.php'); $lng_forum = core::load_lng('forum'); if (isset($_SESSION['ref'])) unset($_SESSION['ref']); /* ----------------------------------------------------------------- ÐаÑтройки форума ----------------------------------------------------------------- */ $set_forum = $user_id && !empty($datauser['set_forum']) ? unserialize($datauser['set_forum']) : array( 'farea' => 0, 'upfp' => 0, 'preview' => 1, 'postclip' => 1, 'postcut' => 2 ); // mod $error = ''; if (!$set['mod_forum'] && $rights < 7) $error = $lng_forum['forum_closed']; elseif ($set['mod_forum'] == 1 && !$user_id) $error = $lng['access_guest_forbidden']; if ($error) { require('../incfiles/head.php'); echo '<div class="rmenu"><p>' . $error . '</p></div>'; require('../incfiles/end.php'); exit; } $headmod = $id ? 'forum,' . $id : 'forum'; // Заголовки Ñтраниц форума if (empty($id)) { $textl = '' . $lng['forum'] . ''; } else { $req = mysql_query("SELECT `text` FROM `forum` WHERE `id`= '" . $id . "'"); $res = mysql_fetch_assoc($req); $textl = $res['text']; } // Переключаем режимы работы $mods = array( 'addvote', 'close', 'deltema', 'delvote', 'editpost', 'editvote', 'loadtem', 'massdel', 'new', 'nt', 'per', 'post', 'ren', 'restore', 'say', 'tema', 'users', 'vip', 'vote', 'who', 'curators' ); if ($act && ($key = array_search($act, $mods)) !== false && file_exists('includes/' . $mods[$key] . '.php')) { require('includes/' . $mods[$key] . '.php'); } else { require('../incfiles/head.php'); // ЕÑли форум закрыт, то Ð´Ð»Ñ Ðдминов выводим напоминание if (!$set['mod_forum']) echo '<div class="alarm">' . $lng_forum['forum_closed'] . '</div>'; elseif ($set['mod_forum'] == 3) echo '<div class="rmenu">' . $lng['read_only'] . '</div>'; if (!$user_id) { if (isset($_GET['newup'])) $_SESSION['uppost'] = 1; if (isset($_GET['newdown'])) $_SESSION['uppost'] = 0; } if ($id) { // ОпределÑем тип запроÑа (каталог, или тема) $type = mysql_query("SELECT * FROM `forum` WHERE `id`= '$id'"); if (!mysql_num_rows($type)) { // ЕÑли темы не ÑущеÑтвует, показываем ошибку echo functions::display_error($lng_forum['error_topic_deleted'], '<a href="index.php">' . $lng['to_forum'] . '</a>'); require('../incfiles/end.php'); exit; } $type1 = mysql_fetch_assoc($type); // ФикÑÐ°Ñ†Ð¸Ñ Ñ„Ð°ÐºÑ‚Ð° Ð¿Ñ€Ð¾Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð¢Ð¾Ð¿Ð¸ÐºÐ° if ($user_id && $type1['type'] == 't') { $req_r = mysql_query("SELECT * FROM `cms_forum_rdm` WHERE `topic_id` = '$id' AND `user_id` = '$user_id' LIMIT 1"); if (mysql_num_rows($req_r)) { $res_r = mysql_fetch_assoc($req_r); if ($type1['time'] > $res_r['time']) mysql_query("UPDATE `cms_forum_rdm` SET `time` = '" . time() . "' WHERE `topic_id` = '$id' AND `user_id` = '$user_id' LIMIT 1"); } else { mysql_query("INSERT INTO `cms_forum_rdm` SET `topic_id` = '$id', `user_id` = '$user_id', `time` = '" . time() . "'"); } } // Получаем Ñтруктуру форума $res = true; $allow = 0; $parent = $type1['refid']; while ($parent != '0' && $res != false) { $req = mysql_query("SELECT * FROM `forum` WHERE `id` = '$parent' LIMIT 1"); $res = mysql_fetch_assoc($req); if ($res['type'] == 'f' || $res['type'] == 'r') { $tree[] = '<li><span><a href="index.php?id=' . $parent . '">' . $res['text'] . '</a></span></li>'; if ($res['type'] == 'r' && !empty($res['edit'])) { $allow = intval($res['edit']); } } $parent = $res['refid']; } krsort($tree); if ($type1['type'] != 't' && $type1['type'] != 'm') $tree[] =' ' . $type1['text'] . ''; // Выводим верхнюю панель навигации echo '<ul class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#">' . functions::display_menu($tree) . '</ul>'; switch ($type1['type']) { case 'f': //////////////////////////////////////////////////////////// // СпиÑок разделов форума // //////////////////////////////////////////////////////////// $req = mysql_query("SELECT `id`, `text`, `soft`, `edit` FROM `forum` WHERE `type`='r' AND `refid`='$id' ORDER BY `realid`"); $total = mysql_num_rows($req); if ($total) { $i = 0; while (($res = mysql_fetch_assoc($req)) !== false) { echo '<div class="list-login" style="padding:6px 3px;line-height:1.9;">'; $coltem = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `refid` = '" . $res['id'] . "'"), 0); echo '<a href="?id=' . $res['id'] . '">' . $res['text'] . '</a>'; if ($coltem) echo " [$coltem]"; if (!empty($res['soft'])) echo '<span class="menu">' . $res['soft'] . '</span>'; echo '</div>'; ++$i; } unset($_SESSION['fsort_id']); unset($_SESSION['fsort_users']); } else { echo '<div class="phdr"><p><span class="fa fa-comments"></i> ' . $lng_forum['section_list_empty'] . '</p></div>'; } echo '<div class="menu"><small>Tất cả: ' . $total . '</small></div>'; break; case 'r': //////////////////////////////////////////////////////////// // СпиÑок топиков // //////////////////////////////////////////////////////////// $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='t' AND `refid`='$id'" . ($rights >= 7 ? '' : " AND `close`!='1'")), 0); if (($user_id && !isset($ban['1']) && !isset($ban['11']) && $set['mod_forum'] != 4) || core::$user_rights) { // Кнопка ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð½Ð¾Ð²Ð¾Ð¹ темы echo '<div class="menu"><form action="index.php?act=nt&id=' . $id . '" method="post"><input type="submit" value="' . $lng_forum['new_topic'] . '" /></form></div>'; } if ($total) { $req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " AND `refid`='$id' ORDER BY `vip` DESC, `time` DESC LIMIT $start, $kmess"); $i = 0; while (($res = mysql_fetch_assoc($req)) !== false) { if ($res['close']) echo '<div class="menu">'; else echo '<div class="list-login" style="padding:6px 3px;line-height:1.9;">'; $nikuser = mysql_query("SELECT `from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` DESC LIMIT 1"); $nam = mysql_fetch_assoc($nikuser); $colmes = mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")); $colmes1 = mysql_result($colmes, 0); $cpg = ceil($colmes1 / $kmess); echo '<a href="index.php?id=' . $res['id'] . '"><i class="fa fa-bookmark"></i> ' . $res['text'] . '</a> '; if ($cpg > 1) { echo '<a href="' . $home . '/'.rw($res['text']).'_p' . $cpg . '.html#' . $colmes1 . '"> >></a>'; } echo'</p><small>'; echo $res['from']; if (!empty($nam['from'])) { echo ' / ' . $nam['from']; echo '</small>'; } echo ' <span class="gray"><small>('.timepost($res['time']).')</small></span></div>'; ++$i; } unset($_SESSION['fsort_id']); unset($_SESSION['fsort_users']); } else { echo '<div class="menu"><p>' . $lng_forum['topic_list_empty'] . '</p></div>'; } echo '<div class="phdr"> Tổng: ' . $total . '</div>'; if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&', $start, $total, $kmess) . '</div>'; } break; case 't': //////////////////////////////////////////////////////////// // Показываем тему Ñ Ð¿Ð¾Ñтами // //////////////////////////////////////////////////////////// $filter = isset($_SESSION['fsort_id']) && $_SESSION['fsort_id'] == $id ? 1 : 0; $sql = ''; if ($filter && !empty($_SESSION['fsort_users'])) { // Подготавливаем Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð° фильтрацию юзеров $sw = 0; $sql = ' AND ('; $fsort_users = unserialize($_SESSION['fsort_users']); foreach ($fsort_users as $val) { if ($sw) $sql .= ' OR '; $sortid = intval($val); $sql .= "`forum`.`user_id` = '$sortid'"; $sw = 1; } $sql .= ')'; } // ЕÑли тема помечена Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ, разрешаем доÑтуп только админиÑтрации if ($rights < 6 && $type1['close'] == 1) { echo '<div class="rmenu"><p>' . $lng_forum['topic_deleted'] . '<br/><a href="' . $home . '/'.rw($type1['text']).'_' . $type1['refid'] . '.html">' . $lng_forum['to_section'] . '</a></p></div>'; require('../incfiles/end.php'); exit; } ///////// Mod thank cho forum //////// ///Thanks submit đê $checkthankdau = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $_GET['thanks'] . '" and `user` = "' . $_GET['user'] . '"'); if ($user_id && $user_id != $_GET['user'] && (mysql_result($checkthankdau, 0) < 1)) { if ((isset($_GET['thank'])) && (isset($_GET['user'])) && (isset($_GET['thanks']))) ////mod thong bao like $tong=mysql_result(mysql_query("select count(*) from forum where refid = '{$_GET['id']}' and type='m' order by time desc"),0); $sotrang=ceil($tong/$kmess); mysql_query("INSERT INTO `thongbao` SET `id_from`='".$user_id."', `id_to` = '".$_GET['user']."', `hanhdong`='1', `id_forum`='".$_GET['id']."', `text` = '".$sotrang."|".$_GET['thanks']."', `type`='f', `time` = '" . time() . "' "); /////ket thuc thong bao like { mysql_query("INSERT INTO `forum_thank` SET `user` = '" . trim($_GET['user']) . "', `topic` = '" . trim($_GET['thanks']) . "' , `time` = '$realtime', `userthank` = '$user_id', `chude` = '" . $_GET["id"] . "' "); $congcamon = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . trim($_GET['user']) . '"')); mysql_query("UPDATE `users` SET `thank_duoc`='" . ($congcamon['thank_duoc'] + 1) . "' WHERE `id` = '" . trim($_GET['user']) . "'"); mysql_query("UPDATE `users` SET `thank_di`='" . ($datauser['thank_di'] + 1) . "' WHERE `id` = '" . $user_id . "'"); } } // Bá» thÃch if ((isset($_GET['unthank'])) && (isset($_GET['user'])) && (isset($_GET['unthanks']))) { $checkthank = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $_GET['unthanks'] . '" and `user` = "' . $_GET['user'] . '"'); $thankcheck = mysql_result($checkthank, 0); if ($thankcheck > 0 && $user_id != $_GET['user']) { mysql_query("DELETE FROM `forum_thank` WHERE `user` = '" . trim($_GET['user']) . "' AND `userthank` = '$user_id' AND `topic` = '" . trim($_GET['unthanks']) . "'"); mysql_query("OPTIMIZE TABLE `forum_thank`"); $datathankuser = functions::get_user(trim($_GET['user'])); mysql_query("UPDATE `users` SET `thank_duoc`='" . ($datathankuser['thank_duoc'] - 1) . "' WHERE `id` = '" . trim($_GET['user']) . "'"); mysql_query("UPDATE `users` SET `thank_di`='" . ($datauser['thank_di'] - 1) . "' WHERE `id` = '" . $user_id . "'"); } } ///////// kết thúc like //////// // Счетчик поÑтов темы $colmes = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m'$sql AND `refid`='$id'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0); if ($start >= $colmes) { // ИÑправлÑем Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð° неÑущеÑтвующую Ñтраницу $start = max(0, $colmes - (($colmes % $kmess) == 0 ? $kmess : ($colmes % $kmess))); } // Выводим название топика echo '<div class="menu" style="line-height:1.9;"><big><b><font color="black">' . $type1['text'] . '</font></b> </big>- ' . $colmes . ' view</div>'; // Метка ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ Ñ‚ÐµÐ¼Ñ‹ if ($type1['close']) { echo '<div class="rmenu">' . $lng_forum['topic_delete_who'] . ': <b>' . $type1['close_who'] . '</b></div>'; } elseif (!empty($type1['close_who']) && $rights >= 7) { echo '<div class="gmenu"><small>' . $lng_forum['topic_delete_whocancel'] . ': <b>' . $type1['close_who'] . '</b></small></div>'; } // Метка Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ñ‚ÐµÐ¼Ñ‹ if ($type1['edit']) { echo '<div class="rmenu">' . $lng_forum['topic_closed'] . '</div>'; } // Блок голоÑований if ($type1['realid']) { $clip_forum = isset($_GET['clip']) ? '&clip' : ''; $vote_user = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_vote_users` WHERE `user`='$user_id' AND `topic`='$id'"), 0); $topic_vote = mysql_fetch_assoc(mysql_query("SELECT `name`, `time`, `count` FROM `cms_forum_vote` WHERE `type`='1' AND `topic`='$id' LIMIT 1")); echo '<div class="gmenu"><b>' . functions::checkout($topic_vote['name']) . '</b><br />'; $vote_result = mysql_query("SELECT `id`, `name`, `count` FROM `cms_forum_vote` WHERE `type`='2' AND `topic`='" . $id . "' ORDER BY `id` ASC"); if (!$type1['edit'] && !isset($_GET['vote_result']) && $user_id && $vote_user == 0) { // Выводим форму Ñ Ð¾Ð¿Ñ€Ð¾Ñами echo '<form action="index.php?act=vote&id=' . $id . '" method="post">'; while (($vote = mysql_fetch_assoc($vote_result)) !== false) { echo '<input type="radio" value="' . $vote['id'] . '" name="vote"/> ' . functions::checkout($vote['name'], 0, 1) . '<br />'; } echo '<p><input type="submit" name="submit" value="' . $lng['vote'] . '"/><br /><a href="index.php?id=' . $id . '&start=' . $start . '&vote_result' . $clip_forum . '">' . $lng_forum['results'] . '</a></p></form></div>'; } else { // Выводим результаты голоÑÐ¾Ð²Ð°Ð½Ð¸Ñ echo '<small>'; while (($vote = mysql_fetch_assoc($vote_result)) !== false) { $count_vote = $topic_vote['count'] ? round(100 / $topic_vote['count'] * $vote['count']) : 0; echo functions::checkout($vote['name'], 0, 1) . ' [' . $vote['count'] . ']<br />'; echo '<img src="vote_img.php?img=' . $count_vote . '" alt="' . $lng_forum['rating'] . ': ' . $count_vote . '%" /><br />'; } echo '</small></div><div class="bmenu">' . $lng_forum['total_votes'] . ': '; if (core::$user_rights > 6) echo '<a href="index.php?act=users&id=' . $id . '">' . $topic_vote['count'] . '</a>'; else echo $topic_vote['count']; echo '</div>'; if ($user_id && $vote_user == 0) echo '<div class="bmenu"><a href="index.php?id=' . $id . '&start=' . $start . $clip_forum . '">' . $lng['vote'] . '</a></div>'; } } // Получаем данные о кураторах темы $curators = !empty($type1['curators']) ? unserialize($type1['curators']) : array(); $curator = false; if ($rights < 6 && $rights != 3 && $user_id) { if (array_key_exists($user_id, $curators)) $curator = true; } // ФикÑÐ°Ñ†Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ поÑта в теме if (($set_forum['postclip'] == 2 && ($set_forum['upfp'] ? $start < (ceil($colmes - $kmess)) : $start > 0)) || isset($_GET['clip'])) { $postreq = mysql_query("SELECT `forum`.*, `users`.`sex`, `users`.`rights`, `users`.`lastdate`, `users`.`status`, `users`.`status`, `users`.`datereg` FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id` WHERE `forum`.`type` = 'm' AND `forum`.`refid` = '$id'" . ($rights >= 7 ? "" : " AND `forum`.`close` != '1'") . " ORDER BY `forum`.`id` LIMIT 1"); $postres = mysql_fetch_assoc($postreq); echo '<div class="topmenu"><p>'; if ($postres['sex']) echo '<img src="../theme/' . $set_user['skin'] . '/images/' . ($postres['sex'] == 'm' ? 'm' : 'w') . ($postres['datereg'] > time() - 86400 ? '_new.png" width="14"' : '.png" width="10"') . ' height="10"/> '; else echo '<img src="../images/del.png" width="10" height="10" alt=""/> '; if ($user_id && $user_id != $postres['user_id']) { echo '<a href="../users/profile.php?user=' . $postres['user_id'] . '&fid=' . $postres['id'] . '"><b>' . $postres['from'] . '</b></a> ' . '<a href="index.php?act=say&id=' . $postres['id'] . '&start=' . $start . '"> ' . $lng_forum['reply_btn'] . '</a> ' . '<a href="index.php?act=say&id=' . $postres['id'] . '&start=' . $start . '&cyt"> ' . $lng_forum['cytate_btn'] . '</a> '; } else { echo '<b>' . $postres['from'] . '</b> '; } $user_rights = array( 3 => '(FMod)', 6 => '(Smd)', 7 => '(Adm)', 9 => '(SV!)' ); echo @$user_rights[$postres['rights']]; echo(time() > $postres['lastdate'] + 300 ? '<span class="red"> [Off]</span>' : '<span class="green"> [ON]</span>'); echo ' <span class="gray">(' . functions::display_date($postres['time']) . ')</span><br/>'; if ($postres['close']) { echo '<span class="red">' . $lng_forum['post_deleted'] . '</span><br/>'; } echo functions::checkout(mb_substr($postres['text'], 0, 500), 0, 2); if (mb_strlen($postres['text']) > 500) echo '...<a href="index.php?act=post&id=' . $postres['id'] . '">' . $lng_forum['read_all'] . '</a>'; echo '</p></div>'; } // ПамÑтка, что включен фильтр if ($filter) { echo '<div class="rmenu">' . $lng_forum['filter_on'] . '</div>'; } // Задаем правила Ñортировки (новые внизу / вверху) if ($user_id) { $order = $set_forum['upfp'] ? 'DESC' : 'ASC'; } else { $order = ((empty($_SESSION['uppost'])) || ($_SESSION['uppost'] == 0)) ? 'ASC' : 'DESC'; } //////////////////////////////////////////////////////////// // ОÑновной Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð² базу, получаем ÑпиÑок поÑтов темы // //////////////////////////////////////////////////////////// $req = mysql_query(" SELECT `forum`.*, `users`.`sex`, `users`.`rights`, `users`.`lastdate`, `users`.`status`, `users`.`danhhieu`, `users`.`datereg` , `users`.`datereg` FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id` WHERE `forum`.`type` = 'm' AND `forum`.`refid` = '$id'" . ($rights >= 7 ? "" : " AND `forum`.`close` != '1'") . "$sql ORDER BY `forum`.`id` $order LIMIT $start, $kmess "); // Верхнее поле "ÐапиÑать" if (($user_id && !$type1['edit'] && $set_forum['upfp'] && $set['mod_forum'] != 3 && $allow != 4) || ($rights >= 7 && $set_forum['upfp'])) { echo '<div class="gmenu"><form name="form1" action="index.php?act=say&id=' . $id . '" method="post">'; if ($set_forum['farea']) { $token = mt_rand(1000, 100000); $_SESSION['token'] = $token; echo '<p>' . bbcode::auto_bb('form1', 'msg') . '<textarea rows="' . $set_user['field_h'] . '" name="msg"></textarea></p>' . '<p><input type="checkbox" name="addfiles" value="1" /> ' . $lng_forum['add_file'] . ($set_user['translit'] ? '<br /><input type="checkbox" name="msgtrans" value="1" /> ' . $lng['translit'] : '') . '</p><p><input type="submit" name="submit" value="' . $lng['write'] . '" style="width: 107px; cursor: pointer;"/> ' . (isset($set_forum['preview']) && $set_forum['preview'] ? '<input type="submit" value="' . $lng['preview'] . '" style="width: 107px; cursor: pointer;"/>' : '') . '<input type="hidden" name="token" value="' . $token . '"/>' . '</p></form></div>'; } else { echo '<p><input type="submit" name="submit" value="' . $lng['write'] . '"/></p></form></div>'; } } $i = 1; //////////////////////////////////////////////////////////// // ОÑновной ÑпиÑок поÑтов // //////////////////////////////////////////////////////////// while (($res = mysql_fetch_assoc($req)) !== false) { // Фон поÑта if ($res['close']) { echo '<div class="rmenu">'; } else { echo '<div class="box_info_cmt" style="line-height:1.9;">'; } // ПользовательÑкий аватар if ($set_user['avatar']) { echo '<table cellpadding="0" cellspacing="0"><tr><td>'; if (file_exists(('../files/users/avatar/' . $res['user_id'] . '.png'))) echo '<img class="avatar" style="border:1px solid #D7EDFC" src="../files/users/avatar/' . $res['user_id'] . '.png" width="60" height="60" alt="' . $res['from'] . '" /> '; else echo '<img src="../images/empty.png" width="50" height="50" alt="' . $res['from'] . '" /> '; echo '</td><td>'; } // Ðик юзера и ÑÑылка на его анкету echo(time() > $res['lastdate'] + 300 ? '<font color="gray"><i class="fa fa-mobile"></i></font> ' : '<font color="green"><i class="fa fa-mobile"></i></font> '); if ($user_id) { echo '<a href="../users/profile.php?user=' . $res['user_id'] . '"><b>'.nick($res['user_id']).'</b></a> '; } else { echo '<b>'.nick($res['user_id']).'</b> '; } // Метка должноÑти $user_rights = array( 3 => '(FMod)', 6 => '(Smd)', 7 => '(Adm)', 9 => '(SV!)' ); echo(isset($user_rights[$res['rights']]) ? $user_rights[$res['rights']] : ''); // Закрываем таблицу Ñ Ð°Ð²Ð°Ñ‚Ð°Ñ€Ð¾Ð¼ $like = $res['thank_duoc']*1; if ($like >= 0 && $like <50) { $thank = '♥'; } if ($like >= 50 && $like <100) { $thank = '♥♥'; } if ($like >= 100 && $like <200) { $thank = '♥♥♥'; } if ($like >= 200 && $like <500) { $thank = '♥♥♥♥'; } if ($like >= 500 && $like <1000) { $thank = '♥♥♥♥♥'; } if ($like >= 1000 && $like <1700) { $thank = '♥♥♥♥♥♥'; } if ($like >= 1500) { $thank = '<b>[VIP]</b>'; } include ('lv.php'); echo '<br /> '.$chucdanh.' <font color="red"><b>' . $thank . '</b></font>'; if (!empty($res['danhhieu'])) { echo '<div class="status"><b style="color:#860086;"><i class="fa fa-heart"></i> ' . $res['danhhieu'] . '</b></div>'; } if (!empty($res['status'])) { echo '<b style="color:#cd853f;"><div class="status"><small><b><i class="fa fa-star"></i> ' . $res['status'] . '</b></small></div>'; } if ($set_user['avatar']) { echo '</td></tr></table>'; } echo '<div class="text_cmt""><small><div style="margin-bottom:5px;color:#BBBBBB;"><i class="fa fa-clock-o"></i> '.timepost($res['time']).'</small>'; //hiện # echo'<small>'; if($i == 1) { echo '<div style="float:right;">#1</div>'; } else { echo '<div style="float:right;"># '.($i).'</div>'; } echo '</small></div></div>'; //////////////////////////////////////////////////////////// // Вывод текÑта поÑта // //////////////////////////////////////////////////////////// echo'<font color="black">'; $text = $res['text']; $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text, $res['rights'] ? 1 : 0); } echo $text; echo'</font>'; if ($user_id && $user_id != $res['user_id']) { echo '<br/><a href="index.php?act=say&id=' . $res['id'] . '&start=' . $start . '"></a> ' . '<div class="right"><a href="index.php?act=say&id=' . $res['id'] . '&start=' . $start . '&cyt"><i class="fa fa-reply"></i> Trả lá»i</a></div>'; //--------Nut Likes------// $demthank = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_thank` WHERE `topic`='" . $res["id"] . "'"), 0); if ($user_id && $user_id != $res['user_id']) { $checkthank = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $res['id'] . '" and `user` = "' . $res['user_id'] . '"'); echo (mysql_result($checkthank, 0) == 1 ? '<a class="button-like" href="index.php?id=' . $id . '&unthanks=' . $res['id'] . '&user=' . $res['user_id'] . '&start=' . $start . '&unthank#' . $res['id'] . '">Bá» ThÃch</a>  ' : ' '); // Bá» thÃch if (mysql_result($checkthank, 0) < 1) { echo '<a class="button-like" href="index.php?id=' . $id . '&thanks=' . $res['id'] . '&user=' . $res['user_id'] . '&start=' . $start . '&page=' . $page . '&thank#' . $res['id'] . '">ThÃch</a>'; // ThÃch } } } // ЕÑли поÑÑ‚ редактировалÑÑ, показываем кем и когда if ($res['kedit']) { echo '<br /><span class="gray"><small><i class="fa fa-pencil-square-o"></i> ' . $res['edit'] . ' đã sá»a (' . $res['kedit'] . ') - <i class="fa fa-calendar"></i> '.timepost($res['tedit']).'</small></span>'; } // СÑылки на редактирование / удаление поÑтов if ( (($rights2 == 3 || $rights2 >= 6 || $rights == 3 || $rights >= 6 || $curator) && $rights >= $res['rights']) || ($res['user_id'] == $user_id && !$set_forum['upfp'] && $res['time'] > time() - 5000) || ($res['user_id'] == $user_id && $set_forum['upfp'] && $start == 0 && $i == 1 && $res['time'] > time() - 5000) || ($i == 1 && $allow == 2 && $res['user_id'] == $user_id) ) { // СÑылки на редактирование / удаление поÑтов echo '<br />'; $menu = array('<a href="index.php?act=editpost&id=' . $res['id'] . '"><small>Sá»a</small></a>','<a href="index.php?act=addfile&id='.$res['id'].'"><small>Upload</small></a>', ($rights >= 7 && $res['close'] == 1 ? '<a href="index.php?act=editpost&do=restore&id=' . $res['id'] . '">' . $lng_forum['restore'] . '</a>' : ''), ($res['close'] == 1 ? '' : '<a href="index.php?act=editpost&do=del&id=' . $res['id'] . '"><small>Xoá</small></a>') ); echo '</small>'; echo functions::display_menu($menu); // Показываем, кто удалил поÑÑ‚ if ($res['close']) { echo '<div class="red">' . $lng_forum['who_delete_post'] . ': <b>' . $res['close_who'] . '</b></div>'; } elseif (!empty($res['close_who'])) { echo '<div class="green">' . $lng_forum['who_restore_post'] . ': <b>' . $res['close_who'] . '</b></div>'; } } // Thong Ke So Nguoi Thank $thongkethank = mysql_query("SELECT COUNT(*) from `forum_thank` where `topic`='" . $res["id"] . "'"); $thongkethanks = mysql_result($thongkethank, 0); // $thongkethanks=mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `topic` = "' . $res['id'] . '"')), 0); $thongkea= @mysql_query("select * from `forum_thank` where `topic` = '" . $res['id'] . "'"); $thongke=mysql_fetch_array($thongkea); $idthongke=trim($_GET['idthongke']); if($thongkethanks>0&&(empty($_GET['idthongke']))) { echo'<div class="like"><div id="'.$idthongke.'"><button class="button_like" type="button"><i class="fa fa-heart"></i> '.$thongkethanks.'</button> '; $thongkeaa = @mysql_query("select * from `forum_thank` where `topic` = '" . $res['id'] . "'");while ($thongkea = mysql_fetch_array($thongkeaa)) { { $dentv=mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$thongkea['userthank'].'"')); $mkingly = mysql_query('select `rights` from `users` where id="'.$thongkea['userthank'].'"'); echo ' <a href="'.$home.'/users/profile.php?user='.$thongkea['userthank'].'">'.nick($thongkea['userthank']).'</a>, '; } ++$f; } echo ' thÃch Ä‘iá»u nà y!</div></div>'; } echo '</div>'; ++$i; } // Ðижнее поле "ÐапиÑать" echo '</p>'; if (($user_id && !$type1['edit'] && !$set_forum['upfp'] && $set['mod_forum'] != 3 && $allow != 4) || ($rights >= 7 && !$set_forum['upfp'])) { echo '<div class="menu"><form name="form2" action="index.php?act=say&id=' . $id . '" method="post">'; if ($set_forum['farea']) { $token = mt_rand(1000, 100000); $_SESSION['token'] = $token; echo '<p>'; echo bbcode::auto_bb('form2', 'msg'); echo '<textarea rows="' . $set_user['field_h'] . '" name="msg"></textarea><br/></p>' . '<p><input type="checkbox" name="addfiles" value="1" /> ' . $lng_forum['add_file']; if ($set_user['translit']) echo '<br /><input type="checkbox" name="msgtrans" value="1" /> ' . $lng['translit']; echo '</p><p><input type="submit" name="submit" value="' . $lng['write'] . '" style="width: 107px; cursor: pointer;"/> ' . (isset($set_forum['preview']) && $set_forum['preview'] ? '<input type="submit" value="' . $lng['preview'] . '" style="width: 107px; cursor: pointer;"/>' : '') . '<input type="hidden" name="token" value="' . $token . '"/>' . '</p></form></div>'; } else { if ($user_id) { echo '<div style="border:1px solid #D7EDFC"><form name="form2" action="index.php?act=say&id=' . $id . '&page=' . $page . '" method="post" onsubmit="showLoading();">'; $token = mt_rand(1000, 100000); $_SESSION['token'] = $token; echo bbcode::auto_bb('form2', 'msg'); echo '<textarea rows="' . $set_user['field_h'] . '" name="msg" style="max-width:96%;margin-left:4px;margin-bottom:4px;"></textarea>'; echo '<p> <button type="submit" name="submit" id="btnSubmit1"; " type="submit" name="submit" id="btnSubmit1" ; "<span type="button" class="button comment"/> Trả lá»i</button> </p></div></form></div>'; } } } // ПоÑÑ‚Ñ€Ð°Ð½Ð¸Ñ‡Ð½Ð°Ñ Ð½Ð°Ð²Ð¸Ð³Ð°Ñ†Ð¸Ñ if ($colmes > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&', $start, $colmes, $kmess) . '</div>'; } if ($rights >= 3) { echo '<div class="phdr"><i class="fa fa-cogs"></i> Сông Ñụ</div>'; } // СпиÑок кураторов // Сông Ñụ if ($rights == 3 || $rights >= 6) { echo '</p>'; echo isset($topic_vote) && $topic_vote > 0 ? '<div class="list-login"><a href="index.php?act=editvote&id=' . $id . '">' . $lng_forum['edit_vote'] . '</a></div><div class="menu"><a href="index.php?act=delvote&id=' . $id . '">' . $lng_forum['delete_vote'] . '</a></div>' : '<div class="list-login"><a href="index.php?act=addvote&id=' . $id . '">' . $lng_forum['add_vote'] . '</a></div>'; echo '<div class="list-login"><a href="index.php?act=ren&id=' . $id . '">' . $lng_forum['topic_rename'] . '</a></div>'; // Закрыть - открыть тему if ($type1['edit'] == 1) echo '<div class="list-login"><a href="index.php?act=close&id=' . $id . '">' . $lng_forum['topic_open'] . '</a></div>'; else echo '<div class="list-login"><a href="index.php?act=close&id=' . $id . '&closed">' . $lng_forum['topic_close'] . '</a></div>'; // Удалить - воÑÑтановить тему if ($type1['close'] == 1) echo '<div class="list-login"><a href="index.php?act=restore&id=' . $id . '">' . $lng_forum['topic_restore'] . '</a></div>'; echo '<div class="list-login"><a href="index.php?act=deltema&id=' . $id . '">' . $lng_forum['topic_delete'] . '</a></div>'; if ($type1['vip'] == 1) echo '<div class="list-login"><a href="index.php?act=vip&id=' . $id . '">' . $lng_forum['topic_unfix'] . '</a></div>'; else echo '<div class="list-login"><a href="index.php?act=vip&id=' . $id . '&vip">' . $lng_forum['topic_fix'] . '</a></div>'; echo '<div class="list-login"><a href="index.php?act=per&id=' . $id . '">' . $lng_forum['topic_move'] . '</a></div>'; } break; default: // ЕÑли неверные данные, показываем ошибку echo functions::display_error($lng['error_wrong_data']); break; } } else { //////////////////////////////////////////////////////////// // СпиÑок Категорий форума // //////////////////////////////////////////////////////////// $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_files`" . ($rights >= 7 ? '' : " WHERE `del` != '1'")), 0); echo '<div class="phdr"><b>' . $lng['forum'] . '</b><a href="search.php" style="float:right;"><i class="fa fa-search"></i>' . $lng['search'] . '</a></div>'; $req = mysql_query("SELECT `id`, `text`, `soft` FROM `forum` WHERE `type`='f' ORDER BY `realid`"); $i = 0; while (($res = mysql_fetch_array($req)) !== false) { echo '<div class="list-login">'; $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='r' and `refid`='" . $res['id'] . "'"), 0); echo '<a href="index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> [' . $count . ']'; if (!empty($res['soft'])) echo '<div class="sub"><span class="gray">' . $res['soft'] . '</span></div>'; echo '</div>'; ++$i; } unset($_SESSION['fsort_id']); unset($_SESSION['fsort_users']); } } require_once('../incfiles/end.php');
![[OFF]](/assets/images/off.gif)
![[ON]](/assets/images/on.gif)