Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 29.40 KB | None | 0 0
  1. <?PHP header("Content-Type: text/html; charset=ISO-8859-1",true);
  2. date_default_timezone_set('America/Sao_Paulo');
  3.     // top kills - guilds
  4.     $main_content .= '<center><div class="NewsHeadline">
  5.        <div class="NewsHeadlineBackground"">
  6.            <table border="0">
  7.                <tr>
  8.                    <td style="text-align: center; font-weight: bold;">
  9.                      <div class="fb-like fb_iframe_widget" data-href="https://www.facebook.com/OldServbr" data-layout="standard" data-action="like" data-show-faces="false" data-share="true" fb-xfbml-state="rendered" fb-iframe-plugin-query="action=like&amp;app_id=497232093667125&amp;container_width=720&amp;href=https%3A%2F%2Fwww.facebook.com%2FOldServbr&amp;layout=standard&amp;locale=en_US&amp;sdk=joey&amp;share=true&amp;show_faces=false"><span style="vertical-align: bottom; width: 450px; height: 20px;"><iframe name="f26839eaf9525ec" width="1000px" height="1000px" frameborder="0" allowtransparency="false" allowfullscreen="true" scrolling="no" title="fb:like Facebook Social Plugin" src="http://www.facebook.com/plugins/like.php?action=like&amp;app_id=497232093667125&amp;channel=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D42%23cb%3Df30dbf3dfeb5868%26domain%3DOldServbr.com%26origin%3Dhttp%253A%252F%252FOldServbr.com%252Ff38d449e4607c38%26relation%3Dparent.parent&amp;container_width=720&amp;href=https%3A%2F%2Fwww.facebook.com%2FOldServbr&amp;layout=standard&amp;locale=en_US&amp;sdk=joey&amp;share=true&amp;show_faces=false" style="border: none; visibility: visible; width: 550px; height: 30px;" class=""></iframe></span></div>
  10.                        <font color="white">Most powerfull guilds</font>
  11.                    </td>
  12.                </tr>
  13.            </table>
  14.        </div>
  15.    </div>';
  16.    
  17.     $guilds = $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 4;')->fetch();
  18.     if ($guilds) {
  19.         $main_content .= '<table border="0" cellspacing="3" cellpadding="4" width="100%"><tr>';
  20.         foreach ($guilds as $guild) {
  21.             $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 </td>';
  22.         }
  23.  
  24.         $main_content .= '</tr></table>';
  25.     }
  26.  
  27.     $main_content .= '</center>';
  28. //######################## SHOW TICKERS AND NEWS #######################
  29. if ($logged){
  30. $players_from_account = $SQL->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
  31. foreach($players_from_account as $player)
  32.     {
  33.         $str .= '<option value="'.$player['id'].'"';
  34.             if($player['id'] == $char_id)
  35.             $strt .= ' selected="selected"';
  36.             $str .= '>'.$player['name'].'</option>';
  37.     }
  38. }
  39. $time = time();
  40. $news_content .= '
  41. <div id="newsticker" class="Box">
  42. <div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div>
  43. <div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div>
  44. <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
  45. <div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);"></div>
  46. <img class="Title"  src="/images/head/News Ticker.png" alt="Contentbox headline" />
  47.    
  48. <div class="Border_2">
  49. <div class="Border_3">
  50. <div class="BoxContent" style="background-image: url('.$layout_name.'/images/content/scroll.gif);">';
  51. //##################### ADD NEW TICKER #####################
  52. if($action == "newticker") {
  53. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  54. $ticker_text = stripslashes(trim($_POST['new_ticker']));
  55. $ticker_icon = (int) $_POST['icon_id'];
  56. if(empty($ticker_text)) {
  57. $news_content .= 'You can\'t add empty ticker.';
  58. }
  59. else
  60. {
  61. if(empty($ticker_icon)) {
  62. $news_icon = 0;
  63. }
  64. $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)');
  65. $news_content .= '<center><h2><font color="red">Added new ticker:</font></h2></center><hr/>
  66. <div id="newsticker" class="Box">
  67. <div id="TickerEntry-1" class="Row" onclick=\'TickerAction("TickerEntry-1")\'>
  68. <div class="Odd">
  69. <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
  70. <div id="TickerEntry-1-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
  71. <div class="NewsTickerText">
  72. <span class="NewsTickerDate">'.date("j M Y", $time).' -</span>
  73. <div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
  74. $news_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
  75. $news_content .= short_text($ticker_text, 60).'
  76. </div>
  77. <div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
  78. $news_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
  79. $news_content .= $ticker_text.'
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div><hr/>';
  85. }
  86. }
  87. else
  88. {
  89. $news_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
  90. }
  91. $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>';
  92. }
  93. //#################### DELETE (HIDE only!) TICKER ############################
  94. if($action == "deleteticker") {
  95. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  96. header("Location: ");
  97. $date = (int) $_REQUEST['id'];
  98. $SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
  99. $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>';
  100. }
  101. else
  102. {
  103. $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>';
  104. }
  105. }
  106. //show tickers if any in database or not blocked (tickers limit = 0)
  107. $tickers = $SQL->query('SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 50;');
  108. $number_of_tickers = 0;
  109. if(is_object($tickers)) {
  110. foreach($tickers as $ticker) {
  111. if(is_int($number_of_tickers / 2))
  112. $color = "Odd";
  113. else
  114. $color = "Even";
  115. $tickers_to_add .= '
  116. <div id="TickerEntry-'.$number_of_tickers.'" class="Row" onclick=\'TickerAction("TickerEntry-'.$number_of_tickers.'")\'>
  117. <div class="'.$color.'">
  118. <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
  119. <div id="TickerEntry-'.$number_of_tickers.'-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
  120. <div class="NewsTickerText">
  121. <span class="NewsTickerDate">'.date("j M Y", $ticker['date']).' -</span>
  122. <div id="TickerEntry-'.$number_of_tickers.'-ShortText" class="NewsTickerShortText">';
  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 .= short_text($ticker['text'], 60).'</div>
  128. <div id="TickerEntry-'.$number_of_tickers.'-FullText" class="NewsTickerFullText">';
  129. //if admin show button to delete (hide) ticker
  130. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  131. $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>';
  132. }
  133. $tickers_to_add .= $ticker['text'].'</div>
  134. </div>
  135. </div>
  136. </div>';
  137. $number_of_tickers++;
  138. }
  139. }
  140. if(!empty($tickers_to_add)) {
  141. //show table with tickers
  142. if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action!=newticker)
  143. $news_content .= '<script type="text/javascript">
  144. var showednewticker_state = "0";
  145. function showNewTickerForm()
  146. {
  147. if(showednewticker_state == "0") {
  148. 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>\';
  149. document.getElementById("jajo").innerHTML = \'\';
  150. showednewticker_state = "1";
  151. }
  152. else {
  153. document.getElementById("newtickerform").innerHTML = \'\';
  154. 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>\';
  155. showednewticker_state = "0";
  156. }
  157. }
  158. </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/>';
  159. //add tickers list
  160. $news_content .= $tickers_to_add;
  161. //koniec
  162. }
  163. $news_content .= '</div>
  164. </div>
  165. </div>
  166. <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
  167. <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
  168. <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  169. </div>';
  170. //end of tickers, news part
  171. //featured article
  172. //sem creditos do autor, apenas postado por Dhenyz Shady no X-tibia.
  173.  
  174. $news_content .= '
  175.    <div id="news" class="Box">
  176.    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
  177.    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
  178.    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
  179.    <div class="BorderTitleText" style="background-image:url(layouts/tibiacom/images/content/title-background-green.gif);"></div>
  180.   <img class="Title" src="/images/head/Featured Article.png" alt="Contentbox headline" />
  181.    <div class="Border_2">
  182.        <div class="Border_3">
  183.            <div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
  184.                <div id=\'TeaserThumbnail\'><img src="layouts/tibiacom/images/news/topitems.jpg" width=150 height=100 border=0 alt="" ALIGN=right hspace="10" /></div>
  185.                <div id=\'TeaserText\'>
  186.                    <div style="position: relative; top: -9px; margin-bottom: -60px;"></br>
  187.                  <b><font size="5px"><center><b><font style="text-decoration: inherit; text-shadow:#000 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px" size="1px" color="white">| IP: <font color="#00FF00">www.warglobal.com.br</font> / Port: <font color="#00FF00">7171</font> / Client: <font color="#00FF00">10.51</font>/<font color="#00FF00">10.53</font> |</b></font></center><br></b><font size="2px">Seja bem vindo ao <b><font color="green">www.warglobal.com.br</font></b>, servidor feito especialmente para jogadores que gostam de um pvp up. Oferecemos quests, outfits e quest sem algumas missoes, temos uma boa jogabilidade e estabilidade que poucos ots tem, esperamos que goste.<br><br><br><br>  
  188.                </font> </div>
  189.      </div>
  190.            </div>
  191.        </div>
  192.    </div>
  193.    <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
  194.    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
  195.    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  196.    </div>
  197. ';
  198. //Fim do featured Article
  199. //adding news
  200. if($action == "newnews") {
  201. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
  202. $text = ($_REQUEST['text']);
  203. $char_id = (int) $_REQUEST['char_id'];
  204. $post_topic = stripslashes(trim($_REQUEST['topic']));
  205. $smile = (int) $_REQUEST['smile'];
  206. $news_icon = (int) $_REQUEST['icon_id'];
  207. if(empty($news_icon)) {
  208. $news_icon = 0;
  209. }
  210. if(empty($post_topic)) {
  211. $an_errors[] .= 'You can\'t add news without topic.';
  212. }
  213. if(empty($text)) {
  214. $an_errors[] .= 'You can\'t add empty news.';
  215. }
  216. if(empty($char_id)) {
  217. $an_errors[] .= 'Select character.';
  218. }
  219. //execute query
  220. if(empty($an_errors)) {
  221. $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."')");
  222. $thread_id = $SQL->lastInsertId();
  223. $SQL->query("UPDATE `z_forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);//show added data
  224. $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>';
  225. }
  226. else
  227. {
  228. //show errors
  229. $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/>';
  230. foreach($an_errors as $an_error) {
  231.     $main_content .= '<li>'.$an_error;
  232. }
  233. $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/>';
  234. //okno edycji newsa z wpisanymi danymi przeslanymi wczesniej
  235. $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>';
  236. }
  237. }
  238. else
  239. {
  240. $main_content .= 'You don\'t have site-admin rights. You can\'t add news.';}
  241. }
  242. //####################Show script with new news panel############################                              
  243. if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action != 'newnews')
  244. {
  245.  
  246. $main_content .= '
  247. <font style="font-size: 16px; font-weight: bold; margin-left: 20px;">New News</font>
  248. <form action="index.php?subtopic=latestnews&action=newnews" method="post" >
  249. <table border="0">
  250. <tr>
  251. <td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td>
  252. <td>
  253. <table border="0">
  254. <tr bgcolor="F1E0C6">
  255. <td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td>
  256. <td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td>
  257. <td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td>
  258. <td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td>
  259. <td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td>
  260. </tr>
  261. <tr bgcolor="D4C0A1">
  262. <td><input type="radio" name="icon_id" value="0" checked="checked"></td>
  263. <td><input type="radio" name="icon_id" value="1" /></td>
  264. <td><input type="radio" name="icon_id" value="2" /></td>
  265. <td><input type="radio" name="icon_id" value="3" /></td>
  266. <td><input type="radio" name="icon_id" value="4" /></td>
  267. </tr>
  268. </table>
  269. </td>
  270. </tr>
  271. <tr>
  272. <td align="center" bgcolor="F1E0C6"><b>Topic:</b></td>
  273. <td><input type="text" name="topic" maxlenght="50" style="width: 300px" ></td>
  274. </tr>
  275. <tr>
  276. <td align="center" bgcolor="D4C0A1"><b>News<br>text:</b></td>
  277. <td bgcolor="F1E0C6"><textarea name="text" rows="6" cols="50"></textarea></td>
  278. </tr>
  279. <tr>
  280. <td width="180"><b>Character:</b></td>
  281. <td><select name="char_id"><option value="0">(Choose character)</option>'.$str.'</select></td>
  282. </tr>
  283. <tr>
  284. <td>
  285. <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>
  286. </table>
  287. <hr/>';
  288. $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();
  289. }
  290. ///show news
  291. $announcements = $SQL->query("SELECT * FROM `announcements` WHERE id ORDER BY `date` DESC LIMIT 1")->fetch();
  292. if ($announcements) {
  293.     foreach ($announcements as $announcementsRow){
  294.     $news_content .= '<div id="featuredarticle" class="Box">
  295.    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
  296.    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
  297.    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
  298.    <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
  299.    <img class="Title" src="montaimg.php?text=Announcement" alt="Contentbox headline" />
  300.    <div class="Border_2">
  301.    <div class="Border_3">
  302.    <div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
  303.    <div id="TeaserThumbnail"><img src="images/news/announcement.jpg" width="150" height="100" border="0" alt="" /></div>
  304.    <div id="TeaserText">
  305.    <div style="position: relative; margin-bottom: 2px;" >
  306.    <div style="font-size:18px; font-weight:bold;">'.$announcementsRow['title'].'</div>
  307.    </div>
  308.    '.$announcementsRow['text'].'
  309.    <br />
  310.    <br />
  311.    <small style="float: right;">Posted by <font color="red">'.$announcementsRow['author'].'</font> - '.date("d M Y", $announcementsRow['date']).'</small>';
  312.     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'].'\'" />';}
  313.     $news_content .='
  314.    </div>
  315.    </div>
  316.    </div>
  317.    </div>
  318.  
  319.    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
  320.    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
  321.    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  322.    </div>
  323.    ';
  324.     }
  325. }
  326.  
  327. //
  328. $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();
  329. foreach ($zapytanie as $row)
  330. {
  331.         $BB = array(
  332.         '/\[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>',
  333.         '/\[b\](.*?)\[\/b\]/is' => '<strong>$1</strong>',
  334.         '/\[center\](.*?)\[\/center\]/is' => '<center>$1</center>',
  335.         '/\[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>',
  336.         '/\[u\](.*?)\[\/u\]/is' => '<u>$1</u>',
  337.         '/\[i\](.*?)\[\/i\]/is' => '<i>$1</i>',
  338.         '/\[letter\](.*?)\[\/letter\]/is' => '<img src=images/letters/$1.gif alt=$1 />',
  339.         '/\[url](.*?)\[\/url\]/is' => '<a href=$1>$1</a>',
  340.         '/\[color\=(.*?)\](.*?)\[\/color\]/is' => '<span style="color: $1;">$2</span>',
  341.         '/\[img\](.*?)\[\/img\]/is' => '<img src=$1 alt=$1 />',
  342.         '/\[player\](.*?)\[\/player\]/is' => '<a href='.$server['ip'].'index.php?subtopic=characters&amp;name=$1>$1</a>',
  343.         '/\[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>'
  344.         );
  345.         $message = preg_replace(array_keys($BB), array_values($BB), nl2br($row['post_text']));
  346.         $main_content .= '
  347.         <div class="NewsHeadline">
  348.         <div class="NewsHeadlineBackground" style="">
  349.         <center><h3><div class="NewsHeadlineText"><br>'.$row['post_topic'].'</div></h3></center>
  350.         </div>
  351.         </div>
  352.         <table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>
  353.         <td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>';
  354.         if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
  355.         {
  356.             $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>';
  357.         }
  358.         else       
  359.         {
  360.             $main_content .='<td width="100%">'.$message.'<br /><br />';       
  361.         }
  362.         $main_content .= '</td>
  363.         <td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
  364.         </tr></table>';
  365.  
  366. }
  367. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement