MrKen Fix Giúp :))

18 bài đăng
29.10.2015 / 17:49
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H
PHP
  1. <?php
  2. define('_IN_JOHNCMS', 1);
  3. $rootpath = '';
  4. require('incfiles/core.php');
  5. if (isset($_POST['msg'])) {
  6. $msg = isset($_POST['msg']) ? mb_substr(trim($_POST['msg']), 0, 5000) : '';
  7. $flood = functions::antiflood();
  8. if ($ban['1'] || $ban['13'])
  9. $error[] = $lng['access_forbidden'];
  10. if ($flood)
  11. $error = $lng['error_flood'] . ' ' . $flood . '&#160;' . $lng['seconds'];
  12. if (!$error) {
  13. $req = mysql_query("SELECT * FROM `guest` WHERE `user_id` = '$user_id' ORDER BY `time` DESC");
  14. $res = mysql_fetch_array($req);
  15. if ($res['text'] == $msg) {
  16. exit;
  17. }
  18. }
  19. if (!$error) {
  20. mysql_query("INSERT INTO `guest` SET
  21. `adm` = '$admset',
  22. `time` = '" . time() . "',
  23. `user_id` = '$user_id',
  24. `name` = '$from',
  25. `text` = '" . mysql_real_escape_string($msg) . "',
  26. `ip` = '" . core::$ip . "',
  27. `browser` = '" . mysql_real_escape_string($agn) . "'
  28. ");
  29. if ($user_id) {
  30. $postguest = $datauser['postguest'] + 1;
  31. mysql_query("UPDATE `users` SET `postguest` = '$postguest', `lastpost` = '" . time() . "' WHERE `id` = '$user_id'");
  32. }
  33. }
  34. }
  35. $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `adm`='0'"), 0);
  36. if ($total) {
  37. $req = mysql_query("SELECT `guest`.*, `guest`.`id` AS `gid`, `users`.`lastdate`, `users`.`id`, `users`.`rights`, `users`.`name`
  38. FROM `guest` LEFT JOIN `users` ON `guest`.`user_id` = `users`.`id`
  39. WHERE `guest`.`adm`='0' ORDER BY `time` DESC LIMIT ".(!$is_mobile ? 6 : 6)."");
  40. echo '<div class="forumtxt">';
  41. while ($gres = mysql_fetch_assoc($req)) {
  42. $post = functions::checkout($gres['text'], 1, 1);
  43. if ($set_user['smileys'])
  44. $post = functions::smileys($post, $gres['rights'] ? 1 : 0);
  45. $outputhtml .= (time() > $gres['lastdate'] + 600 ? ' <div class="list1"><img src="/images/offline.png" /> ' : ' <div class="list1"><img src="/images/online.png" /> ').'<a href="/users/profile.php?user='.$gres['id'].'"><b>'. htmlspecialchars($gres['name']).'</b></a>: '.$post.'<br /></div>';
  46. ++$i;
  47. }
  48. echo $outputhtml;
  49. echo '</div>';
  50. }
  51. ?>
Đã chỉnh sửa. MrKen (29.10.2015 / 17:50)
29.10.2015 / 17:51
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

Xin chỉ ra chỗ lỗi để sau còn tự làm

29.10.2015 / 17:52
ParkBom
Bài đăng: 596
Member
Hi I Am Park Bom

[code]

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/u584505538/public_html/incfiles/classes/bbcode.php on line 85[/code] còn lỏi

29.10.2015 / 17:54
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

lại dùng code nào rồi :v. lỗi hỏi thằng chủ code đê. bảo dùng bản ở đây ko chịu

29.10.2015 / 17:57
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

:ah:

30.10.2015 / 10:20
ParkBom
Bài đăng: 596
Member
Hi I Am Park Bom
PHP
  1. <?php
  2.  
  3. defined('_IN_JOHNCMS') or die('Error: restricted access');
  4.  
  5. $mp = new mainpage();
  6.  
  7. $thugon = mysql_fetch_array(mysql_query("SELECT * FROM `thugon` WHERE `id`='".$user_id."'"));
  8.  
  9. if ( $user_id && $datauser['dayb'] =='0' ||$user_id && $datauser['monthb'] =='0' ||$user_id && $datauser['yearofbirth']=='0' ||$user_id && $datauser['mail'] =='' ||$user_id && $datauser['about'] ==''
  10. ||$user_id && $datauser['jabber'] ==''
  11. ||$user_id && $datauser['live'] ==''
  12. ||$user_id && $datauser['mibile'] ==''){
  13. echo '<div class="rmenu">Cập nhật đầy đủ thông tin<a href="'.$home.'/users/profile.php?act=edit">( Cập nhật)</a></div>';
  14. }
  15. ////////////
  16. $time = time();
  17.  
  18. $req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' AND `close`!='1' AND `thongbao` = '1' ORDER BY `time` DESC LIMIT 3");
  19. $dem =mysql_num_rows($req);
  20. $chk1=$mp->news;
  21. if($dem||$chk1){
  22. echo '<div class="mainblok"><div class="phdr"><a href="/news">Thông báo</a></div>';
  23. }
  24. while ($res = mysql_fetch_assoc($req)) {
  25. echo is_integer($i / 2) ? '<div class="list2">' : '<div class="list1">';
  26. echo ' <a href="'.$home.'/forum/'.functions::nhanhnao($res["text"]).'_' . $res['id'] . '.html">' . functions::smileys($res['text']) . '</a>';
  27. echo '</div>';
  28. }
  29. echo $mp->news;
  30. echo '</div>';
  31.  
  32. ////////////
  33. ////mod chủ đề mới/////
  34. /////////////////
  35. /////////mod chat
  36. if ($user_id) {
  37. include'guestbook.php';
  38. }
  39. /////////////////////////////////////////
  40.  
  41. echo '<div class="phdr"><a href="/forum/index.php?act=new">Bài gửi gần đây</a> - <a href="/forum/search.php">Search</a></div>';
  42. $req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `close`!='1' ORDER BY `time` DESC LIMIT $start, $kmess");
  43.  
  44. $tong = mysql_result
  45. ( mysql_query ( "SELECT
  46. COUNT(*) FROM `forum`
  47. WHERE `type` = 't' and
  48. kedit='0' AND `close`!='1'" ),
  49. 0 );
  50. while ($arr = mysql_fetch_array($req)) {
  51. $q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $arr['refid'] . "'");
  52. $razd = mysql_fetch_array($q3);
  53. $q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "'");
  54. $frm = mysql_fetch_array($q4);
  55.  
  56. $nikuser = mysql_query("SELECT `from`,`id`, `time`, `user_id` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $arr['id'] . "'ORDER BY time DESC");
  57. $colmes1 = mysql_num_rows($nikuser);
  58. $cpg = ceil($colmes1 / $kmess);
  59.  
  60. $nam = mysql_fetch_array($nikuser);
  61. $gettop = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `type` = 'r' and id = '".$arr['refid']."'"));
  62. $topic = $gettop['text'];
  63. $vinahit = mysql_query("select `rights` from `users` where id='" . $nam['user_id'] . "'");
  64. $kingkem = mysql_fetch_array($vinahit);
  65.  
  66. echo is_integer($i / 2) ? '<div class="list2">' : '<div class="list1">';
  67. echo '' . ($arr['edit'] == 1 ? '<img src="../theme/' . $set_user['skin'] . '/images/tz.gif" alt=""/>' : '<img src="../images/op.gif" alt="bài viết"/>') . ' ';
  68. if ($arr['vip'] == 1)
  69. echo '<img src="../theme/' . $set_user['skin'] . '/images/pt.gif" alt=""/>';
  70. if ($arr['realid'] == 1)
  71. echo '<img src="images/rate.gif" alt=""/>';
  72.  
  73. //like trai tim
  74. $trang4 = mysql_query("SELECT * FROM `forum_thank` WHERE `topic` = '" . ($arr['id'] + 1) . "'");
  75. $trang5 = mysql_num_rows($trang4);
  76. //tien to
  77. $mang = array("label-1","label-2","label-3","label-4","label-5");
  78. $rado = rand(0,4);
  79. $label= $mang[$rado];
  80. $gettop = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE`type` = 'r' and id = '".$arr['refid']."'"));
  81. if ($arr['tiento'] ==1) {
  82. echo'';
  83. } elseif ($arr['tiento'] ==2) {
  84. echo'<span class="'.$label.'">Thảo luận</span>';
  85. } elseif ($arr['tiento'] ==3) {
  86. echo'<span class="'.$label.'">Hướng dẫn</span>';
  87. } elseif ($arr['tiento'] ==4) {
  88. echo'<span class="'.$label.'">Share</span>';
  89. } elseif ($arr['tiento'] ==5) {
  90. echo'<span class="'.$label.'">HOT</span>';
  91. } elseif ($arr['tiento'] ==6) {
  92. echo'<img src="/images/vip2.gif">';
  93. } elseif ($arr['tiento'] ==7) {
  94. echo'<span class="'.$label.'">Hỏi</span>';
  95. } elseif ($arr['tiento'] ==8) {
  96. echo'<span class="'.$label.'">Xin</span>';
  97. } elseif ($arr['tiento'] ==9) {
  98. echo'<span class="'.$label.'">Giúp</span>';
  99. }
  100. else {
  101. echo ' <span class="'.$label.'">'.$gettop['text'].'</span> ';
  102.  
  103. }
  104. if ($cpg > 1) {
  105. echo ' <a href="'.$home.'/forum/'.functions::nhanhnao($arr["text"]).'_' . $arr['id'] . (!$set_forum['upfp'] && $set_forum['postclip'] ? '_clip_' : '') . ($set_forum['upfp'] ? '' : '_p' . $cpg) . '.html#'.$nam['id'].'">';
  106. echo '' . functions::smileys($arr['text']) . '</a> [' . $colmes1 . ']';
  107. if($trang5)
  108. echo' <span style="color:red;">[♥'.$trang5.']</span>';
  109. } else {
  110. echo ' <a href="'.$home.'/forum/'.functions::nhanhnao($arr["text"]).'_' . $arr['id'] . ($cpg > 1 && $set_forum['upfp'] && $set_forum['postclip'] ? '_clip_' : '') . ($set_forum['upfp'] && $cpg > 1 ? '_p' . $cpg : '.html') . '#'.$nam['id'].'">';
  111. echo '' . functions::smileys($arr['text']) . '</a> [' . $colmes1 . ']';
  112. if($trang5)
  113. echo' <span style="color:red;">[♥'.$trang5.']</span>';
  114. }
  115.  
  116. if (!empty ($nam['from'])) {
  117. echo '&nbsp;<a href="/users/' . $nam['user_id'] . '.html">'.nick($nam['user_id']).'</a>';
  118.  
  119.  
  120.  
  121. if(600 > (time()-$arr['time']))
  122. echo ' <img src="/images/new.gif" alt="bài viết mới"/> ';
  123. }
  124. echo '</div>';
  125. $i ++;
  126.  
  127. }
  128. if ($tong > $kmess){echo '<div class="dinhkem">' . functions::display_pagination('index.php?', $start, $tong, $kmess) . '</div>';}
  129. if ($user_id){
  130.  
  131.  
  132. echo '<div class="phdr">Chuyên mục</div>';
  133. if($thugon['td'] == 0) {
  134. $tong = mysql_result(mysql_query("SELECT
  135. COUNT(*) FROM `forum` WHERE `type`
  136. = 't' and kedit='0' AND `close`!='1'"),
  137. 0);
  138. $req = mysql_query("SELECT * FROM
  139. `forum` WHERE `type` = 'f' ORDER
  140. BY `realid` ASC");
  141. $i = 0;
  142. while ($res = mysql_fetch_assoc($req))
  143. {
  144. echo $i % 2 ? '<div class="list2">
  145. ' : '<div class="list1">';
  146. echo '•&nbsp;<a href="'.$home.'/forum/'.functions::nhanhnao($res["text"]).'_'
  147. . $res['id'] . '.html">' . $res['text']
  148. . '</a>';
  149. echo '</div>';
  150. ++$i;
  151. }
  152. } else {
  153. echo '<div class="rmenu">Chuyên Mục Đã Ẩn</div>';
  154. }
  155. //////////het chuyen muc////////////////
  156. echo '</div>';
  157.  
  158. }else{
  159. echo '<div class="mainblok"><div class="phdr">Chuyên mục</div>';
  160. if($thugon['td'] == 0) {
  161. $tong = mysql_result(mysql_query("SELECT
  162. COUNT(*) FROM `forum` WHERE `type`
  163. = 't' and kedit='0' AND `close`!='1'"),
  164. 0);
  165. $req = mysql_query("SELECT * FROM
  166. `forum` WHERE `type` = 'f' ORDER
  167. BY `realid` ASC");
  168. $i = 0;
  169. while ($res = mysql_fetch_assoc($req))
  170. {
  171. echo $i % 2 ? '<div class="list2">
  172. ' : '<div class="list1">';
  173. echo '•&nbsp;<a href="'.$home.'/forum/'.functions::nhanhnao($res["text"]).'_'
  174. . $res['id'] . '.html">' . $res['text']
  175. . '</a>';
  176. echo '</div>';
  177. ++$i;
  178. }
  179. ///////////////////////
  180. echo '</div>';
  181. /*** Từ khóa ***/
  182.  
  183. //////////////////////
  184. } else {
  185. echo '<div class="rmenu">Chuyên Mục Đã Ẩn</div>';
  186. }
  187. }
  188.  
  189. ////////dam may tu khoa/////////
  190. ////////dam may tu khoa/////////
  191. $users = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . (time() - 600) . "'"), 0);
  192. $guests = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '" . (time() - 600) . "'"), 0);
  193. $total = $users+$guests;
  194. include 'bot.php';
  195. echo '<div class="phdr">Trực tuyến</div>';
  196. /*
  197. function show_online($user = array(), $status = 0, $ip = 0, $str = '', $text = '', $sub = '') { global $set_user, $realtime, $user_id, $admp, $home;
  198. $out = false;
  199. if ($user['rights'] == 0 ) $colornick['colornick'] = '000000';
  200. if ($user['rights'] == 1 )
  201. $colornick['colornick']
  202. = 'FF66FF';
  203. if ($user['rights'] == 2 )
  204. $colornick['colornick']
  205. = '8A0886';
  206. if ($user['rights'] == 3 ) $colornick['colornick'] = '00DD00';
  207. if ($user['rights'] == 4 ) $colornick['colornick'] = '00DD00';
  208. if ($user['rights'] == 5 ) $colornick['colornick'] = '770000';
  209. if ($user['rights'] == 6 ) $colornick['colornick'] = '0000FF';
  210. if ($user['rights'] == 7 ) $colornick['colornick'] = '000000';
  211. if ($user['rights'] == 9 ) $colornick['colornick'] = '000000';
  212.  
  213. if ($user_id){
  214. if($user['rights'] < 8) {
  215. $out .= '<a href="/users/' . $user['id'] . '-'.functions::nhanhnao($user['name']).'.html"><span style="color:#' . $colornick['colornick'] . '">' . $user['name'] . '</span></a>';
  216. } else {
  217. $out .= '<a href="/users/' . $user['id'] . '-'.functions::nhanhnao($user['name']).'.html"><font color="black">' . $user['name'] . '</font></a>';
  218. }
  219. } else {
  220. $out .= '<span style="color:#' . $colornick['colornick'] . '">' . $user['name'] . '</span>';
  221. }
  222. return $out;
  223. }*/
  224. function timecount($var) {
  225. if ($var < 0)
  226. $var = 0;
  227. $day = ceil($var / 86400);
  228. if ($var > 345600) {
  229. $str = $day . ' Giờ';
  230. } elseif ($var >= 172800) {
  231. $str = $day . ' Рhút';
  232. } elseif ($var >= 86400) {
  233. $str = '1 Giây';
  234. } else {
  235. $str = gmdate('G:i:s', $var);
  236. }
  237. return $str;
  238. }
  239. $on = $_GET['on'];
  240. switch($on) {
  241. default:
  242. echo '<div class="topmenu"><b>Đang online</b> | <a href="?on=24h"> 24h</a></div><div class="menu"><font color="green">•</font> Có <a href="/users/index.php?act=online">'.$total.' người trực tuyến,</a> '.$users.' thành viên và '.($guests - $coccoc - $gbot - $bing - $msn - $facebook - $yandex - $mj - $baidu).' khách viếng thăm, with '.($coccoc + $gbot + $bing + $msn + $facebook + $yandex + $mj + $baidu).' spider.</div>';
  243. $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `" . ($act == 'guest' ? 'cms_guests' : 'users') . "` WHERE `lastdate` > '" . (time() - 600) . "'"), 0);
  244. if ($total > 0) {
  245. echo '<div class="list1">';
  246. $req = mysql_query("SELECT * FROM `" . ($act == 'guest' ? 'cms_guests' : 'users') . "` WHERE `preg`='1' and `lastdate` > '" . (time() - 300) . "' ORDER BY " . ($act == 'guest' ? "`movings` DESC" : "`name` ASC") . " LIMIT 50");
  247. while ($res = mysql_fetch_assoc($req)) {
  248. /* echo show_online($res, 0, ($act == 'guest' || ($rights >= 1 && $rights >= $res['rights']) ? ($rights >= 6 ? 2 : 1) : 0), ' (' . $res['movings'] . ' - ' . timecount($realtime - $res['sestime']) . ') ' . $place);
  249. */
  250. echo '<a href="/users/'.$res['id'].'.html">'.nick($res['id']).'</a>';
  251. echo ', ';
  252. ++$l;
  253. }
  254. include 'online.php';
  255. echo'</div></div>';
  256. }
  257. else {
  258. echo '<div class="menu"><p>Không thành viên nào online!</p></div>';
  259. }
  260. break;
  261. case '24h':
  262. echo '<div class="topmenu"><a href="/">Đang online</a> | <b>24h</b></div>';
  263. $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `" . ($act == 'guest' ? 'cms_guests' : 'users') . "` WHERE `lastdate` > '" . (time() - 96000) . "'"), 0);
  264. if ($total > 0) {
  265. echo '<div class="menu"><p>';
  266. $req = mysql_query("SELECT * FROM `" . ($act == 'guest' ? 'cms_guests' : 'users') . "` WHERE `preg`='1' and `lastdate` > '" . (time() - 96000) . "' ORDER BY " . ($act == 'guest' ? "`movings` DESC" : "`name` ASC") . " LIMIT 1000");
  267. while ($res = mysql_fetch_assoc($req)) {
  268. /*
  269. echo show_online($res, 0, ($act == 'guest' || ($rights >= 1 && $rights >= $res['rights']) ? ($rights >= 6 ? 2 : 1) : 0), ' (' . $res['movings'] . ' - ' . timecount($realtime - $res['sestime']) . ') ' . $place);*/
  270. echo '<a href="/users/'.$res['id'].'.html">'.nick($res['id']).'</a>';
  271. echo ', ';
  272. ++$l;
  273. }
  274. echo'</p></div>';
  275. }
  276. else {
  277. echo '<div class="menu"><p>Không thành viên nào online!</p></div>';
  278. }
  279. break;
  280. }
  281. /*
  282. echo '<div class="phdr">Thay đổi giao diên</div>';
  283.  
  284. ?>
  285. <div class="dinhkem"><select name="url"size="1"onChange="window.open(this.options [this.selectedIndex].value,'_top')"><option value"link">Tùy chọn thay đổi...</option>
  286. <?
  287. echo '<option value="/style?mod=web">Giao diện Web</option>';
  288. echo '<option value="/style?mod=wap">Giao diện Wap-Mobile</option>';
  289. echo '<option value="/seo.html">Giao diện SEO</option>';
  290. echo '</select></div>';
  291.  
  292.  
  293. ////////////////////////////
  294. ///////////////////////////*/
  295. ?>

Ken fix giúp nó bị lõi :'( http://kenhgioitre.pe.hu

30.10.2015 / 12:16
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

:yao: ngộ :v

30.10.2015 / 20:26
duongchung
Bài đăng: 352
Member
Cox Vô Tâm
PHP
  1. //shoutbox
  2. if ($user_id) {
  3. echo '<div class="phdr"><a href="/guestbook/index.php">' . $lng['guestbook'] . '</a>' . ($rights >= 7 ? '<div style="float:right;"><a href="' . $home . '/guestbook/index.php?act=clean">[X]</a></div>' : '') . '</div>';
  4. $refer = base64_encode($_SERVER['REQUEST_URI']);
  5. $token = mt_rand(1000, 100000);
  6. $_SESSION['token'] = $token;
  7. echo '<div class="list1"><form name="form" id="shoutbox" action="/guestbook/index.php?act=say" method="post">';
  8. echo '<input type="text" name="msg" size="auto">';
  9. echo '<input type="hidden" name="ref" value="' . $refer . '">';
  10. echo '<input type="hidden" name="token" value="' . $token . '"/>';
  11. echo '<input type="image" id="send" src="/images/send.png" title="' . $lng['sent'] . '"/></form></div>';
  12. $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `adm`='0'"), 0);
  13. if ($total) {
  14. $req = mysql_query("SELECT `guest`.*, `guest`.`id` AS `gid`, `users`.`lastdate`, `users`.`id`, `users`.`rights`, `users`.`name`
  15. FROM `guest` LEFT JOIN `users` ON `guest`.`user_id` = `users`.`id`
  16. WHERE `guest`.`adm`='0' ORDER BY `time` DESC LIMIT 6");
  17. while ($gres = mysql_fetch_assoc($req)) {
  18. $post = $gres['text'];
  19. if (strlen($post) > 160) {
  20. $post = substr($post, 0, 160) . '...';
  21. }
  22. $post = functions::checkout($gres['text'], 1, 1);
  23. if ($set_user['smileys'])
  24. $post = functions::smileys($post, $gres['rights'] ? 1 : 0);
  25. echo '<div class="list2">';
  26. echo (time() > $gres['lastdate'] + 300 ? functions::image('offline.png') : functions::image('online.png'));
  27. echo '<span class="gray"><a href="/users/' . $gres['name'] . '">' . nick($gres['id']) . '</a>: ' . $post . '</span></div>';
  28. ++$i;
  29. }
  30. } else {
  31. echo '<div class="menu">' . $lng['guestbook_empty'] . '</div>';
  32. }
  33. }

Ken rảnh fix giúp với