Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.03 KB | None | 0 0
  1. <?PHP header("Content-Type: text/html; charset=UTF-8",true);
  2. date_default_timezone_set('America/Sao_Paulo');
  3. // top kills - guilds
  4. $main_content .= '<center><div class="NewsHeadline">
  5. <div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif);">
  6. <table border="0">
  7. <tr>
  8. <td style="text-align: center; font-weight: bold; padding-top: 5px;">
  9. <font color="white">Guildas Mais Poderosas</font>
  10. </td>
  11. </tr>
  12. </table>
  13. </div>
  14. </div>
  15. <table border="0" cellspacing="3" cellpadding="4" width="100%"><tr>';
  16.  
  17. foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `g`.`id` > 0 AND `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 6;') as $guild)
  18. $main_content .= '<td style="width: 25%; text-align: center;"><a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guild_image.php?id=' . $guild['id'] . '" width="64" height="64" border="0"/> <br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
  19. </td>';
  20. $main_content .= '</tr></table></center>';
  21. date_default_timezone_set('America/Sao_Paulo');
  22. //######################## SHOW TICKERS AND NEWS #######################
  23. if ($logged){
  24. $players_from_account = $SQL->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
  25. foreach($players_from_account as $player)
  26. {
  27. $str .= '<option value="'.$player['id'].'"';
  28. if($player['id'] == $char_id)
  29. $strt .= ' selected="selected"';
  30. $str .= '>'.$player['name'].'</option>';
  31. }
  32. }
  33. $time = time();
  34. $news_content .= '
  35. <div id="newsticker" class="Box">
  36. <div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div>
  37. <div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div>
  38. <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
  39. <div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);"></div>
  40. <img class="Title" src="/images/head/News Ticker.png" alt="Contentbox headline" />
  41.  
  42. <div class="Border_2">
  43. <div class="Border_3">
  44. <div class="BoxContent" style="background-image: url('.$layout_name.'/images/content/scroll.gif);">';
  45. //##################### ADD NEW TICKER #####################
  46. if($action == "newticker") {
  47. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  48. $ticker_text = stripslashes(trim($_POST['new_ticker']));
  49. $ticker_icon = (int) $_POST['icon_id'];
  50. if(empty($ticker_text)) {
  51. $news_content .= 'You can\'t add empty ticker.';
  52. }
  53. else
  54. {
  55. if(empty($ticker_icon)) {
  56. $news_icon = 0;
  57. }
  58. $SQL->query('INSERT INTO '.$SQL->tableName('z_news_tickers').' (date, author, image_id, text, hide_ticker) VALUES ('.$SQL->quote($time).', '.$account_logged->getId().', '.$ticker_icon.', '.$SQL->quote($ticker_text).', 0)');
  59. $news_content .= '<center><h2><font color="red">Added new ticker:</font></h2></center><hr/>
  60. <div id="newsticker" class="Box">
  61. <div id="TickerEntry-1" class="Row" onclick=\'TickerAction("TickerEntry-1")\'>
  62. <div class="Odd">
  63. <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
  64. <div id="TickerEntry-1-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
  65. <div class="NewsTickerText">
  66. <span class="NewsTickerDate">'.date("j M Y", $time).' -</span>
  67. <div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
  68. $news_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
  69. $news_content .= short_text($ticker_text, 60).'
  70. </div>
  71. <div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
  72. $news_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
  73. $news_content .= $ticker_text.'
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div><hr/>';
  79. }
  80. }
  81. else
  82. {
  83. $news_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
  84. }
  85. $news_content .= '<form action="index.php?subtopic=latestnews" METHOD="post"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form>';
  86. }
  87. //#################### DELETE (HIDE only!) TICKER ############################
  88. if($action == "deleteticker") {
  89. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  90. header("Location: ");
  91. $date = (int) $_REQUEST['id'];
  92. $SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
  93. $news_content .= '<center>News tickets with <b>date '.date("j M Y", $date).'</b> has been deleted.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
  94. }
  95. else
  96. {
  97. $news_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
  98. }
  99. }
  100. //show tickers if any in database or not blocked (tickers limit = 0)
  101. $tickers = $SQL->query('SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 50;');
  102. $number_of_tickers = 0;
  103. if(is_object($tickers)) {
  104. foreach($tickers as $ticker) {
  105. if(is_int($number_of_tickers / 2))
  106. $color = "Odd";
  107. else
  108. $color = "Even";
  109. $tickers_to_add .= '
  110. <div id="TickerEntry-'.$number_of_tickers.'" class="Row" onclick=\'TickerAction("TickerEntry-'.$number_of_tickers.'")\'>
  111. <div class="'.$color.'">
  112. <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
  113. <div id="TickerEntry-'.$number_of_tickers.'-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
  114. <div class="NewsTickerText">
  115. <span class="NewsTickerDate">'.date("j M Y", $ticker['date']).' -</span>
  116. <div id="TickerEntry-'.$number_of_tickers.'-ShortText" class="NewsTickerShortText">';
  117. //if admin show button to delete (hide) ticker
  118. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  119. $tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
  120. }
  121. $tickers_to_add .= short_text($ticker['text'], 60).'</div>
  122. <div id="TickerEntry-'.$number_of_tickers.'-FullText" class="NewsTickerFullText">';
  123. //if admin show button to delete (hide) ticker
  124. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  125. $tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
  126. }
  127. $tickers_to_add .= $ticker['text'].'</div>
  128. </div>
  129. </div>
  130. </div>';
  131. $number_of_tickers++;
  132. }
  133. }
  134. if(!empty($tickers_to_add)) {
  135. //show table with tickers
  136. if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action!=newticker)
  137. $news_content .= '<script type="text/javascript">
  138. var showednewticker_state = "0";
  139. function showNewTickerForm()
  140. {
  141. if(showednewticker_state == "0") {
  142. document.getElementById("newtickerform").innerHTML = \'<form action="index.php?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
  143. document.getElementById("jajo").innerHTML = \'\';
  144. showednewticker_state = "1";
  145. }
  146. else {
  147. document.getElementById("newtickerform").innerHTML = \'\';
  148. document.getElementById("jajo").innerHTML = \'<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div>\';
  149. showednewticker_state = "0";
  150. }
  151. }
  152. </script><div id="newtickerform"></div><div id="jajo"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></div><hr/>';
  153. //add tickers list
  154. $news_content .= $tickers_to_add;
  155. //koniec
  156. }
  157. $news_content .= '</div>
  158. </div>
  159. </div>
  160. <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
  161. <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
  162. <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  163. </div>';
  164. //end of tickers, news part
  165. //featured article
  166. //sem creditos do autor, apenas postado por Dhenyz Shady no X-tibia.
  167.  
  168. $news_content .= '
  169. <div id="news" class="Box">
  170. <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
  171. <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
  172. <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
  173. <div class="BorderTitleText" style="background-image:url(layouts/tibiacom/images/content/title-background-green.gif);"></div>
  174. <img class="Title" src="/images/head/Featured Article.png" alt="Contentbox headline" />
  175. <div class="Border_2">
  176. <div class="Border_3">
  177. <div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
  178. <div id="TeaserThumbnail"><img src="layouts/tibiacom/images/news/featured-img.png" width="200" height="125" border="1" alt="" align="right" hspace="0"></div>
  179. <div id="TeaserText">
  180. <div style="position: relative; top: -9px; margin-bottom: 10px;"><br>
  181. <font size="2px"></font><center><font size="2px"><b> IP:</b> 167.114.21.75 |&nbsp; <b>Port:</b> 7171 |&nbsp; <b>Version:</b> 10.00/11.00</font> <br> </a></center><br><font size="2px">Seja bem vindo ao <b><font color="green">Materia</font></b>, contamos com o <b>RLMAP</b> mais completo de todos os servidores atualmente, principais quests <b>SEM MISSOES</b>, Cooldown e Magias reformuladas para um PvP mais dinĂ¢mico e divertido. <b>Exp shared 100%, All Quests</b>. Diversos bugs fixados e sendo arrumados <u>diariamente</u>. Venha conferir o melhor servidor de todos os tempos! Aqui sua diversao e garantida!
  182. </font> </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
  188. <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
  189. <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  190. </div>
  191. ';
  192. //Fim do featured Article
  193. //adding news
  194. if($action == "newnews") {
  195. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  196. $text = ($_REQUEST['text']);
  197. $char_id = (int) $_REQUEST['char_id'];
  198. $post_topic = stripslashes(trim($_REQUEST['topic']));
  199. $smile = (int) $_REQUEST['smile'];
  200. $news_icon = (int) $_REQUEST['icon_id'];
  201. if(empty($news_icon)) {
  202. $news_icon = 0;
  203. }
  204. if(empty($post_topic)) {
  205. $an_errors[] .= 'You can\'t add news without topic.';
  206. }
  207. if(empty($text)) {
  208. $an_errors[] .= 'You can\'t add empty news.';
  209. }
  210. if(empty($char_id)) {
  211. $an_errors[] .= 'Select character.';
  212. }
  213. //execute query
  214. if(empty($an_errors)) {
  215. $SQL->query("INSERT INTO `z_forum` (`id` ,`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`, `icon_id`) VALUES ('NULL', '0', '".time()."', '1', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$SQL->quote($text).", ".$SQL->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."', '".$news_icon."')");
  216. $thread_id = $SQL->lastInsertId();
  217. $SQL->query("UPDATE `z_forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);//show added data
  218. $main_content .= '<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form>';
  219. }
  220. else
  221. {
  222. //show errors
  223. $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  224. foreach($an_errors as $an_error) {
  225. $main_content .= '<li>'.$an_error;
  226. }
  227. $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';
  228. //okno edycji newsa z wpisanymi danymi przeslanymi wczesniej
  229. $main_content .= '<form action="index.php?subtopic=latestnews&action=newnews" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="F1E0C6"><b>Topic:</b></td><td><input type="text" name="topic" maxlenght="50" style="width: 300px" value="'.$post_topic.'"></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>News<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="text" rows="6" cols="60">'.$text.'</textarea></td></tr><tr><td width="180"><b>Character:</b></td><td><select name="char_id"><option value="0">(Choose character)</option>'.$str.'</select></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="location.href=\'index.php?subtopic=latestnews\';" alt="CancelAddNews" /></div></div></td></tr></table>';
  230. }
  231. }
  232. else
  233. {
  234. $main_content .= 'You don\'t have site-admin rights. You can\'t add news.';}
  235. }
  236. //####################Show script with new news panel############################
  237. if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action != 'newnews')
  238. {
  239.  
  240. $main_content .= '
  241. <font style="font-size: 16px; font-weight: bold; margin-left: 20px;">New News</font>
  242. <form action="index.php?subtopic=latestnews&action=newnews" method="post" >
  243. <table border="0">
  244. <tr>
  245. <td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td>
  246. <td>
  247. <table border="0">
  248. <tr bgcolor="F1E0C6">
  249. <td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td>
  250. <td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td>
  251. <td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td>
  252. <td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td>
  253. <td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td>
  254. </tr>
  255. <tr bgcolor="D4C0A1">
  256. <td><input type="radio" name="icon_id" value="0" checked="checked"></td>
  257. <td><input type="radio" name="icon_id" value="1" /></td>
  258. <td><input type="radio" name="icon_id" value="2" /></td>
  259. <td><input type="radio" name="icon_id" value="3" /></td>
  260. <td><input type="radio" name="icon_id" value="4" /></td>
  261. </tr>
  262. </table>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td align="center" bgcolor="F1E0C6"><b>Topic:</b></td>
  267. <td><input type="text" name="topic" maxlenght="50" style="width: 300px" ></td>
  268. </tr>
  269. <tr>
  270. <td align="center" bgcolor="D4C0A1"><b>News<br>text:</b></td>
  271. <td bgcolor="F1E0C6"><textarea name="text" rows="6" cols="60"></textarea></td>
  272. </tr>
  273. <tr>
  274. <td width="180"><b>Character:</b></td>
  275. <td><select name="char_id"><option value="0">(Choose character)</option>'.$str.'</select></td>
  276. </tr>
  277. <tr>
  278. <td>
  279. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form></td></tr>
  280. </table>
  281. <hr/>';
  282. $zapytanie = $SQL->query("SELECT `z_forum`.`icon_id`,`z_forum`.`post_topic`, `z_forum`.`author_guid`, `z_forum`.`post_date`, `z_forum`.`post_text`, `z_forum`.`id`, `z_forum`.`replies`, `players`.`name` FROM `z_forum`, `players` WHERE `section` = '1' AND `z_forum`.`id` = `first_post` AND `players`.`id` = `z_forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 3;")->fetchAll();
  283. }
  284. ///show news
  285. $announcements = $SQL->query("SELECT * FROM `announcements` WHERE id ORDER BY `date` DESC LIMIT 1");
  286. foreach ($announcements as $announcementsRow){
  287. $news_content .= '<div id="featuredarticle" class="Box">
  288. <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
  289. <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
  290. <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
  291. <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
  292. <img class="Title" src="montaimg.php?text=Announcement" alt="Contentbox headline" />
  293. <div class="Border_2">
  294. <div class="Border_3">
  295. <div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
  296. <div id="TeaserThumbnail"><img src="images/news/announcement.jpg" width="150" height="100" border="0" alt="" /></div>
  297. <div id="TeaserText">
  298. <div style="position: relative; margin-bottom: 2px;" >
  299. <div style="font-size:18px; font-weight:bold;">'.$announcementsRow['title'].'</div>
  300. </div>
  301. '.$announcementsRow['text'].'
  302. <br />
  303. <br />
  304. <small style="float: right;">Posted by <font color="red">'.$announcementsRow['author'].'</font> - '.date("d M Y", $announcementsRow['date']).'</small>';
  305. if ($logged)if ($account_logged->getCustomField("page_access") > 6 ){ $news_content .='<input type="button" value="Deletar" OnClick="location.href=\'index.php?subtopic=cpanel&action=deletar_ann&id='.$announcementsRow['id'].'\'" />';}
  306. $news_content .='
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311.  
  312. <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
  313. <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
  314. <div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  315. </div>
  316. ';
  317. }
  318.  
  319. //
  320. $zapytanie = $SQL->query("SELECT `z_forum`.`icon_id`,`z_forum`.`post_topic`, `z_forum`.`author_guid`, `z_forum`.`post_date`, `z_forum`.`post_text`, `z_forum`.`id`, `z_forum`.`replies`, `players`.`name` FROM `z_forum`, `players` WHERE `section` = '1' AND `z_forum`.`id` = `first_post` AND `players`.`id` = `z_forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 6;")->fetchAll();
  321. foreach ($zapytanie as $row)
  322. {
  323. $BB = array(
  324. '/\[youtube\](.*?)\[\/youtube\]/is' => '<center><object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/$1&hl=pt-br&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/$1&hl=pt-br&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="405"></embed></object></center>',
  325. '/\[b\](.*?)\[\/b\]/is' => '<strong>$1</strong>',
  326. '/\[center\](.*?)\[\/center\]/is' => '<center>$1</center>',
  327. '/\[quote\](.*?)\[\/quote\]/is' => '<table cellpadding="0" style="background-color: #c4c4c4; width: 480px; border-style: dotted; border-color: #007900; border-width: 2px"><tr><td>$1</td></tr></table>',
  328. '/\[u\](.*?)\[\/u\]/is' => '<u>$1</u>',
  329. '/\[i\](.*?)\[\/i\]/is' => '<i>$1</i>',
  330. '/\[letter\](.*?)\[\/letter\]/is' => '<img src=images/letters/$1.gif alt=$1 />',
  331. '/\[url](.*?)\[\/url\]/is' => '<a href=$1>$1</a>',
  332. '/\[color\=(.*?)\](.*?)\[\/color\]/is' => '<span style="color: $1;">$2</span>',
  333. '/\[img\](.*?)\[\/img\]/is' => '<img src=$1 alt=$1 />',
  334. '/\[player\](.*?)\[\/player\]/is' => '<a href='.$server['ip'].'index.php?subtopic=characters&amp;name=$1>$1</a>',
  335. '/\[code\](.*?)\[\/code\]/is' => '<div dir="ltr" style="margin: 0px;padding: 2px;border: 1px inset;width: 500px;height: 290px;text-align: left;overflow: auto"><code style="white-space:nowrap">$1</code></div>'
  336. );
  337. $message = preg_replace(array_keys($BB), array_values($BB), nl2br($row['post_text']));
  338. $main_content .= '
  339. <div class="NewsHeadline">
  340. <img class="Title" src="/images/head/Latest News.png" alt="Contentbox headline" />
  341. <div class="NewsHeadlineBackground" style="background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)">
  342. <img src="'.$layout_name.'/images/news/icon_'.$row['icon_id'].'_big.gif" class="NewsHeadlineIcon" />
  343. <div class="NewsHeadlineDate">'.date('j M Y', $row['post_date']).' - </div>
  344. <div class="NewsHeadlineText">'.$row['post_topic'].'</div>
  345. </div>
  346. </div>
  347. <table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>';
  348. if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
  349. {
  350. $main_content .='<td width="100%">'.$message.'<br><p align="right"><a href="index.php?subtopic=forum&action=remove_post&id='.$row['id'].'"><font color="red">[Delete this news]</font></a> <a href="index.php?subtopic=forum&action=edit_post&id='.$row['id'].'"><font color="green">[Edit this news]</font></a>';
  351. }
  352. else
  353. {
  354. $main_content .='<td width="100%">'.$message.'<br /><br />';
  355. }
  356. $main_content .= '</td>
  357. </tr></table>';
  358.  
  359. }
  360. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement