Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <link href="<?PHP echo $layout_name; ?>/css/pop-up.min.css" rel="stylesheet" type="text/css">
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>OT-BR</title>
- </head>
- <body>
- <div id="my_popup">
- <p align="center">
- <img src="images/banner.png" class="imgBorder">
- </p>
- <p align="center" style="margin-top:-50px;">
- <button class="my_popup_close btn btn-danger">
- Click to Close
- </button>
- </p>
- </div>
- <!-- jQuery -->
- <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
- <!-- jQuery Popup Overlay -->
- <script src="<?PHP echo $layout_name; ?>/js/pop-up.min.js"></script>
- <script>
- $(document).ready(function() {
- $('#my_popup').popup({
- transition: 'all 0.3s',
- scrolllock: true,
- autoopen: true
- });
- });
- </script>
- </body>
- </html>
- <?php
- if(!defined('INITIALIZED'))
- exit;
- $tickerSql = $SQL->query("SELECT ");
- //NEWSTICKER
- $time = time();
- $vTick = $SQL->query("SELECT * FROM `z_forum` WHERE `section` = '100' AND `z_forum`.`id` = `first_post` ORDER BY `post_date` DESC LIMIT 8")->fetch();
- if(isset($vTick['post_date'])){
- $news_content .= '
- <div id="NewsTicker" class="Box">
- <div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div>
- <div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div>
- <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
- <div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);">
- <center><b><font size="4" style="text-decoration: inherit; text-shadow:black 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px" size="1px" color="#0DAD0D" face="Trebuchet MS, Helvetica, sans-serif">| IP: <font color="#1AE61A">OT-BR.COM</font> / PORT: <font color="#1AE61A">7171</font> / VERSION: <font color="#1AE61A">10.95</font> |</font></b></center>
- </div>
- <div class="Border_2">
- <div class="Border_3">
- <div class="BoxContent" style="background-image: url('.$layout_name.'/images/content/scroll.gif);">';
- //show tickers if any in database or not blocked (tickers limit = 0)
- $tickers = $SQL->query("SELECT * FROM `z_forum` WHERE `section` = '100' AND `z_forum`.`id` = `first_post` ORDER BY `post_date` DESC LIMIT 8");
- $number_of_tickers = 0;
- if(is_object($tickers)) {
- foreach($tickers as $ticker) {
- if(is_int($number_of_tickers / 2))
- $color = "Odd";
- else
- $color = "Even";
- $tickers_to_add .= '<div id="TickerEntry-'.$number_of_tickers.'" class="Row" onclick=\'TickerAction("TickerEntry-'.$number_of_tickers.'")\'>
- <div class="'.$color.'">
- <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['post_icon_id'].'.gif);"></div>
- <div id="TickerEntry-'.$number_of_tickers.'-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
- <div class="NewsTickerText">
- <span class="NewsTickerDate">'.date("d/m/Y", $ticker['post_date']).' -</span>
- <div id="TickerEntry-'.$number_of_tickers.'-ShortText" class="NewsTickerShortText">';
- $tickers_to_add .= short_text($ticker['post_text'], 150).'</div>
- <div id="TickerEntry-'.$number_of_tickers.'-FullText" class="NewsTickerFullText">';
- $tickers_to_add .= $ticker['post_text'].'</div>
- </div>
- </div>
- </div>';
- $number_of_tickers++;
- }
- }
- }
- //adding news
- if($action == "newnews") {
- if($group_id_of_acc_logged >= $config['site']['access_news']) {
- $text = ($_REQUEST['text']);
- $char_id = (int) $_REQUEST['char_id'];
- $post_topic = stripslashes(trim($_REQUEST['topic']));
- $smile = (int) $_REQUEST['smile'];
- $news_icon = (int) $_REQUEST['icon_id'];
- if(empty($news_icon)) {
- $news_icon = 0;
- }
- if(empty($post_topic)) {
- $an_errors[] .= 'You can\'t add news without topic.';
- }
- if(empty($text)) {
- $an_errors[] .= 'You can\'t add empty news.';
- }
- if(empty($char_id)) {
- $an_errors[] .= 'Select character.';
- }
- //execute query
- if(empty($an_errors)) {
- $SQL->query("INSERT INTO `z_forum` (`id` ,`first_post` ,`last_post` ,`icon_id` ,`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."')");
- $thread_id = $SQL->lastInsertId();
- $SQL->query("UPDATE `z_forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);//show added data
- $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>';
- }
- else
- {
- //show errors
- $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/>';
- foreach($an_errors as $an_error) {
- $main_content .= '<li>'.$an_error;
- }
- $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/>';
- //okno edycji newsa z wpisanymi danymi przeslanymi wczesniej
- $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>';
- }
- }
- else
- {
- $main_content .= 'You don\'t have site-admin rights. You can\'t add news.';}
- }
- if(!empty($tickers_to_add)) {
- //show table with tickers
- if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action!=newticker)
- $news_content .= '<font color="red"><b>USE ADMIN BOARDS TO ADD AND DELETE TICKERS</b></font><hr/>';
- //add tickers list
- $news_content .= $tickers_to_add;
- //koniec
- $news_content .= '</div>
- </div>
- </div>
- <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
- <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
- <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
- </div>';
- }
- //NEWSTICKER END
- //FEATURED ARTICLE
- $queryfeatured = $SQL->query( 'SELECT server_config.value, server_config.config FROM server_config WHERE server_config.config="featured";' )->fetchAll();
- if($queryfeatured[0]['value'])
- {
- $news_content .= '
- <div id="news" class="Box">
- <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
- <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
- <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
- <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
- <a href="/?subtopic=createaccount"><img src="'.$layout_name.'/images/pn.png" style="z-index:52; position:absolute; overflow: visible; width: 110px; height: 110px; top: -20px; right: -20px; background: no-repeat;" border="0"></a>
- <img class="Title" src="images/title/Featuredarticle.png" alt="Contentbox headline" />
- <div class="Border_2">
- <div class="Border_3">
- <div class="BoxContent" style="min-height:100px;background-image:url('.$layout_name.'/images/content/scroll.gif);">
- <div id=\'TeaserThumbnail\'><img src="images/featured.jpg" width=320 height=250 border=0 alt="" ALIGN=right hspace="10" /></div>
- <div id=\'TeaserText\'>
- <div>';
- $news_content .= $queryfeatured[0]['value'];
- $news_content .= '
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
- <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
- <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
- </div>
- ';
- }
- //FEATURED ARTICLE END
- /////////////////////////////////////////////////////////////////////////////////////////
- //The new edition of my script: Best Player, Last joined and something new Server Motd.//
- /////////////////////////Everything in the new appearance.///////////////////////////////
- //////////////////////////////////////by Aleh///////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////////
- ///Queries ///
- $query = $SQL->query('SELECT players.name,players.id,players.level, players.experience FROM players WHERE players.group_id <= '.$config['site']['players_group_id_block'].' AND players.name != "Account Manager" ORDER BY players.level DESC, players.experience DESC LIMIT 1;')->fetch();
- $query2 = $SQL->query('SELECT id, name FROM players ORDER BY id DESC LIMIT 1;')->fetch();
- $housesfree = $SQL->query('SELECT COUNT(*) FROM houses WHERE owner=0;')->fetch();
- $housesrented = $SQL->query('SELECT COUNT(*) FROM houses WHERE owner=1;')->fetch();
- $players = $SQL->query('SELECT COUNT(*) FROM players WHERE id>0;')->fetch();
- $accounts = $SQL->query('SELECT COUNT(*) FROM accounts WHERE id>0;')->fetch();
- $banned = $SQL->query('SELECT COUNT(*) FROM account_bans WHERE account_id>0;')->fetch();
- $guilds = $SQL->query('SELECT COUNT(*) FROM guilds WHERE id>0;')->fetch();
- ///End Queries ///
- $main_content .= '
- <table class="Table3" cellpadding="0" cellspacing="0" width="100%">
- <tbody>
- <tr>
- <td>
- <div class="InnerTableContainer">
- <table style="width:100%;">
- <tbody><tr>
- <td>
- <div class="TableShadowContainerRightTop">
- <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
- </div>
- <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
- <div class="TableContentContainer" style="padding:5px;">
- <table class="TableContent" width="100%"><tbody>
- <div class="NewsHeadline">
- <div class="NewsHeadlineBackground" style="background-image:url(./layouts/tibiarl/images/news/newsheadline_background.gif)">
- <div class="MostPowerfullGuilds">Welcome to '.$config['server']['serverName'].'</div>
- </div>
- </div>
- <tr bgcolor='. $config['site']['darkborder'] .'><td><center>Last joined us: <a href="?subtopic=characters&name='.urlencode($query2['name']).'">'.$query2['name'].'</a>, player number '.$query2['id'].'. Welcome and wish you a nice game!</center></td></tr>
- <tr bgcolor='. $config['site']['darkborder'] .'><td><center>Currently, the best player on the server is: <a href="index.php?subtopic=characters&name='.urlencode($query['name']).'"> '.$query['name'].'</a> ('.urlencode($query['level']).'). Congratulations!</center></td></tr>
- <tr bgcolor='. $config['site']['darkborder'] .'><td><center><b>Server motd:</b> '.$config['server']['motd'].'</center></td></tr>
- <table border=0 cellpadding=0 cellspacing=1 width=100%>
- <tr bgcolor='. $config['site']['darkborder'] .'><td><center><b>Free Houses:</b> '.$housesfree[0].'</center></td>
- <td><center><b>Rented Houses:</b> '.$housesrented[0].'</center></td></tr>
- <tr bgcolor='. $config['site']['darkborder'] .'><td><center><b>Accounts</b> in database: '.$accounts[0].'</center></td>
- <td><center><b>Players</b> in database: '.$players[0].'</center></td></tr>
- <tr bgcolor='. $config['site']['darktborder'] .'><td><center><b>Banned</b> accounts: '.$banned[0].'</center></td>
- <td><center><b>Guilds</b> in databese: '.$guilds[0].'</center></td></tr>
- </tbody></table>
- </div>
- </div>
- <div class="TableShadowContainer">
- <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
- <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
- <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
- </div>
- </div>
- </td>
- </tr>
- </tbody></table>
- </div>
- </td>
- </tr>
- </tbody>
- </table></br></br>';
- // top kills - guilds
- $main_content .= '';
- $main_content .= '<table class="Table3" cellpadding="0" cellspacing="0" width="100%">
- <tbody>
- <tr>
- <td>
- <div class="InnerTableContainer">
- <table style="width:100%;">
- <tbody><tr>
- <td>
- <div class="TableShadowContainerRightTop">
- <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
- </div>
- <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
- <div class="TableContentContainer" style="padding:5px;">
- <div class="NewsHeadline">
- <div class="NewsHeadlineBackground" style="background-image:url(./layouts/tibiarl/images/news/newsheadline_background.gif)">
- <div class="MostPowerfullGuilds">Most Powerfull Guilds</div>
- </div>
- </div>
- <table class="TableContent" width="100%"><tbody><tr>';
- 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 4;') as $guild)
- $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 />' . htmlspecialchars($guild['name']) . '</a><br />' . $guild['frags'] . ' kills
- </td>';
- $main_content .= '</tr>
- </tbody></table>
- </div>
- </div>
- <div class="TableShadowContainer">
- <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
- <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
- <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
- </div>
- </div>
- </td>
- </tr>
- </tbody></table>
- </div>
- </td>
- </tr>
- </tbody>
- </table></br></br>';
- function replaceSmile($text, $smile)
- {
- $smileys = array(';D' => 1, ':D' => 1, ':cool:' => 2, ';cool;' => 2, ':ekk:' => 3, ';ekk;' => 3, ';o' => 4, ';O' => 4, ':o' => 4, ':O' => 4, ':(' => 5, ';(' => 5, ':mad:' => 6, ';mad;' => 6, ';rolleyes;' => 7, ':rolleyes:' => 7, ':)' => 8, ';d' => 9, ':d' => 9, ';)' => 10);
- if($smile == 1)
- return $text;
- else
- {
- foreach($smileys as $search => $replace)
- $text = str_replace($search, '<img src="images/forum/smile/'.$replace.'.gif" />', $text);
- return $text;
- }
- }
- function replaceAll($text, $smile)
- {
- $rows = 0;
- while(stripos($text, '[code]') !== false && stripos($text, '[/code]') !== false )
- {
- $code = substr($text, stripos($text, '[code]')+6, stripos($text, '[/code]') - stripos($text, '[code]') - 6);
- if(!is_int($rows / 2)) { $bgcolor = '000000'; } else { $bgcolor = '000000'; } $rows++;
- $text = str_ireplace('[code]'.$code.'[/code]', '<i>Code:</i><br /><table cellpadding="0" style="background-color: #'.$bgcolor.'; width: 480px; border-style: dotted; border-color: #CCCCCC; border-width: 2px"><tr><td>'.$code.'</td></tr></table>', $text);
- }
- $rows = 0;
- while(stripos($text, '[quote]') !== false && stripos($text, '[/quote]') !== false )
- {
- $quote = substr($text, stripos($text, '[quote]')+7, stripos($text, '[/quote]') - stripos($text, '[quote]') - 7);
- if(!is_int($rows / 2)) { $bgcolor = 'AAAAAA'; } else { $bgcolor = 'CCCCCC'; } $rows++;
- $text = str_ireplace('[quote]'.$quote.'[/quote]', '<table cellpadding="0" style="background-color: #'.$bgcolor.'; width: 480px; border-style: dotted; border-color: #007900; border-width: 2px"><tr><td>'.$quote.'</td></tr></table>', $text);
- }
- $rows = 0;
- while(stripos($text, '[url]') !== false && stripos($text, '[/url]') !== false )
- {
- $url = substr($text, stripos($text, '[url]')+5, stripos($text, '[/url]') - stripos($text, '[url]') - 5);
- $text = str_ireplace('[url]'.$url.'[/url]', '<a href="'.$url.'" target="_blank">'.$url.'</a>', $text);
- }
- while(stripos($text, '[player]') !== false && stripos($text, '[/player]') !== false )
- {
- $player = substr($text, stripos($text, '[player]')+8, stripos($text, '[/player]') - stripos($text, '[player]') - 8);
- $text = str_ireplace('[player]'.$player.'[/player]', '<a href="?subtopic=characters&name='.urlencode($player).'">'.$player.'</a>', $text);
- }
- while(stripos($text, '[img]') !== false && stripos($text, '[/img]') !== false )
- {
- $img = substr($text, stripos($text, '[img]')+5, stripos($text, '[/img]') - stripos($text, '[img]') - 5);
- $text = str_ireplace('[img]'.$img.'[/img]', '<img src="'.$img.'">', $text);
- }
- while(stripos($text, '[b]') !== false && stripos($text, '[/b]') !== false )
- {
- $b = substr($text, stripos($text, '[b]')+3, stripos($text, '[/b]') - stripos($text, '[b]') - 3);
- $text = str_ireplace('[b]'.$b.'[/b]', '<b>'.$b.'</b>', $text);
- }
- while(stripos($text, '[i]') !== false && stripos($text, '[/i]') !== false )
- {
- $i = substr($text, stripos($text, '[i]')+3, stripos($text, '[/i]') - stripos($text, '[i]') - 3);
- $text = str_ireplace('[i]'.$i.'[/i]', '<i>'.$i.'</i>', $text);
- }
- while(stripos($text, '[u]') !== false && stripos($text, '[/u]') !== false )
- {
- $u = substr($text, stripos($text, '[u]')+3, stripos($text, '[/u]') - stripos($text, '[u]') - 3);
- $text = str_ireplace('[u]'.$u.'[/u]', '<u>'.$u.'</u>', $text);
- }
- return replaceSmile($text, $smile);
- }
- function showPost($topic, $text, $smile)
- {
- $text = ($text);
- $post = '';
- if(!empty($topic))
- $post .= '<b>'.replaceSmile($topic, $smile).'</b>';
- $post .= replaceAll($text, $smile);
- return $post;
- }
- $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_icon_id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 1 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll();
- if(isset($last_threads[0]))
- {
- $main_content .= '<table width="100%">';
- foreach($last_threads as $thread)
- {
- $main_content .= '
- <div class="NewsHeadline">
- <div class="NewsHeadlineBackground" style="background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)">
- <img src="'.$layout_name.'/images/news/icons/newsicon_'.$thread['post_icon_id'].'.gif" class="NewsHeadlineIcon" alt=\'\' />
- <div class="NewsHeadlineDate">'.date('M m Y', $thread['post_date']).' -</div>
- <div class="NewsHeadlineText">'.htmlspecialchars($thread['post_topic']).'</div>
- </div>
- </div>
- <table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
- <tr>';
- $main_content .= '
- <td style=\'padding-left:10px;padding-right:10px;\' ></br>' . showPost('', $thread['post_text'], $thread['post_smile']) . '<br><br><tr><td>by <a href="?subtopic=characters&name='. urlencode($thread['name']) .'">'. htmlspecialchars($thread['name']) .'</a></td><td style="text-align:right"><a href="?subtopic=communityboards&action=show_thread&id=' . $thread['id'] . '"><nobr>[Comments: ' . $thread['replies'] . ']</nobr></a></td></tr>';
- $main_content .= ' <td>
- <img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' />
- </td>
- </tr>
- </table><br />';
- }
- $main_content .= '</table>';
- }
- else
- $main_content .= '<h3>No news. Go forum and make new thread on board News.</h3>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement