PageRenderTime 32ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/forum/category/view-topic/index.php

https://github.com/LordPsyan/AquaFlameCMS
PHP | 748 lines | 655 code | 60 blank | 33 comment | 91 complexity | 761eb7a6ad3f57228da0c9ec9811ef5d MD5 | raw file
  1. <?php require_once("../../../configs.php");
  2. $page_cat = "forums";
  3. if(isset($_POST['s_move'])){
  4. mysql_select_db($server_db);
  5. $move = mysql_query("UPDATE forum_threads SET forumid = '".intval($_POST['t_move'])."' WHERE id = '".intval($_GET['t'])."'");
  6. }
  7. ?>
  8. <head>
  9. <title><?php echo $website['title']; ?></title>
  10. <meta content="false" http-equiv="imagetoolbar" />
  11. <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
  12. <link rel="shortcut icon" href="<?php echo $website['root'];?>wow/static/local-common/images/favicons/wow.ico" type="image/x-icon"/>
  13. <link rel="search" type="application/opensearchdescription+xml" href="http://eu.battle.net/en-gb/data/opensearch" title="Battle.net Search" />
  14. <link rel="stylesheet" type="text/css" media="all" href="<?php echo $website['root'];?>wow/static/local-common/css/common.css?v37" />
  15. <!--[if IE]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/local-common/css/common-ie.css?v37" /><![endif]-->
  16. <!--[if IE 6]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/local-common/css/common-ie6.css?v37" /><![endif]-->
  17. <!--[if IE 7]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/local-common/css/common-ie7.css?v37" /><![endif]-->
  18. <link title="World of Warcraft - News" href="/wow/en/feed/news" type="application/atom+xml" rel="alternate"/>
  19. <link rel="stylesheet" type="text/css" media="all" href="<?php echo $website['root'];?>wow/static/css/wow.css?v19" />
  20. <link rel="stylesheet" type="text/css" media="all" href="<?php echo $website['root'];?>wow/static/local-common/css/cms/forums.css?v37" />
  21. <link rel="stylesheet" type="text/css" media="all" href="<?php echo $website['root'];?>wow/static/local-common/css/cms/cms-common.css?v37" />
  22. <link rel="stylesheet" type="text/css" media="all" href="<?php echo $website['root'];?>wow/static/css/cms.css?v19" />
  23. <!--[if IE 6]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/css/cms-ie6.css?v19" /><![endif]-->
  24. <!--[if IE]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/css/wow-ie.css?v19" /><![endif]-->
  25. <!--[if IE 6]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/css/wow-ie6.css?v19" /><![endif]-->
  26. <!--[if IE 7]> <link rel="stylesheet" type="text/css" media="all" href="/wow/static/css/wow-ie7.css?v19" /><![endif]-->
  27. <script type="text/javascript" src="<?php echo $website['root'];?>wow/static/local-common/js/third-party/jquery.js?v37"></script>
  28. <script type="text/javascript" src="<?php echo $website['root'];?>wow/static/local-common/js/core.js?v37"></script>
  29. <script type="text/javascript" src="<?php echo $website['root'];?>wow/static/local-common/js/tooltip.js?v37"></script>
  30. <script type="text/javascript" src="<?php echo $website['root'];?>wow/static/local-common/js/bml.js"></script>
  31. <script type="text/javascript" src="http://static.wowhead.com/widgets/power.js"></script>
  32. <!--[if IE 6]> <script type="text/javascript">//<![CDATA[try { document.execCommand('BackgroundImageCache', false, true) } catch(e) {}//]]></script><![endif]-->
  33. <script type="text/javascript">
  34. //<![CDATA[
  35. Core.staticUrl = '/wow/static';
  36. Core.sharedStaticUrl= '/wow/static/local-common';
  37. Core.baseUrl = '';
  38. Core.projectUrl = '/wow';
  39. Core.cdnUrl = 'http://eu.media.blizzard.com';
  40. Core.supportUrl = 'http://eu.battle.net/support/';
  41. Core.secureSupportUrl= 'https://eu.battle.net/support/';
  42. Core.project = 'wow';
  43. Core.locale = 'en-gb';
  44. Core.language = 'en';
  45. Core.buildRegion = 'eu';
  46. Core.region = 'eu';
  47. Core.shortDateFormat= 'dd/MM/yyyy';
  48. Core.dateTimeFormat = 'dd/MM/yyyy HH:mm';
  49. Core.loggedIn = true;
  50. Flash.videoPlayer = 'http://eu.media.blizzard.com/global-video-player/themes/wow/video-player.swf';
  51. Flash.videoBase = 'http://eu.media.blizzard.com/wow/media/videos';
  52. Flash.ratingImage = 'http://eu.media.blizzard.com/global-video-player/ratings/wow/en-gb.jpg';
  53. Flash.expressInstall= 'http://eu.media.blizzard.com/global-video-player/expressInstall.swf';
  54. var _gaq = _gaq || [];
  55. _gaq.push(['_setAccount', 'UA-544112-16']);
  56. _gaq.push(['_setDomainName', '.battle.net']);
  57. _gaq.push(['_trackPageview']);
  58. _gaq.push(['_trackPageLoadTime']);
  59. //]]>
  60. </script>
  61. <meta name="title" content="Im looking for someone to play with" />
  62. <link rel="image_src" href="<?php echo $website['root'];?>wow/static/images/icons/facebook/article.jpg" />
  63. </head>
  64. <body class="en-gb logged-in">
  65. <?php
  66. require("../../functions.php");
  67. require("../../functions/post_toHtml.php");
  68. ?>
  69. <div id="wrapper">
  70. <?php include("../../../header.php"); ?>
  71. <div id="content">
  72. <div class="content-top">
  73. <div class="content-trail">
  74. <ol class="ui-breadcrumb">
  75. <?php
  76. if($_GET['t'] != ""){
  77. $error = 0;
  78. $threadid = intval($_GET['t']);
  79. $ndate = date('Y-m-d H:i:s');
  80. $thread = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_threads WHERE id = '".$threadid."'"))or $error=1;
  81. $postid = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_posts WHERE type = 1 AND postid = '".$thread['id']."'"));
  82. $update = mysql_query("UPDATE forum_threads SET views = views + 1 WHERE id = '".$thread['id']."'");
  83. $forum = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_forums WHERE id = '".$thread['forumid']."'"))or $error=1;
  84. $category = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_categ WHERE id = '".$forum['categ']."'"))or $error=1;
  85. if(isset($_SESSION['username'])){ $userInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$account_information['id']."'")); }
  86. echo '
  87. <li><a href="'.$website['root'].'index.php" rel="np">'.$website['title'].'</a></li>
  88. <li><a href="'.$website['root'].'forum" rel="np">Forums</a></li>
  89. <li><a href="'.$website['root'].'forum" rel="np">'.$category['name'].'</a></li>
  90. <li><a href="'.$website['root'].'forum/category/?f='.$forum['id'].'" rel="np">'.$forum['name'].'</a></li>
  91. <li class="last"><a href="../?t='.$thread['id'].'" rel="np">'.$thread['name'].'</a></li>
  92. ';
  93. }else $error=1;
  94. if($error == 1){
  95. echo '
  96. <li><a href="'.$website['root'].'index.php" rel="np">'.$website['title'].'</a></li>
  97. <li class="last"><a href="index.php" rel="np">Forums</a></li>
  98. ';
  99. }else{
  100. if(isset($_POST['detail']) && $_POST['detail'] != ""){
  101. $reply = $_POST['detail'];
  102. $reply = stripslashes($reply);
  103. $reply = strip_tags($reply);
  104. $reply = addslashes($reply);
  105. $reply = nl2br($reply);
  106. $insert = mysql_query("INSERT INTO forum_replies (threadid,forumid,content,author,name,date,last_date) VALUES ('".$thread['id']."','".$forum['id']."','".mysql_real_escape_string($reply)."','".mysql_real_escape_string($account_information['id'])."','".mysql_real_escape_string($thread['name'])."','".$ndate."','".$ndate."')")or print(''.$Forum['Forum58'].'');
  107. $replies = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_replies WHERE threadid = '".$thread['id']."' ORDER BY id DESC LIMIT 1"));
  108. $insert = mysql_query("INSERT INTO forum_posts (type,postid) VALUES ('2','".$replies['id']."')");
  109. $update = mysql_query("UPDATE forum_threads SET last_date = '".$ndate."', replies = replies + 1 WHERE id = '".$thread['id']."'");
  110. if($userInfo['class'] == "blizz"){
  111. $update = mysql_query("UPDATE forum_threads SET has_blizz = 1 WHERE id = '".$thread['id']."'");
  112. $insert = mysql_query("INSERT INTO forum_blizzposts (type,author,postid) VALUES ('reply','".$userInfo['id']."','".$replies['id']."')");
  113. }
  114. $posted = 1;
  115. } else $posted = 0;
  116. }
  117. ?>
  118. </ol>
  119. </div>
  120. <div class="content-bot">
  121. <div id="forum-content">
  122. <script type="text/javascript">
  123. //<![CDATA[
  124. $(function(){ Cms.Forum.threadListInit('<?php echo $thread['id']; ?>'); });
  125. //]]>
  126. </script>
  127. <?php
  128. if($error == 1){
  129. echo '
  130. <style type="text/css">
  131. .loader {
  132. width:24px;
  133. height:24px;
  134. background: url("../wow/static/images/loaders/canvas-loader.gif") no-repeat;
  135. }
  136. </style>
  137. <center>'.$Forum['Forum59'].'<br /><br /><div class="loader"> </div><br />'.$Forum['Forum37'].'</center>
  138. <meta http-equiv="refresh" content="2;url=../index.php"/>
  139. ';
  140. }else{
  141. ?>
  142. <?php if($posted != 1){ ?>
  143. <?php
  144. echo
  145. '
  146. <div class="section-header">
  147. <div class="blizzard_icon"><a class="nextBlizz" href="#" onmouseover="Tooltip.show(this,\''.$Forum['Forum50'].'\');"></a></div>
  148. <span class="topic">'.$Forum['Forum60'].'</span>';
  149. $posterAccount = mysql_fetch_assoc(mysql_query("SELECT * FROM $server_adb.account WHERE id = '".$thread['author']."'"));
  150. $posterInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$posterAccount['id']."'"));
  151. if($posterInfo['character'] == 0){
  152. $char['name'] = $posterInfo['firstName'];
  153. $char['val'] = 0;
  154. }else{
  155. $char = mysql_fetch_assoc(mysql_query("SELECT name,level,class,race FROM $server_cdb.characters WHERE guid = '".$posterInfo['character']."'"));
  156. $char['val'] = 1;
  157. }
  158. if($thread['prefix'] != "none"){
  159. echo '( '.$thread['prefix'];
  160. if($thread['locked'] == 1){ echo ' Locked )';}else{ echo ' )'; }
  161. }else{
  162. if($thread['locked'] == 1){ echo '( Locked )';}
  163. }
  164. echo '
  165. <span class="sub-title">'.$thread['name'].'</span>
  166. </div>
  167. <div class="forum-actions top">
  168. <div class="actions-panel">
  169. <a class="ui-button button1 imgbutton " href="../?f='.$thread['forumid'].'"><span><span><span class="back-arrow"> </span></span></span></a>';
  170. if (isset($_SESSION['username'])){
  171. if ($thread['locked'] == 0 && $userInfo['class'] == ""){
  172. echo '<a class="ui-button button1" href="#new-post"><span><span>'.$Forum['Forum61'].'</span></span></a>';
  173. }
  174. elseif ($thread['locked'] == 1 && $userInfo['class'] == ""){
  175. echo '<a class="ui-button button1 disabled" href="#new-post"><span><span>'.$Forum['Forum61'].'</span></span></a>';
  176. }
  177. else{ //If class mvp or blizz
  178. echo '<a class="ui-button button1" href="#new-post"><span><span>'.$Forum['Forum61'].'</span></span></a>';
  179. if ($thread['locked'] == 0) echo '<a class="ui-button button1" href="../edit-post/lock.php?p='.$postid['id'].'"><span><span>Close Topic</span></span></a>';
  180. else echo '<a class="ui-button button1" href="../edit-post/lock.php?p='.$postid['id'].'"><span><span>Open Topic</span></span></a>';
  181. echo '<a class="ui-button button1" href="../edit-post/delete.php?p='.$postid['id'].'"><span><span>Delete Topic</span></span></a>';
  182. $categ = mysql_query("SELECT * FROM forum_categ ORDER BY num ASC");
  183. echo '<div style="float:right;">
  184. <form method="post" action="">
  185. <select name="t_move"><option value="">Move to...</option>';
  186. while ($group = mysql_fetch_assoc($categ)){
  187. echo '<optgroup label="'.$group['name'].'">';
  188. $forums = mysql_query("SELECT * FROM forum_forums WHERE categ = '".$group['id']."' ORDER BY num ASC");
  189. while ($op = mysql_fetch_assoc($forums)){
  190. echo '<option value="'.$op['id'].'">'.$op['name'].'</option>';
  191. }
  192. echo '</optgroup>';
  193. }
  194. echo '</select><button type="submit" name="s_move" class="ui-button button1" style="float:right;"><span><span>MOVE</span></span></button>
  195. </form></div>';
  196. }
  197. }
  198. elseif($thread['locked'] == 0){
  199. echo '<a class="ui-button button1" href="?login" onclick="return Login.open()"><span><span>'.$Forum['Forum61'].'</span></span></a>';
  200. } else{
  201. echo '<a class="ui-button button1 disabled" href="?login" onclick="return Login.open()"><span><span>'.$Forum['Forum61'].'</span></span></a>';
  202. }
  203. echo '
  204. <span class="clear"><!-- --></span>
  205. </div>
  206. </div>
  207. <div id="thread">';
  208. switch($posterInfo['class']){
  209. case "blizz":
  210. echo '<div id="post-1" class="post blizzard">';
  211. break;
  212. case "mvp":
  213. echo '<div id="post-1" class="post mvp">';
  214. break;
  215. default:
  216. echo'<div id="post-1" class="post general">';
  217. break;
  218. }
  219. echo '
  220. <span id="1"></span>
  221. <div class="post-interior">
  222. <table>
  223. <tr>
  224. <!-- User Images -->
  225. <td class="post-character">
  226. <div class="post-user">
  227. <div class="avatar">
  228. <div class="avatar-interior">
  229. <a href="#"><img height="84" src="'.$website['root'].'images/avatars/2d/'.$posterInfo['avatar'].'" alt="" /></a>
  230. </div>
  231. </div>
  232. <div class="character-info">
  233. <div class="user-name">
  234. <span class="char-name-code" style="display: none">'.$char['name'].'</span>
  235. <div id="context-2" class="ui-context">
  236. <div class="context">
  237. <a href="javascript:;" class="close" onclick="return CharSelect.close(this);"></a>
  238. <div class="context-user"><strong>'.$char['name'].'</strong></div>
  239. <div class="context-links">
  240. <a href="#" title="View posts" rel="np" class="icon-posts link-first link-last">'.$Forum['Forum62'].'</a>
  241. </div>
  242. </div>
  243. </div>
  244. <a href="javascript:;" class="context-link" rel="np">'.$char['name'].'</a>
  245. </div>
  246. ';
  247. switch($posterInfo['class']){
  248. case "blizz": echo '<div class="blizzard-title">'.$Forum['Forum63'].'</div>'; break;
  249. case "mvp": echo '<div class="mvp-title">'.$Forum['Forum64'].'</div>'; break;
  250. default:
  251. echo'<div>';
  252. if($char['val'] == 1){
  253. echo '
  254. <div class="character-desc"><span class="color-c5">'.$char['level'].' '.race($char['race']).' '.classx($char['class']).'</span></div>
  255. <div class="guild"><a href="#">'.$Forum['Forum65'].'</a></div>
  256. <div class="achievements">0</div>
  257. ';
  258. } echo '<div class="character-desc"><span class="color-c5">No Characters</span></div>';
  259. echo '</div>';
  260. break;
  261. }
  262. echo'
  263. </div>
  264. </div>
  265. </td>
  266. <!-- End User Thingy -->
  267. <td>';
  268. if($thread['edited'] == 1)
  269. {
  270. $editorInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$thread['editedby']."'"));
  271. if($editorInfo['character'] == 0){
  272. $charEdit['name'] = $editorInfo['firstName'];
  273. }else{
  274. $charEdit = mysql_fetch_assoc(mysql_query("SELECT name FROM $server_cdb.characters WHERE guid = '".$editorInfo['character']."'"));
  275. }
  276. echo '<div class="post-edited">'.$Forum['Forum67'].' '.$charEdit['name'].' '.$Forum['Forum68'].' '.$thread['last_date'].'</div>';
  277. }
  278. $content=$thread['content'];
  279. $content=stripslashes($content);
  280. $content=postX($content,$posterInfo['class']);
  281. $content=str_replace("<br>", "\n", $content);
  282. $i=1;
  283. echo'
  284. <div class="post-detail">'.$content.'</br></br></div>
  285. </td>
  286. <td class="post-info">
  287. <div class="post-info-int">
  288. <div class="postData">
  289. <a href="#'.$i.'">#'.$i.'</a>
  290. <div class="date" onmouseover="Tooltip.show(this,\''.$Forum['Forum69'].''.$thread['date'].'\')">'.ago(strtotime($thread['date'])).'</div>
  291. </div>
  292. <div class="karma">
  293. <div class="karma-feedback">
  294. '.$Forum['Forum70'].'
  295. </div>
  296. <span class="clear"><!-- --></span>
  297. </div>
  298. <!--<div class="blizzard_icon"><a class="nextBlizz" href="#" onmouseover="Tooltip.show(this,\''.$Forum['Forum71'].'\')"></a></div>-->
  299. </div>
  300. </td>
  301. </tr>
  302. </table>';
  303. // Goes on Rate is Disabled if not Logged in-> <a href="?login" onclick="return Login.open(https://eu.battle.net/login/login.frag)">Login</a>
  304. // Goes only if Logged In. ONLY if you are Logged in.
  305. // <div class="karma">
  306. // <div class="rate-btn-holder">
  307. // <a href="javascript:;" onclick="Cms.Topic.vote(POSTNUMBER,'up',1,'')" class="rateup rate-btn"><span>Like</span></a>
  308. // </div>
  309. // <div class="rate-btn-holder">
  310. // <a href="javascript:;" onclick="$(this).siblings('.rate-action').show();" class="ratedown rate-btn"></a>
  311. // <div class="rate-action" style="display: none; ">
  312. // <div class="ui-dropdown">
  313. // <div class="dropdown-wrapper">
  314. // <ul>
  315. // <li><a href="javascript:;" onclick="Cms.Topic.vote(POSTNUMBER,'down',1,'')">Dislike</a></li>
  316. // <li><a href="javascript:;" onclick="Cms.Topic.vote(POSTNUMBER,'down',2,'')">Trolling</a></li>
  317. // <li><a href="javascript:;" onclick="Cms.Topic.vote(POSTNUMBER,'down',3,'')">Spam</a></li>
  318. // <li><a href="javascript:;" onclick="Cms.Topic.report(POSTNUMBER,'CHARNAME','post-POSTNUMBER')" class="report">Report</a></li>
  319. // </ul>
  320. // </div>
  321. // </div>
  322. // </div>
  323. // </div>
  324. // <div class="prev-vote">You have already rated this item.</div>
  325. // <span class="clear"><!-- --></span>
  326. // </div>
  327. $postid = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_posts WHERE type = 1 AND postid = '".$thread['id']."'"));
  328. ### POST OPTIONS ###
  329. if(isset($_SESSION['username']))
  330. {
  331. echo '
  332. <div class="post-options">';
  333. if($thread['locked'] == 1)
  334. {
  335. if($userInfo['class'] != ""){
  336. echo '<div class="respond">';
  337. if($thread['author'] == $userInfo['id']){
  338. echo'<a class="ui-button button2 " href="../edit-post/?p='.$postid['id'].'"><span><span>'.$Forum['Forum22'].'</span></span></a>';
  339. }
  340. echo '
  341. <a class="ui-button button2 " href="#new-post" onclick="Cms.Topic.quote('.$thread['id'].');">
  342. <span><span><span class="icon-quote">'.$Forum['Forum72'].'</span></span></span>
  343. </a>
  344. </div>';
  345. }else echo '<div class="no-post-options"><!-- --></div>';
  346. }else{
  347. echo '
  348. <div class="respond">';
  349. if($thread['author'] == $userInfo['id']) echo'<a class="ui-button button2 " href="../edit-post/?p='.$postid['id'].'"><span><span>'.$Forum['Forum22'].'</span></span></a>';
  350. echo '
  351. <a class="ui-button button2 " href="#new-post">
  352. <span><span>'.$reply['reply'].'</span></span>
  353. </a>
  354. <a class="ui-button button2 " href="#new-post" onclick="Cms.Topic.quote('.$thread['id'].');">
  355. <span><span><span class="icon-quote">'.$Forum['Forum72'].'</span></span></span>
  356. </a>
  357. </div>';
  358. }
  359. echo '
  360. <span class="clear"><!-- --></span>
  361. </div>
  362. ';
  363. }
  364. ###############
  365. echo '
  366. </div>
  367. </div>';
  368. // Thread Post - End
  369. $get_replies = mysql_query("SELECT * FROM forum_replies WHERE threadid = '".$thread['id']."' ORDER BY id ASC");
  370. if(mysql_num_rows($get_replies) > 0)
  371. {
  372. $i++;
  373. while($reply = mysql_fetch_array($get_replies))
  374. {
  375. $postid = mysql_fetch_assoc(mysql_query("SELECT * FROM forum_posts WHERE type = 2 AND postid = '".$reply['id']."'"));
  376. $posterAccount = mysql_fetch_assoc(mysql_query("SELECT * FROM $server_adb.account WHERE id = '".$reply['author']."'"));
  377. $posterInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$posterAccount['id']."'"));
  378. if($posterInfo['character'] == 0){
  379. $char['name'] = $posterInfo['firstName'];
  380. $char['val'] = 0;
  381. }else{
  382. $char = mysql_fetch_assoc(mysql_query("SELECT name, level,race,class FROM $server_cdb.characters WHERE guid = '".$posterInfo['character']."'"));
  383. $char['val'] = 1;
  384. }
  385. switch($posterInfo['class']){
  386. case "blizz":
  387. echo '<div id="post-'.$i.'" class="post blizzard">';
  388. break;
  389. case "mvp":
  390. echo '<div id="post-'.$i.'" class="post mvp">';
  391. break;
  392. default:
  393. echo'<div id="post-'.$i.'" class="post general">';
  394. break;
  395. }
  396. echo'
  397. <span id="'.$i.'"></span>
  398. <div class="post-interior">
  399. <table>
  400. <tr>
  401. <td class="post-character">
  402. <div class="post-user">
  403. <div class="avatar">
  404. <div class="avatar-interior">
  405. <a href="#">
  406. <img height="84" src="'.$website['root'].'images/avatars/2d/'.$posterInfo['avatar'].'" alt="" />
  407. </a>
  408. </div>
  409. </div>
  410. <div class="character-info">
  411. <div class="user-name">
  412. <span class="char-name-code" style="display: none">'.$char['name'].'</span>
  413. <div id="context-2" class="ui-context">
  414. <div class="context">
  415. <a href="javascript:;" class="close" onclick="return CharSelect.close(this);"></a>
  416. <div class="context-user"><strong>'.$char['name'].'</strong></div>
  417. <div class="context-links">
  418. <a href="#" title="View posts" rel="np" class="icon-posts link-first link-last">View posts</a>
  419. </div>
  420. </div>
  421. </div>
  422. <a href="javascript:;" class="context-link" rel="np">'.$char['name'].'</a>
  423. </div>';
  424. switch($posterInfo['class']){
  425. case "blizz":
  426. echo '<div class="blizzard-title">'.$Forum['Forum63'].'</div>';
  427. break;
  428. case "mvp":
  429. echo '<div class="mvp-title">'.$Forum['Forum64'].'</div>';
  430. break;
  431. default:
  432. echo'
  433. <div>';
  434. if($char['val'] == 1){ echo'
  435. <div class="character-desc"><span class="color-c5">'.$char['level'].' '.race($char['race']).' '.classx($char['class']).'</span></div>
  436. <div class="guild"><a href="#">'.$Forum['Forum65'].'</a></div>
  437. <div class="achievements">0</div>'; }else{
  438. echo '<div class="character-desc"><span class="color-c5">'.$Forum['Forum66'].'</span></div>';
  439. }
  440. echo'
  441. </div>';
  442. break;
  443. }
  444. echo'
  445. </div>
  446. </div>
  447. </td>
  448. <td>';
  449. if($reply['edited'] == 1)
  450. {
  451. $editorInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$reply['editedby']."'"));
  452. if($editorInfo['character'] == 0){
  453. $charEdit['name'] = $editorInfo['firstName'];
  454. }else{
  455. $charEdit = mysql_fetch_assoc(mysql_query("SELECT name FROM $server_cdb.characters WHERE guid = '".$editorInfo['character']."'"));
  456. }
  457. echo '<div class="post-edited">'.$Forum['Forum67'].' '.$charEdit['name'].' '.$Forum['Forum68'].' '.$reply['last_date'].'</div>';
  458. }
  459. $content=$reply['content'];
  460. $content=postX($content,$posterInfo['class']);
  461. echo'<div class="post-detail">'.stripslashes($content).'<br><br></div>
  462. </td>
  463. <td class="post-info">
  464. <div class="post-info-int">
  465. <div class="postData">
  466. <a href="#'.$i.'">#'.$i.'</a>
  467. <div class="date" onmouseover="Tooltip.show(this,\''.$Forum['Forum69'].''.$reply['date'].'\')">'.ago(strtotime($reply['date'])).'</div>
  468. </div>
  469. <!--<div class="blizzard_icon"><a class="nextBlizz" href="#" onmouseover="Tooltip.show(this,\''.$Forum['Forum71'].'\')"></a></div>-->
  470. </div>
  471. </td>
  472. </tr>
  473. </table>
  474. <div class="post-options">';
  475. if(isset($_SESSION['username'])){
  476. if($thread['locked'] == 1){
  477. if($userInfo['class'] != ""){
  478. echo '<div class="respond">';
  479. if($reply['author'] == $userInfo['id']){
  480. echo '<a class="ui-button button2 " href="../edit-post/?p='.$postid['id'].'"><span><span>'.$Forum['Forum22'].'</span></span></a>';
  481. }
  482. echo'
  483. <a class="ui-button button2 " href="#new-post">
  484. <span><span>'.$Forum['reply'].'</span></span>
  485. </a>
  486. <a class="ui-button button2 " href="../edit-post/delete.php?p='.$postid['id'].'"><span><span>Delete</span></span></a>
  487. <a class="ui-button button2 " href="#new-post" onclick="Cms.Topic.quote('.$reply['id'].');">
  488. <span><span><span class="icon-quote">'.$Forum['Forum72'].'</span></span></span>
  489. </a>
  490. </div>';
  491. }else echo '<div class="no-post-options"><!-- --></div>';
  492. }else{
  493. echo '
  494. <div class="respond">';
  495. if($reply['author'] == $userInfo['id']){
  496. echo '<a class="ui-button button2 " href="../edit-post/?p='.$postid['id'].'"><span><span>'.$Forum['Forum22'].'</span></span></a>';
  497. echo '<a class="ui-button button2 " href="../edit-post/delete.php?p='.$postid['id'].'"><span><span>Delete</span></span></a>';
  498. }
  499. echo '
  500. <a class="ui-button button2 " href="#new-post">
  501. <span><span>'.$Forum['reply'].'</span></span>
  502. </a>';
  503. if($userInfo['class'] != "" && $reply['author'] != $userInfo['id']){
  504. echo '<a class="ui-button button2 " href="../edit-post/delete.php?p='.$postid['id'].'"><span><span>Delete</span></span></a>';
  505. }
  506. echo'
  507. <a class="ui-button button2 " href="#new-post" onclick="Cms.Topic.quote('.$reply['id'].');">
  508. <span><span><span class="icon-quote">'.$Forum['Forum72'].'</span></span></span>
  509. </a>
  510. </div>';
  511. }
  512. }
  513. echo'
  514. <span class="clear"><!-- --></span>
  515. </div>
  516. </div>
  517. </div>';
  518. $i++;
  519. }
  520. }
  521. ?>
  522. </div>
  523. <div class="talkback">
  524. <?php
  525. if(!isset($_SESSION['username'])) $post=0;
  526. else{
  527. if($thread['locked'] == "1"){
  528. if($userInfo['class'] == "") $post=0;
  529. else $post=1;
  530. }else $post=1;
  531. }
  532. if($post == 1){
  533. if($userInfo['character'] == 0){
  534. $char['name'] = $userInfo['firstName'];
  535. $char['val'] = 0;
  536. }else{
  537. $char = mysql_fetch_assoc(mysql_query("SELECT name, level,race,class FROM $server_cdb.characters WHERE guid = '".$userInfo['character']."'"));
  538. $char['val'] = 1;
  539. }
  540. ?>
  541. <a id="new-post"></a>
  542. <form method="post" onsubmit="return Cms.Topic.postValidate(this);" action="#<?php echo $i++; ?>">
  543. <div>
  544. <input type="hidden" name="xstoken" value="272c2eb0-9252-4eae-b494-93fd89788702" />
  545. <input type="hidden" name="sessionPersist" value="forum.topic.post" />
  546. <div class="post general">
  547. <div class="post-user-details"><h4><?php echo $Forum['Forum73'] ?></h4>
  548. <div class="post-user ajax-update">
  549. <div class="avatar">
  550. <div class="avatar-interior">
  551. <a href="#">
  552. <img height="84" src="<?php echo $website['root'];?>images/avatars/2d/<?php echo $userInfo['avatar']; ?>" alt="" />
  553. </a>
  554. </div>
  555. </div>
  556. <div class="character-info">
  557. <div class="user-name">
  558. <span class="char-name-code" style="display: none"><?php echo $char['name']; ?></span>
  559. <a href="#" class="context-link" rel="np"><?php echo $char['name']; ?> </a>
  560. </div>
  561. <div class="userCharacter">
  562. <?php if($char['val'] == 1){ ?>
  563. <div class="character-desc">
  564. <span class="color-c1">
  565. <?php echo $char['level'].' '.race($char['race']).' '.classx($char['class']); ?>
  566. </span>
  567. </div>
  568. <div class="achievements">0</div>
  569. <?php } ?>
  570. </div>
  571. </div>
  572. </div>
  573. </div>
  574. <div class="post-edit">
  575. <div id="post-errors"></div>
  576. <div class="talkback-controls">
  577. <a href="javascript:;" onclick="Cms.Topic.previewToggle(this, 'preview')" class="preview-btn"><span class="arr"></span><span class="r"></span><span class="c">Preview</span></a>
  578. <a href="javascript:;" onclick="Cms.Topic.previewToggle(this, 'edit')" class="edit-btn selected"><span class="arr"></span><span class="r"></span><span class="c">Edit</span></a>
  579. </div>
  580. <div class="editor1" id="post-edit">
  581. <a id="editorMax" rel="5000"></a>
  582. <textarea id="detail" name="detail" class="post-editor" cols="78" rows="13"></textarea>
  583. <script type="text/javascript">
  584. //<![CDATA[
  585. $(function() {
  586. Wow.addBmlCommands();
  587. BML.initialize('#post-edit', false);
  588. });
  589. //]]>
  590. </script>
  591. </div>
  592. <div class="post-detail" id="post-preview"></div>
  593. <div class="talkback-btm">
  594. <table class="dynamic-center ">
  595. <tr>
  596. <td>
  597. <div id="submitBtn">
  598. <button class="ui-button button1 " type="submit"><span><span><?php echo $Forum['Forum23']; ?></span></span></button>
  599. </div>
  600. </td>
  601. </tr>
  602. </table>
  603. </div>
  604. </div>
  605. <span class="clear"><!-- --></span>
  606. </div>
  607. </div>
  608. </form>
  609. <span class="clear"><!-- --></span>
  610. <?php
  611. }
  612. else{
  613. ?>
  614. <a id="new-post"></a>
  615. <div>
  616. <div class="post general">
  617. <table class="dynamic-center">
  618. <tr>
  619. <td>
  620. <?php
  621. if(isset($_SESSION['username'])) echo ''.$Forum['Forum74'].'';
  622. else echo ''.$Forum['Forum75'].'';
  623. ?>
  624. </td>
  625. </tr>
  626. </table>
  627. </div>
  628. </div>
  629. <?php
  630. }
  631. ?>
  632. <span class="clear"><!-- --></span>
  633. <?php
  634. }else{
  635. $_POST['detail'] = "";
  636. $link = '?t='.$threadid;
  637. echo '<center><br /><br />'.$Forum['Forum76'].'<br />';
  638. echo '
  639. <style type="text/css">
  640. .loader {
  641. width:24px;
  642. height:24px;
  643. background: url("'.$website['root'].'wow/static/images/loaders/canvas-loader.gif") no-repeat;
  644. }
  645. </style>';
  646. echo '<div class="loader"></div><br /></center>';
  647. echo '<meta http-equiv="refresh" content="0;url='.$link.'"/>';
  648. }
  649. ?>
  650. <div class="talkback-code">
  651. <div class="talkback-code-interior">
  652. <div class="talkback-icon">
  653. <h4 class="code-header"><?php echo $Forum['Forum24']; ?></h4>
  654. <p><?php echo $Forum['Forum25']; ?> <strong><?php echo $Forum['Forum26']; ?></strong></p>
  655. <p><?php echo $Forum['Forum27']; ?> <strong><?php echo $Forum['Forum28']; ?></strong></p>
  656. <p><?php echo $Forum['Forum29']; ?> <strong><?php echo $Forum['Forum30']; ?></strong></p>
  657. <p><?php echo $Forum['Forum31']; ?> <a href="http://battle.net/community/conduct"><?php echo $Forum['Forum32']; ?></a> <?php echo $Forum['Forum33']; ?></p>
  658. </div>
  659. </div>
  660. </div>
  661. </div>
  662. </div>
  663. <?php } ?>
  664. </div>
  665. </div>
  666. </div>
  667. <?php include("../../../footer.php"); ?>
  668. </body>
  669. </html>