PageRenderTime 79ms CodeModel.GetById 35ms RepoModel.GetById 1ms app.codeStats 0ms

/inc/forum/forums.posts.php

https://bitbucket.org/wopkevries/blizzlike-313-website
PHP | 981 lines | 854 code | 114 blank | 13 comment | 164 complexity | d9964ae0f8be759545754835884324f4 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. if (INCLUDED!==true) { include('index.htm'); exit; }
  3. if ($_POST["rpoll"]!='') {
  4. if ($rowz['poll']=='') {
  5. $haserrors='This poll don\'t has a vote request.';
  6. } else {
  7. if (mysql_num_rows(mysql_query("SELECT id_poll FROM forum_rel_topics_polls WHERE id_topic='".$_REQUEST['t']."' AND id_poll='".$_POST['rpoll']."'", $MySQL_CON))==0) {
  8. $haserrors='The option you selected is invalid.';
  9. } else {
  10. $rowj=mysql_query("SELECT * FROM forum_rel_account_polls ap
  11. LEFT JOIN (forum_rel_topics_polls tp) ON ap.id_poll = tp.id_poll
  12. WHERE tp.id_topic='".$_REQUEST['t']."' AND ap.id_account='".$_SESSION['userid']."' GROUP BY tp.id_topic", $MySQL_CON) OR DIE (mysql_error());
  13. if (mysql_num_rows($rowj)==0) {
  14. mysql_query("INSERT INTO forum_rel_account_polls(id_poll, id_account) VALUES('".$_POST['rpoll']."','".$_SESSION['userid']."')", $MySQL_CON);
  15. } else {
  16. $haserrors='You already voted for this Topic.';
  17. }
  18. }
  19. }
  20. unset($_POST["rpoll"]);
  21. }
  22. if ($_REQUEST['post']!='') {
  23. if ($_REQUEST['post']=='new' OR ($_REQUEST['post']=='edit' AND $_REQUEST['r']!='')) {
  24. $forceshow=true;
  25. if ($_REQUEST['post']=='edit' AND $_SERVER['REQUEST_METHOD']!='POST') {
  26. $rowj=mysql_fetch_array(mysql_query("SELECT *, a.gmlevel as gmlvl
  27. FROM forum_posts fp
  28. LEFT JOIN (account a) ON a.id = fp.id_account
  29. WHERE fp.id_post='".$_REQUEST['r']."' AND fp.isreply='1'
  30. ORDER BY `id_post` ASC ", $MySQL_CON));
  31. $rowk=mysql_fetch_array(mysql_query("SELECT id_account FROM forum_posts WHERE id_topic='".$_REQUEST['t']."' ORDER BY `id_post` DESC LIMIT 0, 1", $MySQL_CON));
  32. if ($_SESSION['userid']==$rowj['id_account'] AND ($SETTING['USER_EDIT_OWN_POSTS']=='1' OR ($SETTING['USER_EDIT_OWN_POSTS']=='2' AND $rowk['id_account']==$_SESSION['userid'])) OR $userlvl>0) {
  33. $_POST['subject']=$rowj['title'];
  34. $_POST['message']=$rowj['text'];
  35. $_POST['issigned']=$rowj['issignature'];
  36. $_POST['isbbcode']=$rowj['isbbcode'];
  37. } else {
  38. echo '<br><br><br><br>';
  39. errborder('You are not allowed to manage this Reply.');
  40. echo '<br><br><br><br>';
  41. $forceshow=false;
  42. }
  43. } else if ($_REQUEST['post']=='new' AND $_SERVER['REQUEST_METHOD']!='POST') {
  44. $_POST['issigned']='1';
  45. $_POST['isbbcode']='1';
  46. }
  47. ?>
  48. <form name="postForm" id="postForm" action="?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=<?php
  49. if ($_REQUEST['post']=='new') {
  50. echo 'new';
  51. } else if ($_REQUEST['post']=='edit') {
  52. echo 'edit&r='.$_REQUEST['r'];
  53. }
  54. ?>" method="post"><?php
  55. if ($_POST['issigned']=='') { $_POST['issigned']='0'; } else if ($_POST['issigned']!='0') { $_POST['issigned']='1'; }
  56. if ($_POST['isbbcode']=='') { $_POST['isbbcode']='0'; } else if ($_POST['isbbcode']!='0') { $_POST['isbbcode']='1'; }
  57. if ($_POST['newpost']=='post') {
  58. if (strlen($_POST['message'])<5) {
  59. $haserrors.='Message field must have more than 5 characters.<br>';
  60. }
  61. if ($haserrors=='') {
  62. if ($_REQUEST['post']=='new') {
  63. $query = mysql_query("INSERT INTO forum_posts(text, date, hour, isreply, issignature, isbbcode, id_account, id_topic)
  64. VALUES('".$_POST['message']."','".date('Y-m-d')."','".date('H:i:s')."', 1,
  65. '".$_POST['issigned']."','".$_POST['isbbcode']."','".$_SESSION['userid']."','".$_REQUEST['t']."')", $MySQL_CON) OR DIE(mysql_error());
  66. $_REQUEST['r']=mysql_insert_id($MySQL_CON);
  67. } else if ($_REQUEST['post']=='edit') {
  68. $query = mysql_query("UPDATE forum_posts SET `text`='".$_POST['message']."', date_edit='".date('Y-m-d')."',
  69. hour_edit='".date('H:i:s')."', id_account_edit='".$_SESSION['userid']."',
  70. issignature='".$_POST['issigned']."', isbbcode='".$_POST['isbbcode']."' WHERE id_post='".$_REQUEST['r']."'", $MySQL_CON) OR DIE(mysql_error());
  71. }
  72. unset($_POST['subject']);
  73. unset($_POST['message']);
  74. echo '<br><br><br><br>';
  75. goodborder('Your message has been entered successfully.<META HTTP-EQUIV="Refresh" CONTENT="2; URL=?n=forums&t='.$_REQUEST['t'].'#'.$_REQUEST['r'].'">');
  76. viewedtopic($_REQUEST['t']);
  77. echo '<br><br><br><br>';
  78. $forceshow=false;
  79. }
  80. }
  81. if ($forceshow==true) {
  82. remslashall();
  83. ?>
  84. <input type=hidden name="newpost" value='post'>
  85. <div id="post" align=center>
  86. <div class="post-box">
  87. <div class="post-box-bottom">
  88. <div class="post-box-top">
  89. <div id="post-topic-shell">
  90. <div class="resultbox">
  91. <?php if ($haserrors!='') { echo errborder($haserrors); } ?>
  92. <div id="postdisplay">
  93. <div class="border">
  94. <div class="insert">
  95. <blockquote>
  96. <div class="post-top">
  97. <br/>
  98. <!-- end admin-container -->
  99. <br><br>
  100. <!-- end subject-box -->
  101. <!-- end subject-message -->
  102. </div><!-- end subject-container -->
  103. <div class="message-container">
  104. <div class="post-ui-container">
  105. <div id="post-ui" style="width: 266px;">
  106. <div class="post-ui-left">
  107. <div class="post-ui-right"style="width: 266px;">
  108. <script language=javascript src="new-hp/js/quick_reply.js"></script>
  109. <script>
  110. function getTextarea() {
  111. var textarea
  112. textarea = document.postForm.message;
  113. return textarea;
  114. }
  115. </script>
  116. <style>
  117. #post li.bold { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-bold.gif') no-repeat; }
  118. #post li.italic { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-italic.gif') no-repeat; }
  119. #post li.underline { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-underline.gif') no-repeat; }
  120. #post li.list { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-list.gif') no-repeat; }
  121. #post li.left{ background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-left.gif') no-repeat; cursor: hand; }
  122. #post li.center { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-center.gif') no-repeat; cursor: hand; }
  123. #post li.right { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-right.gif') no-repeat; cursor: hand; }
  124. #post li.link { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-link.gif') no-repeat; cursor: hand; }
  125. #post li.image { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-image.gif') no-repeat; cursor: hand; }
  126. #post li.tabbed-list { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-tabbed-list.gif') no-repeat; }
  127. #post li.hr { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-hr.gif') no-repeat; }
  128. #post li.pre { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-pre.gif') no-repeat; }
  129. #post li.quote { background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/button-quote.gif') no-repeat; }
  130. </style>
  131. <ul>
  132. <li class="bold"><a href="javascript:edInsertTag(document.postForm.message, 0);" ><img src="new-hp/images/forum/pixel.gif" alt="bold" onmouseover="ddrivetip('Bold','#ffffff')"; onmouseout="hideddrivetip()" /></a></li>
  133. <li class="italic"><a href="javascript:edInsertTag(document.postForm.message, 1);"><img src="new-hp/images/forum/pixel.gif" alt="italic" onmouseover="ddrivetip('Italic','#ffffff')"; onmouseout="hideddrivetip()" /></a></li>
  134. <li class="underline"><a href="javascript:edInsertTag(document.postForm.message, 2);" ><img src="new-hp/images/forum/pixel.gif" alt="underline" onmouseover="ddrivetip('Underline','#ffffff')"; onmouseout="hideddrivetip()" /></a></li>
  135. <li class="left"><a href="javascript:edInsertTag(document.postForm.message, 3);" ><img src="new-hp/images/forum/pixel.gif" id=bbleft value="B" alt="Left" onmouseover="ddrivetip('Align Left','#ffffff')"; onmouseout="hideddrivetip()" ></a></li>
  136. <li class="center"><a href="javascript:edInsertTag(document.postForm.message, 4);" ><img src="new-hp/images/forum/pixel.gif" id=bbcenter value="I" alt="Center" onmouseover="ddrivetip('Align Center','#ffffff')"; onmouseout="hideddrivetip()" ></a></li>
  137. <li class="right"><a href="javascript:edInsertTag(document.postForm.message, 5);" ><img src="new-hp/images/forum/pixel.gif" id=bbright value="U" alt="Right" onmouseover="ddrivetip('Align Right','#ffffff')"; onmouseout="hideddrivetip()" ></a></li>
  138. <li class="link"><a href="javascript:edInsertLink(document.postForm.message, 2);" ><img src="new-hp/images/forum/pixel.gif" id=bblink value="Link" alt="Link" onmouseover="ddrivetip('Insert URL','#ffffff')"; onmouseout="hideddrivetip()" ></a></li>
  139. <li class="image"><a href="javascript:edInsertImage(document.postForm.message);" ><img src="new-hp/images/forum/pixel.gif" id=bbimage value="Image" alt="Image" onmouseover="ddrivetip('Insert Image','#ffffff')"; onmouseout="hideddrivetip()" ></a></li>
  140. <li class="quote"><a href="javascript:edInsertTag(document.postForm.message, 8);"><img src="new-hp/images/forum/pixel.gif" alt="quote" onmouseover="ddrivetip('Quote','#ffffff')"; onmouseout="hideddrivetip()" /></a></livetip('Quote','#ffffff')"; onmouseout="hideddrivetip()" /></a></li>
  141. </ul>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <div class="message-body-main">
  147. <div class="message-bottom">
  148. <div class="message-top">
  149. <h2><span>Message:</span></h2>
  150. <textarea name="message" id="message" tabindex="4" rows="5" cols="10" class="post-message-text"><?
  151. if ($_REQUEST['q']!='') {
  152. $rowj=mysql_fetch_array(mysql_query("SELECT `text`
  153. FROM forum_posts fp
  154. WHERE id_post='".$_REQUEST['q']."' AND id_topic='".$_REQUEST['t']."'
  155. ORDER BY `id_post` ASC ", $MySQL_CON));
  156. echo '[quote]'.$rowj['text'].'[/quote]';
  157. }
  158. echo $_POST['message'];
  159. ?></textarea>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="options-container">
  165. <div class="options-left">
  166. <div class="options-right">
  167. <div class="options-bot">
  168. <div class="options-top">
  169. <div class="sig-options" style="margin: 4px 30px auto;">
  170. <ul>
  171. <li class="check-box"><input class="button" type="checkbox" id="signed" name="issigned" value="1" checked="true" /></li>
  172. <li class="sig-desc"><label for='signed'>Include signature</label>&nbsp;&nbsp;</li>
  173. </ul>
  174. <img src="new-h/images/pixel.gif" width=0 height=4>
  175. <ul>
  176. <li class="check-box"><input class="button" type="checkbox" id="bbcode" name="isbbcode" value="1" checked="true" /></li>
  177. <li class="sig-desc"><label for='bbcode'>Enable BBCode</label></li>
  178. </ul>
  179. </div><!-- end sig-options-->
  180. <div class="post-button">
  181. <div class="post-button-left">
  182. <div class="post-button-right">
  183. <ul>
  184. <li><input type="image" class="button" src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/preview.gif" onClick="javascript: document.postForm.newpost.value = 'preview'"></li>
  185. <li><input type="image" class="button" src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/post.gif" onClick="javascript: document.postForm.newpost.value = 'post'"></li>
  186. </ul>
  187. </div><!-- end post-button-right -->
  188. </div><!-- end post-button-left -->
  189. </div><!-- end post-button-->
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <!-- end options-container -->
  196. </div><!-- end post-top -->
  197. </blockquote>
  198. </div><!-- end insert -->
  199. </div><!-- end border -->
  200. </div><!-- end postdisplay -->
  201. </div><!-- end resultbox -->
  202. </div><!-- End div postshell -->
  203. </div><!-- end post-box-top -->
  204. </div><!-- end post-box-bottom -->
  205. </div><!-- end post-box -->
  206. </div><!-- end post -->
  207. </form>
  208. <div id="postbackground">
  209. <div class="right">
  210. <!-- Edit/Quoted/Reply Post -->
  211. </div></div>
  212. <div class="forum-index">
  213. <div class="findex">
  214. <a href="?n=forums"><img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/forum-index.gif" width="104" height="41" border="0" alt="forum-index" title="Forum Index" /></a>
  215. </div>
  216. </div>
  217. <script>
  218. document.postForm.issigned.checked=<?php echo $_POST['issigned']; ?>;
  219. document.postForm.isbbcode.checked=<?php echo $_POST['isbbcode']; ?>;
  220. </script>
  221. <?
  222. }
  223. } else if ($_REQUEST['post']=='remove') {
  224. $rowj=mysql_fetch_array(mysql_query("SELECT id_post, isreply, id_account, a.gmlevel as gmlvl
  225. FROM forum_posts fp
  226. LEFT JOIN (account a) ON a.id = fp.id_account
  227. WHERE id_post='".$_REQUEST['r']."'
  228. ORDER BY `id_post` ASC ", $MySQL_CON));
  229. $rowk=mysql_fetch_array(mysql_query("SELECT id_post, id_account FROM forum_posts WHERE id_topic='".$_REQUEST['t']."' ORDER BY `id_post` DESC LIMIT 0, 1", $MySQL_CON));
  230. if ($_SESSION['userid']==$rowj['id_account'] AND ($SETTING['USER_REMOVE_OWN_POSTS']=='1' OR ($SETTING['USER_REMOVE_OWN_POSTS']=='2' AND $rowk['id_account']==$_SESSION['userid'])) OR $userlvl>0) {
  231. if ($_SERVER['REQUEST_METHOD']=='POST') {
  232. if ($rowj['isreply']=='0' AND $rowj['id_post']==$rowk['id_post']) {
  233. mysql_query("DELETE FROM forum_topics WHERE id_topic='".$_REQUEST['t']."'", $MySQL_CON);
  234. } else {
  235. $rowd = mysql_query("SELECT id_post FROM forum_posts WHERE isreply='1' AND id_topic='".$_REQUEST['t']."' ORDER BY id_post ASC LIMIT 0, 1", $MySQL_CON) OR DIE (mysql_error());
  236. $rowd = mysql_fetch_array($rowd);
  237. mysql_query("UPDATE forum_posts SET isreply=0 WHERE id_post='".$rowd['id_post']."'", $MySQL_CON);
  238. }
  239. if (mysql_query("DELETE FROM forum_posts WHERE id_post='".$_REQUEST['r']."'", $MySQL_CON)) {
  240. echo '<br><br><br><br>';
  241. goodborder('Reply Removed Successfuly.<META HTTP-EQUIV="Refresh" CONTENT="1; URL=?n=forums&f='.$rowz['id_forum'].'">');
  242. echo '<br><br><br><br>';
  243. } else {
  244. echo '<br><br><br><br>';
  245. errborder('Couldn\'t Remove Reply.');
  246. echo '<br><br><br><br>';
  247. }
  248. } else {
  249. $forceshow=true;
  250. }
  251. } else {
  252. echo '<br><br><br><br>';
  253. errborder('You are not allowed to Remove this Reply.');
  254. echo '<br><br><br><br>';
  255. $forceshow=false;
  256. }
  257. if ($forceshow==true) {
  258. ?>
  259. <br><br><br><br>
  260. <div align=center><form method=post action='?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=<?php echo $_REQUEST['post']; ?>&r=<?php echo $_REQUEST['r']; ?>'><div align=center style="width: 200px; border: 2px solid orange; color: white;"><br>You sure you want to Remove this Reply?<br><br>
  261. <input style="width: 90px; height: 30px;" onclick="window.location='<?php echo $_SERVER['HTTP_REFERER']; ?>'" type=button value="No">&nbsp;&nbsp;<input style="width: 90px; height: 30px;" type=submit value="Yes">
  262. <br><br></div></form></div>
  263. <br><br><br><br>
  264. <?
  265. }
  266. } else if ($_REQUEST['post']=='report') {
  267. $rowj=mysql_fetch_array(mysql_query("SELECT *, a.gmlevel as gmlvl
  268. FROM forum_posts fp
  269. LEFT JOIN (account a) ON a.id = fp.id_account
  270. WHERE id_post='".$_REQUEST['r']."'
  271. ORDER BY `id_post` ASC ", $MySQL_CON));
  272. if ($_SESSION['userid']!=$rowj['id_account'] AND $rowj['gmlvl']==0 and $userlvl==0) {
  273. if ($_SERVER['REQUEST_METHOD']=='POST') {
  274. if (mysql_query("INSERT INTO forum_reports(id_post, id_account, reason) VALUES ('".$_REQUEST['r']."','".$_SESSION['userid']."','".$_POST['message']."')", $MySQL_CON)) {
  275. echo '<br><br><br><br>';
  276. goodborder('Reply Sent Successfuly.<META HTTP-EQUIV="Refresh" CONTENT="1; URL=?n=forums&t='.$_REQUEST['t'].'">');
  277. echo '<br><br><br><br>';
  278. unset($_POST['message']);
  279. } else {
  280. errborder('Couldn\'t Send the Report.');
  281. echo '<br>';
  282. $forceshow=true;
  283. }
  284. } else {
  285. $forceshow=true;
  286. }
  287. } else {
  288. echo '<br><br><br><br>';
  289. errborder('You are not allowed to Report this Reply.');
  290. echo '<br><br><br><br>';
  291. $forceshow=false;
  292. }
  293. if ($forceshow==true) {
  294. ?>
  295. <form name="postForm" id="postForm" action="?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=report&r=<?php echo $_REQUEST['r']; ?>" method="post" onsubmit="javascript: return checkPostForm();">
  296. <input type=hidden name="newpost" value='post'>
  297. <script>
  298. function checkPostForm() {
  299. return true;
  300. }
  301. </script>
  302. <div id="post" align=center>
  303. <div class="post-box">
  304. <div class="post-box-bottom">
  305. <div class="post-box-top">
  306. <div id="post-topic-shell">
  307. <div class="resultbox">
  308. <div id="postdisplay">
  309. <div class="border">
  310. <div class="insert">
  311. <blockquote>
  312. <div class="post-top">
  313. <br/>
  314. <!-- end admin-container -->
  315. <br><br>
  316. <!-- end subject-box -->
  317. <!-- end subject-message -->
  318. </div><!-- end subject-container -->
  319. <div class="message-container">
  320. <div class="message-body-main">
  321. <div class="message-bottom">
  322. <div class="message-top">
  323. <h2><span>Message:</span></h2>
  324. <textarea maxlength=255 name="message" id="message" tabindex="4" rows="5" cols="10" class="post-message-text"><?php echo $_POST['message'] ?></textarea>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. <div align=right style="position:relative; right: 45px;"><input style="width: 90px; height: 30px;" type=submit value="Send"><br><br></div>
  330. </div><!-- end post-top -->
  331. </blockquote>
  332. </div><!-- end insert -->
  333. </div><!-- end border -->
  334. </div><!-- end postdisplay -->
  335. </div><!-- end resultbox -->
  336. </div><!-- End div postshell -->
  337. </div><!-- end post-box-top -->
  338. </div><!-- end post-box-bottom -->
  339. </div><!-- end post-box -->
  340. </div><!-- end post -->
  341. </form>
  342. <div id="postbackground">
  343. <div class="right">
  344. <!-- Edit/Quoted/Reply Post -->
  345. </div></div>
  346. <div class="forum-index">
  347. <div class="findex">
  348. <a href="?n=forums"><img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/forum-index.gif" width="104" height="41" border="0" alt="forum-index" title="Forum Index" /></a>
  349. </div>
  350. </div>
  351. <?
  352. }
  353. } else {
  354. echo '<br><br><br><br>';
  355. errborder('Invalid Function!');
  356. echo '<br><br><br><br>';
  357. }
  358. } else {
  359. function imecho($mail='',$name='') {
  360. if ($mail!='') {
  361. echo '<div class="userpanel2" style="position: relative; float: right;">
  362. <a href="mailto:'.$mail.'"><img border=0 src="new-hp/images/im/im_'.$name.'.gif" onmouseover="ddrivetip(\''.$name.': '.$mail.'\',\'#ffffff\');" onmouseout="hideddrivetip()" alt="view posts by this user"></a>
  363. </div>';
  364. }
  365. } ?>
  366. <table cellspacing="0" cellpadding="1" border="0" width="100%" class="board-clear">
  367. <tr>
  368. <td class="tableoutline">
  369. <table cellspacing="0" cellpadding="0" border="0" width="100%" class="tableoutline">
  370. <tr>
  371. <td align=center>
  372. <div class="theader">
  373. <div class="lpage-thread">
  374. <div id="topicview" style="font-weight: normal;">
  375. <ul>
  376. <?php if($rowz['st']=='0' AND $rowz['poll']=='') { ?><li><span title="General Thread"><img src="new-hp/images/forum/icons/index-icon.gif" width="14" height="15" border="0" alt= "General Thread" /></span></li><?php } ?>
  377. <?php if((($rowz['ftplvl'][$k]>0 AND $userlvl<0) OR ($rowz['ftplvl'][$k]>$userlvl AND $userlvl>=0)) OR (($rowz['postlevel'][$k]>0 AND $userlvl<0) OR ($rowz['postlevel'][$k]>$userlvl AND $userlvl>=0))) { ?><li><span title="Locked Thread"><img src="new-hp/images/forum/icons/lock-icon.gif" alt="Locked Thread" border="0" height="16" width="15"></span></li><?php } ?>
  378. <?php if($rowz['st']=='1') { ?><li><span title="Sticky thread"><img src="new-hp/images/forum/icons/sticky.gif" alt="Sticky thread" border="0" height="15" width="22"></span></li><?php } ?>
  379. <?php if($rowz['poll']!='') { ?><li><span title="Poll thread"><img src="new-hp/images/forum/icons/poll.gif" alt="Sticky thread" border="0" height="15" width="22"></span></li><?php } ?>
  380. <?php
  381. if ($_REQUEST['p']=='' OR alphanum($_REQUEST['p'],true,false)==false) { $_REQUEST['p']=1; }
  382. $topicid = mysql_query("SELECT *, DATE_FORMAT(CONVERT_TZ(CONCAT(`date`, ' ', `hour`), '".$GMT[$SETTING['WEB_GMT']][0]."', '".$usergmt."'), '%d-%m-%Y') as date,
  383. DATE_FORMAT(CONVERT_TZ(CONCAT(`date`, ' ', `hour`), '".$GMT[$SETTING['WEB_GMT']][0]."', '".$usergmt."'), '%H:%i %p') as houri,
  384. TIMESTAMPDIFF(MINUTE, CONCAT(`date`, ' ', `hour`), NOW()) as datei,
  385. DATE_FORMAT(fa.bday, '%d/%m/%Y') as bday, TIMESTAMPDIFF(YEAR, fa.bday, NOW()) as bage, fa.ismvp as ismpv,
  386. fa.displayname as dn, fa.avatar as avatar, fa.signature as signature, a.gmlevel as gmlvl, a.username
  387. FROM forum_posts fp
  388. LEFT JOIN (account a) ON a.id = fp.id_account
  389. LEFT JOIN (forum_accounts fa) ON fa.id_account = fp.id_account
  390. WHERE id_topic='".$_REQUEST['t']."'
  391. ORDER BY `id_post` ASC
  392. LIMIT " .(($_REQUEST['p']-1)*$tppage). ", ".$tppage, $MySQL_CON) or die (mysql_error());
  393. $i=2;
  394. $j=0;
  395. while ($rowm = mysql_fetch_array($topicid)) {
  396. $avatar = explode('/', $rowm['avatar']);
  397. if ($avatar[0]!='gm' AND $avatar[0]!='mvp' AND $avatar[0]!='nochar') {
  398. $qquery = mysql_query("SELECT *, rs.dbhost as rsdbhost, rs.dbport as rsdbport,rs.dbuser as rsdbuser,
  399. rs.dbpass as rsdbpass,rs.dbname as rsdbname FROM `realmlist` r LEFT JOIN (`realm_settings` rs) ON r.id = rs.id_realm
  400. WHERE r.id='".$avatar[1]."' GROUP BY r.id ORDER BY r.name", $MySQL_CON) OR DIE(mysql_error());
  401. if (mysql_num_rows($qquery)==1) {
  402. $rowg = mysql_fetch_array($qquery);
  403. $newcon = @mysql_connect($rowg['rsdbhost'].':'.$rowg['rsdbport'], $rowg['rsdbuser'], $rowg['rsdbpass']);;
  404. $newdb = @mysql_select_db ($rowg['rsdbname'], $newcon);
  405. $newquery = @mysql_query("SELECT c.name as name, data, class, race, g.name as guild
  406. FROM `characters` c
  407. LEFT JOIN guild_member gm ON gm.guid = c.guid
  408. LEFT JOIN guild g ON g.guildid = gm.guildid
  409. WHERE `account`='".$rowm['id_account']."' AND c.guid=".$avatar[0]." GROUP BY c.guid", $newcon) OR DIE (mysql_error());
  410. if (mysql_num_rows($newquery)==1) {
  411. $rowc = @mysql_fetch_array($newquery);
  412. $rowc['data'] = explode(' ',$rowc['data']);
  413. $char_gender = str_pad(dechex($rowc['data'][36]),8, 0, STR_PAD_LEFT);
  414. $char_gender = $char_gender{3};
  415. $charset[0]=$rowc['name'];
  416. $charset[1]=$rowc['data'][34];
  417. $charset[2]=$rowc['race'];
  418. $charset[3]=$char_gender;
  419. $charset[4]=$rowc['class'];
  420. $charset[5]=$rowg['name'];
  421. $charset[6]=$rowc['guild'];
  422. $charset[7]=$rowc['data'][1416];
  423. } else {
  424. resetavatar($rowm['id_account']);
  425. $rowm['avatar']='nochar';
  426. unset($charset);
  427. }
  428. } else {
  429. resetavatar($rowm['id_account']);
  430. $rowm['avatar']='nochar';
  431. unset($charset);
  432. }
  433. @mysql_select_db($MySQL_Set['DBREALM'], $MySQL_CON);
  434. } else if (($avatar[0]=='gm' AND $rowm['gmlevel']>0) OR ($avatar[0]=='mvp' AND $rowm['ismvp']=='1')) {
  435. if (!file_exists('new-hp/images/forum/portraits/'.$rowm['avatar'])) {
  436. resetavatar($rowm['id_account']);
  437. $rowm['avatar']='nochar';
  438. unset($charset);
  439. }
  440. } else {
  441. resetavatar($rowm['id_account']);
  442. $rowm['avatar']='nochar';
  443. unset($charset);
  444. }
  445. $j++;
  446. if ($i=='2') { $i='1'; } else { $i='2'; }
  447. if ($j==1) {
  448. if ($rowz['postlevel']>$rowm['postlevel']) { $rowm['postlevel']=$rowz['postlevel']; }
  449. ?>
  450. <li><span title="<?php echo $rowz['ttitle']; ?>" class="white"><small><b>&nbsp;Topic&nbsp;<a href="?n=forums&t=<?php echo $rowz['id_topic']; ?>" class="active"><?php echo $rowz['ttitle']; ?></a></b></span></li>
  451. <li><span title="Current Time" class="white">&nbsp; | &nbsp;<?php echo $rowm['date'].' at '.$rowm['houri']; ?>&nbsp;</small></span></li>
  452. </ul>
  453. </div><!-- end topicview -->
  454. </div><!-- end lpage-thread -->
  455. <div class="rpage-thread">
  456. <?
  457. $qqueryb = mysql_query("SELECT id_topic FROM `forum_posts` WHERE `id_topic`='".$_REQUEST['t']."'", $MySQL_CON) or die (mysql_error());
  458. $pagination = '<table cellpadding = "0" cellspacing = "0" border = "0"><tr>'. pages($_REQUEST['p'], mysql_num_rows($qqueryb), $tppage, '?n=forums&t='.$_REQUEST['t'], '&nbsp;.&nbsp;', $arrows=true).'</tr></table>';
  459. echo $pagination;
  460. ?>
  461. </div><!-- end rpage-thread -->
  462. </div><!-- end theader -->
  463. <div id="postbackground" align=center>
  464. <div class="right">
  465. <?php if ($haserrors!='') { echo errborder($haserrors); } ?>
  466. <?php if ($rowz['poll'] != '') {
  467. $qpoll = mysql_query("SELECT id_poll, name FROM forum_rel_topics_polls WHERE id_topic='".$_REQUEST['t']."' ORDER BY id_poll", $MySQL_CON) or die (mysql_error());
  468. $rowj=mysql_num_rows(mysql_query("SELECT * FROM forum_rel_account_polls ap
  469. LEFT JOIN (forum_rel_topics_polls tp) ON ap.id_poll = tp.id_poll
  470. WHERE tp.id_topic='".$_REQUEST['t']."' AND ap.id_account='".$_SESSION['userid']."' GROUP BY tp.id_topic", $MySQL_CON));
  471. ?>
  472. <div id = "postshell<?php echo $i; ?>1">
  473. <div class = "resultbox">
  474. <div class="postdisplay">
  475. <div class = "border">
  476. <div class = "postingcontainer<?php echo $i; ?>1" style="background: none; background-color: #191919;">
  477. <div align=center><small><br></small>
  478. <div class="options-container" style="background-color: #222222;"><!-- POLL!-->
  479. <div style="position: absolute;">
  480. <img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/poll.gif">
  481. </div>
  482. <div class="options-left">
  483. <div class="options-right" align=left>
  484. <div class="options-bot" style="height: <?php echo (140+$sc+(mysql_num_rows($qpoll))*30) ?>px;">
  485. <div style="color: #FFFFFF; text-align: right; width: 620px; position: absolute;">
  486. <br>
  487. <small><?php
  488. $pollcalc = mysql_fetch_array(mysql_query("SELECT TIMESTAMPDIFF(MINUTE, NOW(), INTERVAL ".$rowz['poll_lasts']." DAY + '".$rowz['poll_stamp']."')"));
  489. if ($rowz['poll_lasts']==0) {
  490. echo 'This Poll Never Ends';
  491. } else if ($pollcalc[0]>0){
  492. echo 'This Poll Ends in '.convdate($pollcalc[0]);
  493. } else {
  494. echo 'This Poll Ended '.convdate($pollcalc[0]).' Ago';
  495. } ?></small>
  496. </div>
  497. <div class="options-top">
  498. <div class="sig-options" style="width: 600px;" align=center>
  499. <br><br>
  500. <span class="help-tip">
  501. <?php
  502. if ($rowj==0 AND isset($_SESSION['userid'])) {
  503. ?>
  504. <script>
  505. function va_vote(btn) {
  506. var cnt = false;
  507. for (var i=0; i < btn.length; i++) {
  508. if (btn[i].checked) { cnt = true; break; }
  509. }
  510. if (cnt == false) { alert('Please, select an option!'); return false; }
  511. else { return true; }
  512. }
  513. </script>
  514. <form name="fpoll" method=post action="?n=forums&t=<?php echo $_REQUEST['t']; ?>" onSubmit="return va_vote(this.rpoll);">
  515. <table cellpadding=3 cellspacing=3 border=0 style="color: white;">
  516. <tr>
  517. <td align=center style="font-weight: bold;" colspan=2><?php echo $rowz['poll']; ?><br>
  518. <img src="new-hp/images/pixel.gif" height=3><br>
  519. <img src="new-hp/images/pixel.gif" style="background-color: orange; width: 270px; height: 1px"></td>
  520. </tr>
  521. <?
  522. while ($rowpoll = mysql_fetch_array($qpoll)) {
  523. echo '<tr><td><input type=radio id="rpollid'.$rowpoll['id_poll'].'" name="rpoll" value="'.$rowpoll['id_poll'].'"><label for="rpollid'.$rowpoll['id_poll'].'">&nbsp;&nbsp;'.$rowpoll['name'].'</label><br></td></tr>';
  524. }
  525. ?>
  526. <tr>
  527. <td align=center><input type=submit value="Vote"></td>
  528. <tr>
  529. </table>
  530. </form>
  531. <? } else { ?>
  532. <table cellpadding=3 cellspacing=3 border=0 style="color: white;">
  533. <tr>
  534. <td align=center style="font-weight: bold;" colspan=2><?php echo $rowz['poll']; ?><br>
  535. <img src="new-hp/images/pixel.gif" height=3><br>
  536. <img src="new-hp/images/pixel.gif" style="background-color: orange; width: 270px; height: 1px"></td>
  537. </tr>
  538. <?
  539. $pollcount=mysql_query("SELECT ap.id_poll as id_poll FROM forum_rel_topics_polls tp
  540. LEFT JOIN (forum_rel_account_polls ap) ON ap.id_poll = tp.id_poll
  541. WHERE tp.id_topic='".$_REQUEST['t']."'", $MySQL_CON) or die (mysql_error());
  542. while ($rowpoll = mysql_fetch_array($pollcount)) {
  543. if ($rowpoll['id_poll']!='') {
  544. $totalpoll+=1;
  545. $newpoll[$rowpoll['id_poll']]+=1;
  546. }
  547. }
  548. while ($rowpoll = mysql_fetch_array($qpoll)) {
  549. echo '<tr><td>'.$rowpoll['name'].' (';
  550. echo $newpoll[$rowpoll['id_poll']]?$newpoll[$rowpoll['id_poll']]:'0';
  551. echo ')<br></td><td width=10 align=right>';
  552. echo $newpoll[$rowpoll['id_poll']]?round($newpoll[$rowpoll['id_poll']]/$totalpoll*100, 0):'0';
  553. echo '%</td></tr>';
  554. }
  555. ?>
  556. <tr>
  557. <td align=center colspan=2><small><br><?php echo isset($_SESSION['userid'])?'You already voted in this topic.':'You must be logged in order to vote!'; ?><small></td>
  558. <tr>
  559. </table>
  560. <? } ?>
  561. </span>
  562. </div>
  563. </div>
  564. </div>
  565. </div>
  566. </div>
  567. </div>
  568. </div>
  569. </div>
  570. </div>
  571. </div>
  572. </div>
  573. </div>
  574. <?php } ?>
  575. <!-- Main Post Body -->
  576. <?php } ?>
  577. <a name="<?php echo $rowm['id_post']; ?>"></a>
  578. <div id = "postshell<?php echo $i; ?>1">
  579. <div class = "resultbox">
  580. <?php if ($avatar[0]=='nochar') { ?>
  581. <style>
  582. div.framenochar<? if ($rowm['gmlevel']>0) { echo 'blizz'; } ?> {
  583. background: url('new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/no-character-icon<?php if ($rowm['gmlevel']>0) { echo '-blizz'; } ?>.gif');
  584. }
  585. </style>
  586. <? } ?>
  587. <div class="postdisplay">
  588. <div class = "border">
  589. <div class = "postingcontainer<?php echo $i; ?>1">
  590. <div class = "insert">
  591. <table id = "posttable<?php echo $i; ?>1" cellpadding = "0" cellspacing = "0">
  592. <tr>
  593. <td class = "id<? if ($rowm['gmlevel'] > 0 ) { echo 'bliz'; } else if ($rowm['ismvp'] > 0 ) { echo 'mvp'; } ?><?php echo $i; ?>1" rowspan = "2" valign=bottom>
  594. <!-- Begin Avatar Panel -->
  595. <div>
  596. <div id="avatar<?php echo $i; ?>1">
  597. <div class="shell">
  598. <table cellspacing="0" cellpadding="0" border="0">
  599. <tr>
  600. <td style="background: url(new-hp/images/forum/portraits/<?
  601. if ($rowm['avatar']!='nochar' AND $avatar[0]!='gm' AND $avatar[0]!='mvp') {
  602. if ($charset[1]=='70') { echo 'wow-70/'; }
  603. else if ($charset[1]>='60') { echo 'wow/'; }
  604. else { echo 'wow-default/'; }
  605. echo $charset[3].'-'.$charset[2].'-'.$charset[4].'.gif';
  606. } else {
  607. echo $rowm['avatar'];
  608. } ?>); width: 64px; height: 64px; vertical-align: bottom;">
  609. </td>
  610. </tr>
  611. </table>
  612. <div class="frame<?php if ($rowm['avatar']=='nochar') { echo 'nochar'; if ($rowm['gmlevel']>0) { echo 'blizz'; } }?>">
  613. <a href="#armory=<? echo $rowm['id']; ?>" target="_blank"><img src="new-hp/images/forum/pixel.gif" width="82" height="83" border="0" alt="" /></a>
  614. </div>
  615. </div><!-- end shell -->
  616. <div style="position: relative;">
  617. <div class="iconPosition">
  618. <b><small><?php
  619. if ($rowm['avatar']!='nochar' AND $avatar[0]!='gm' AND $avatar[0]!='mvp') {
  620. echo $charset[1];
  621. } else if (($rowm['avatar']=='nochar' OR $avatar[0]=='gm') AND $rowm['gmlevel']>'0') {
  622. echo '<img src="new-hp/images/forum/icons/blizz.gif">';
  623. } else if (($rowm['avatar']=='nochar' OR $avatar[0]=='mvp') AND $rowm['ismvp']=='1') {
  624. echo '<img src="new-hp/images/forum/icons/modr-small.gif">';
  625. }
  626. ?></small></b>
  627. </div>
  628. <!-- //Begin Character ID Panel// -->
  629. <? if ($rowm['avatar']!='nochar' AND $avatar[0]!='gm' AND $avatar[0]!='mvp') { ?><div id="iconpanelhide<?php echo $i; ?>1">
  630. <div id="iconpanel"></div>
  631. <div id="default-icon-panel">
  632. <div class="player-icons-race" style="background: url('new-hp/images/forum/icons/race/<?php echo $charset[2].'-'.$charset[3]; //RACE, GENDER ?>.gif') no-repeat;" onmouseover="ddrivetip('<b><?php echo $CHAR_RACE[$charset[2]][0]; ?></b>','#ffffff');" onmouseout="hideddrivetip()">
  633. <img src = "new-hp/images/forum/pixel.gif" height="18" width="18" alt="" />
  634. </div>
  635. <div class="player-icons-class" style="background: url('new-hp/images/forum/icons/class/<?php echo $charset[4]; //CLASS ?>.gif') no-repeat;" onmouseover="ddrivetip('<b><?php echo $CHAR_CLASS[$charset[4]]; ?></b><br><i>Click to View Talent Build</i>','#ffffff');" onmouseout="hideddrivetip()">
  636. <a href="#armory" target="_blank"><img src="new-hp/images/forum/icons/icon-active.png" alt="" class="png" border="0" height="18" width="18" /></a>
  637. </div>
  638. <div class="player-icons-pvprank" style="background: url('new-hp/images/forum/icons/pvpranks/rank<?php echo pvp_ranks($charset[7],$CHAR_RACE[$rowc['race']][1]); //RANK ?>.gif') no-repeat;" onmouseover="ddrivetip('<b>Rank: <?php echo $CHAR_RANK[$CHAR_RACE[$rowc['race']][1]][pvp_ranks($charset[7])]; //RANK ?></b><br><i>Lifetime Highest PvP Rank</i>','#ffffff');" onmouseout="hideddrivetip()"></div>
  639. </div>
  640. </div><? } ?>
  641. </div><!-- end shell -->
  642. </div><!-- end avatar collapse -->
  643. </div><!-- end avatar -->
  644. <!-- //End Avatar Panel// -->
  645. <!-- //Begin Character Control Panel// -->
  646. <div style="position: relative; width: 200px;">
  647. <div class="userpanel">
  648. <a href="#"><img class="icon-search" src="new-hp/images/forum/icons/search.gif" onmouseover="ddrivetip('View All Posts by This User','#ffffff');" onmouseout="hideddrivetip()" alt="view posts by this user"></a>
  649. <!--<a href="javascript: collapse(648806676);"><img class="icon-ignore" src="new-hp/images/forum/icons/ignore-user.gif" id="ignore976013081_648806676_switch1" onmouseover="ddrivetip('Toggle Ignore / Unignore This User','#ffffff');" onmouseout="hideddrivetip()" alt="ignore" /></a>-->
  650. </div>
  651. </div>
  652. <?php if ($rowm['username']!='') { ?>
  653. <div style="position: relative; width: 200px; top: 36px;">
  654. <div class="userpanel3" style="padding: 7px 5px 0px 0px;">
  655. <? if (@mysql_num_rows(@mysql_query("SELECT id FROM web_online WHERE id='".$rowm['id_account']."'", $MySQL_CON))>0) { ?>
  656. <img src="new-hp/images/favicon.gif" width=16 height=16 border=0 onmouseover="ddrivetip('On-Line','#ffffff');" onmouseout="hideddrivetip()" alt="view posts by this user">
  657. <? } else { ?>
  658. <img src="new-hp/images/favicon-bnw.gif" border=0 onmouseover="ddrivetip('Off-Line','#ffffff');" onmouseout="hideddrivetip()" alt="view posts by this user">
  659. <? } ?>
  660. </div>
  661. </div>
  662. <?php } ?>
  663. <!-- End Character Control Panel -->
  664. <!-- Begin Character Information Display -->
  665. <div style="position: relative; width: 200px;">
  666. <? if (($avatar[0]!='gm' AND $avatar[0]!='nochar') OR ($avatar[0]=='nochar' AND $rowm['gmlevel']<'1')) { ?>
  667. <div class="pinfo">
  668. <div id="pinfobackground_switch<? echo $i; ?>" class="pinfobackground">
  669. <span style="font-size: 12px; line-height: 1.8em; color: white;"><b style="color:#ffac04;"><a href="#armory" target="_blank" <? if ($charset[0]!='') { echo 'onmouseover="ddrivetip(\''.$rowm['dn']; if ($rowm['gmlevel']>0) { echo ' <img src=new-hp/images/forum/icons/blizz.gif>'; } echo '\',\'#ffffff\');" onmouseout="hideddrivetip()"'; } ?>><?php if ($charset[0]!='') { echo $charset[0]; } else { echo $rowm['dn']; } ?></a></b><br>
  670. <?php if ($rowm['username']=='') { echo '<a href="#">Ghost Account</a>'; } ?>
  671. <?php if ($charset[6]!='') { ?><b><a href="#armory" target="_blank">&lt; <?php echo $charset[6]; //Guild ?> &gt;</a></b><br><?php } ?>
  672. <b><?php echo $charset[5]; ?></b></span>
  673. </div><!-- end pinfobackground -->
  674. </div><!-- end pinfo -->
  675. <div>
  676. <div class="pinfobottom">
  677. <div class="pifooter"></div>
  678. </div>
  679. </div>
  680. <? } else { ?>
  681. <div style="padding-top: 5px;"></div>
  682. <span><b style="color:#ffac04; font-size:12;"><?php echo $rowm['dn'] ?></b></span>
  683. <div id="afterAvatar_switch<?php echo $i; ?>">
  684. <small><span class="blue"><?php if ($rowm['id_account']==$SETTING['SERVER_OWNER']) { echo 'Owner'; } else { echo $USER_LEVEL[$rowm['gmlevel']]; } ?></span></small>
  685. </div>
  686. <? } ?>
  687. </div>
  688. <!-- //End Character Display// --><!-- //grabs character info -->
  689. <?php if ($rowm['bday']!='00/00/0000' AND $rowm['showbday']>'0' OR $rowm['showlocation']>'0') { ?>
  690. <div style="position: relative; color: white; font-size: 11px; left: 15px" align=left>
  691. <br>
  692. <table cellpadding=0 cellspacing=0 border=0>
  693. <?php
  694. if ($rowm['bday']!='00/00/0000' AND $rowm['showbday']>'0') {
  695. echo '<tr><td colspan=2 style="color: white; font-size: 12px; vertical-align: middle">';
  696. if ($rowm['showbday']=='2') { echo $rowm['bage'].' years'; }
  697. else if ($rowm['showbday']=='1') { echo $rowm['bday']; }
  698. else if ($rowm['showbday']=='3') { echo $rowm['bday']. ', ' .$rowm['bage'].' years'; }
  699. echo '</td></tr>';
  700. }
  701. if ($rowm['showlocation']>'0') {
  702. echo '<tr><td style="color: white; font-size: 12px; vertical-align: middle">'.$rowm['city'].', '. $COUNTRY[$rowm['location']].'</td>
  703. <td><img src="new-hp/images/pixel.gif" style="background: url(new-hp/images/flags/'.$rowm['location'].'.gif) no-repeat 0px -6px;" width=32 height=20></td></tr>';
  704. }
  705. $ttpost=@mysql_num_rows(@mysql_query("SELECT id_post FROM forum_posts WHERE id_account='".$rowm['id_account']."'", $MySQL_CON));
  706. echo '<tr><td colspan=2 style="color: white; font-size: 12px; vertical-align: middle">Posts: '.number_format ($ttpost).'<td></tr>';
  707. ?>
  708. </table>
  709. </div>
  710. <?php } ?>
  711. <?php if ($rowm['msn']!='' OR $rowm['yahoo']!='' Or $rowm['skype']!='' Or $rowm['aim']!='' or $rowm['icq']!='') { ?>
  712. <div style="position: relative; color: white; font-size: 11px" align=center>
  713. <? if ($rowm['msn']!='') { imecho($rowm['msn'],'MSN'); }
  714. if ($rowm['skype']!='') { imecho($rowm['skype'],'Skype'); }
  715. if ($rowm['yahoo']!='') { imecho($rowm['yahoo'],'Yahoo'); }
  716. if ($rowm['icq']!='') { imecho($rowm['icq'],'ICQ'); }
  717. if ($rowm['aim']!='') { imecho($rowm['aim'],'AIM'); }
  718. ?>
  719. <br>
  720. </div>
  721. <?php } ?>
  722. </td>
  723. <td class = "tools<?php echo $i; ?>1" style="height: 32px;">
  724. <!-- Begin Post Info -->
  725. <div id="postid<?php echo $i; ?>1">
  726. <ul>
  727. <li style="display:table-cell;"><a href="#<?php echo $rowm['id_post']; ?>" style="font-size: 12px; color: white; text-decoration: none;"><span><? echo ($j + (($_REQUEST['p']-1)* $tppage)); ?>.&nbsp;&nbsp;|&nbsp;&nbsp;<? echo $rowm['date']. ' at '.$rowm['houri']; ?></span></a></li>
  728. </ul>
  729. </div>
  730. <!-- End Post Info --><!-- //grabs post title info -->
  731. <!-- Begin Post Control Panel -->
  732. <div class="miniadmin">
  733. <ul>
  734. <!-- Post Admin -->
  735. <?php if ($rowm['gmlevel']>'0') {
  736. $blizzreply = mysql_query("SELECT id_post, a.gmlevel as gmlvl FROM `forum_posts` fp
  737. LEFT JOIN (`account` a) ON fp.id_account = a.id
  738. WHERE fp.id_post>'".$rowm['id_post']."' AND fp.id_topic='".$_REQUEST['t']."'
  739. ORDER BY `id_post` ASC", $MySQL_CON) or die (mysql_error());
  740. $iblizz=0;
  741. while ($rowblizz = mysql_fetch_array($blizzreply)) {
  742. $iblizz++;
  743. if ($rowblizz['gmlvl']>0) {
  744. $totalpages=($iblizz+$j)/$tppage;
  745. $totalpages=explode(".", $totalpages);
  746. if ($totalpages[1]!=0) { $totalpages[0]+=1; }
  747. echo '<a href="';
  748. if ($_REQUEST['p']!=$totalpages[0]) { echo '?n=forums&t='.$_REQUEST['t'].'&p='.$totalpages[0]; }
  749. echo '#'.$rowblizz['id_post'].'"><img src="new-hp/images/forum/icons/blizz-post.gif" border="0" title="Next Blizzard Post" alt="quote" /></a>';
  750. break;
  751. }
  752. }
  753. }
  754. if ($rowz['ftplvl']<=$userlvl AND $rowz['postlevel']<=$userlvl) {
  755. if ($rowm['gmlevel']=='0' AND $rowm['id_account']!=$_SESSION['userid'] AND $userlvl==0) { ?>
  756. <a href="?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=report&r=<?php echo $rowm['id_post']; ?>"><img src="new-hp/images/forum/biohazard-button.gif" border="0" title="Quote this post" alt="quote" /></a>
  757. <?php }
  758. if ($_SESSION['userid']==$rowm['id_account'] AND ($SETTING['USER_EDIT_OWN_POSTS']=='1' OR ($SETTING['USER_EDIT_OWN_POSTS']=='2' AND $j==mysql_num_rows($qqueryb))) OR $userlvl>0) { ?>
  759. <a href="?n=forums&t=<?php echo $_REQUEST['t']; ?>&<?php if ($rowm['isreply']=='0') { echo 'topic'; } else { echo 'post'; } ?>=edit&r=<?php echo $rowm['id_post']; ?>"><img src="new-hp/images/v2/edit.gif" border="0" title="Edit this Reply" alt="quote" /></a>
  760. <?
  761. }
  762. if ($_SESSION['userid']==$rowm['id_account'] AND ($SETTING['USER_REMOVE_OWN_POSTS']=='1' OR ($SETTING['USER_REMOVE_OWN_POSTS']=='2' AND $j==mysql_num_rows($qqueryb))) OR $userlvl>0) { ?>
  763. <a href="?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=remove&r=<?php echo $rowm['id_post']; ?>"><img src="new-hp/images/v2/remove.gif" border="0" title="Remove this Reply" alt="reply" /></a>
  764. <? }?>
  765. <a href="?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=new&q=<?php echo $rowm['id_post']; ?>"><img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/quote-button.gif" width="63" height="18" border="0" title="Quote this post" alt="quote" /></a>
  766. <a href="?n=forums&t=<?php echo $_REQUEST['t']; ?>&post=new"><img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/reply-button.gif" width="63" height="18" border="0" title="Reply to this post" alt="reply" /></a>
  767. <?php } else { ?>
  768. <img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/quote-button-inactive.gif" width="63" height="18" border="0" />
  769. <img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/reply-button-inactive.gif" width="63" height="18" border="0" />
  770. <?php } ?>
  771. </ul>
  772. </div>
  773. <!-- End Post control Panel --><!-- //grabs moderator tools -->
  774. </td>
  775. </tr>
  776. <tr>
  777. <td class = "message<?php echo $i; ?>1">
  778. <table id="postbody<?php echo $i; ?>1" cellspacing="0" border="0">
  779. <tr>
  780. <td>
  781. <div class="breakWord">
  782. <div class="message-format">
  783. <span <? if ($rowm['gmlevel'] > 0 ) { echo 'class="blue"'; } else if ($rowm['ismvp'] > 0 ) { echo 'class="mvp"'; } ?> style="font-size: 12px;">
  784. <?php
  785. $rowm['text'] = bbcode($rowm['text'],true,true,$rowm['isbbcode']);
  786. if ($_REQUEST['hl']!='') { $rowm['text'] = preg_replace('/'.$_REQUEST['hl'].'/is','<span class="highlight">'.$_REQUEST['hl'].'</span>', $rowm['text']); }
  787. echo $rowm['text'];
  788. ?>
  789. <br><br>
  790. <p><small><font color=red>
  791. <?php
  792. if ($rowm['id_account_edit']!='0' ) {
  793. if ($rowm['id_account_edit']!=$rowm['id_account']) {
  794. $ltedit=mysql_query("SELECT DATE_FORMAT(CONVERT_TZ(CONCAT(`date_edit`, ' ', `hour_edit`), '".$GMT[$SETTING['WEB_GMT']][0]."', '".$usergmt."'), '%d-%m-%Y') as date_edit, DATE_FORMAT(CONVERT_TZ(CONCAT(`date_edit`, ' ', `hour_edit`), '".$GMT[$SETTING['WEB_GMT']][0]."', '".$usergmt."'), '%h:%i %p') as hour_edit, a.gmlevel as gmlevel, fa.displayname as dn, fa.ismvp as ismvp FROM forum_posts fp
  795. LEFT JOIN (account a) ON a.id = fp.id_account_edit
  796. LEFT JOIN (forum_accounts fa) ON fa.id_account = fp.id_account_edit
  797. WHERE fp.id_post='".$rowm['id_post']."'", $MySQL_CON) OR DIE (mysql_error());
  798. if (@mysql_num_rows($ltedit)>0) {
  799. $ltedit=mysql_fetch_array($ltedit);
  800. ?>
  801. [ <span <? if ($ltedit['gmlevel'] > 0 ) { echo 'class="blue"'; } else if ($ltedit['ismvp'] > 0 ) { echo 'class="mvp"'; } else { echo 'style="color: red"'; } ?>>Post edited by <? echo $ltedit['dn']; ?> in <? echo $ltedit['date_edit'].' at '. $ltedit['hour_edit'] ; ?> </span>]
  802. <?
  803. }
  804. } else {
  805. ?>
  806. [ <span <? if ($rowm['gmlevel'] > 0 ) { echo 'class="blue"'; } else if ($rowm['ismvp'] > 0 ) { echo 'class="mvp"'; } else { echo 'style="color: red"'; } ?>>Post edited by <? echo $rowm['dn']; ?> in <? echo $rowm['date_edit'].' at '. $rowm['hour_edit'] ; ?> </span>]
  807. <?php }
  808. }
  809. ?></small></font></p>
  810. <!--<p><small><font color="red">[ <span class="blue">Post edited by Syndri </span>]</font></small></p>-->
  811. <ins><hr noshade="noshade" size="1" color="#9e9e9e" /></ins></span>
  812. <div style="width: 100%; min-height: 50px; max-height: 170px; overflow: auto;"><span style="font-size: 12px;">
  813. <?php
  814. if ($rowm['issignature']=='1') {
  815. echo bbcode($rowm['signature']);
  816. }
  817. ?></span></div>
  818. </div>
  819. </div>
  820. </div>
  821. </td>
  822. </tr>
  823. </table>
  824. </td>
  825. </tr>
  826. </table><!-- End table posttable -->
  827. </div><!-- end insert -->
  828. </div><!-- end innercontainer -->
  829. </div><!-- end border -->
  830. </div><!-- end postdisplay -->
  831. </div><!-- end resultbox -->
  832. </div><!-- End div postshell -->
  833. <?php /* */
  834. }
  835. ?>
  836. </td>
  837. </tr>
  838. </table>
  839. </td>
  840. </tr>
  841. </table>
  842. <div id="topicfooter">
  843. <div class="rpage">
  844. <?php echo $pagination; ?>
  845. </div>
  846. </div>
  847. <div class="forum-index">
  848. <div class="findex">
  849. <a href="?n=forums"><img src="new-hp/images/<?php echo $_LANG['LANG']['SHORT_TAG']; ?>/forum/forum-index.gif" width="104" height="41" border="0" title="" alt="" /></a>
  850. </div>
  851. </div>
  852. <div style="width: 100%; height: 20px;"></div>
  853. <div style="position: relative; width: 100%;">
  854. <div style="position: absolute; left: 20px; top: -78px;_top: -85px;">
  855. <span><small class="nav">Forum Nav :</small></span>
  856. <small>
  857. <select id="selectNavb" onchange="javascript:window.location='?n=forums&f=' + this.value" class="forum-dropdown" style="display:inline; width: 185px; margin-left: 10px;">
  858. <?php echo $GLOBALS['allf']; ?>
  859. </select>
  860. </small>
  861. <a href="#" onclick="javascript:window.location='?n=forums&f=' + selectNavb.value"><img src="new-hp/images/forum/jump-button.gif" alt="Jump To This Forum" width="21" height="19" border="0" style="margin-bottom: 3px;" align="top" title="Jump To This Forum"/></a>
  862. </div>
  863. </div>
  864. <br clear="all" />
  865. <?
  866. }
  867. ?>