Fatal error: Uncaught Error: Call to a member function fetchAll() on boolean in /var/www/html/pages/latestnews.php:246 Stack trace: #0 /var/www/html/system/load.page.php(7): include() #1 /var/www/html/index.php(60): include_once('/var/www/html/s...') #2 {main} thrown in
/var/www/html/pages/latestnews.php on line
246
my lastestnews.php
<script id="_wauli9">var _wau = _wau || []; _wau.push(["tab", "9vypw9hde3", "li9", "left-upper"]);</script><script async src="//waust.at/t.js"></script>
<?php header("Content-type: text/html; charset=utf-8"); ?>
<?php
if (!defined('INITIALIZED'))
exit;
//var_dump($config['server']);
//News Ticker
$news_content .= '
<div id="NewsTicker" class="Box">
<div class="Corner-tl" style="background-image:url(' . $layout_name . '/images/global/content/corner-tl.gif);"></div>
<div class="Corner-tr" style="background-image:url(' . $layout_name . '/images/global/content/corner-tr.gif);"></div>
<div class="Border_1" style="background-image:url(' . $layout_name . '/images/global/content/border-1.gif);"></div>
<div class="BorderTitleText" style="background-image:url(' . $layout_name . '/images/global/content/title-background-green.gif);"></div>
<img id="ContentBoxHeadline" class="Title" src="headline.php?text=News Ticker" alt="Contentbox headline">
<div class="Border_2">
<div class="Border_3">
<div class="BoxContent" style="background-image:url(' . $layout_name . '/images/global/content/scroll.gif);">';
//Show Tickers
$tickers = $SQL->query('SELECT * FROM ' . $SQL->tableName('newsticker') . ' ORDER BY ' . $SQL->fieldName('date') . ' DESC LIMIT 7;');
$number_of_tickers = 0;
if (is_object($tickers)) {
foreach ($tickers as $ticker) {
if (is_int($number_of_tickers / 2))
$color = "Odd";
else
$color = "Even";
//utf8_encode($variavel_contendo_string)
$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/global/content/' . $ticker['icon'] . '_small.gif)"></div>
<div id="TickerEntry-' . $number_of_tickers . '-Button" class="NewsTickerExtend" style="background-image:url(' . $layout_name . '/images/global/general/plus.gif)"></div>
<div class="NewsTickerText">
<span class="NewsTickerDate">' . date("M j Y", $ticker['date']) . ' - </span>
<div id="TickerEntry-' . $number_of_tickers . '-ShortText" class="NewsTickerShortText">' . (short_text($ticker['text'], 100)) . '</div>
<div id="TickerEntry-' . $number_of_tickers . '-FullText" class="NewsTickerFullText">' . ($ticker['text']) . '</div>
</div>
</div>
</div>';
$number_of_tickers++;
}
}
$news_content .= $tickers_to_add;
$news_content .= '
</div>
</div>
</div>
<div class="Border_1" style="background-image: url(' . $layout_name . '/images/global/content/border-1.gif);"></div>
<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url(' . $layout_name . '/images/global/content/corner-bl.gif);"></div></div>
<div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url(' . $layout_name . '/images/global/content/corner-br.gif);"></div></div>
</div>';
//End Tickers
//Featured Article
$accounts = $SQL->query('SELECT COUNT(*) FROM
accounts
;')->fetch();
$players = $SQL->query('SELECT COUNT(*) FROM
players
;')->fetch();
$news_content .= '
<!-- temporary countdown -->
<div id="tkn-countdown" style="text-align:center;font-family:assassin;font-size:35px;color:#ffdf8e;text-shadow: 0 0 10px #FFFFFF;"></div>
<script>
var countDownDate = new Date("'. $config['site']['start'] .'").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("tkn-countdown").innerHTML = days + " day " + hours + " hours " + minutes + " minutes " + seconds + " seconds ";
if (distance < 0) {
clearInterval(x);
document.getElementById("tkn-countdown").innerHTML = "Server Started!";
}
}, 1000);
</script>
<!-- end of temporary countdown -->
<div id="FeaturedArticle" class="Box">
<div class="Corner-tl" style="background-image:url('.$layout_name.'/images/global/content/corner-tl.gif);"></div>
<div class="Corner-tr" style="background-image:url('.$layout_name.'/images/global/content/corner-tr.gif);"></div>
<div class="Border_1" style="background-image:url('.$layout_name.'/images/global/content/border-1.gif);"></div>
<div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/global/content/title-background-green.gif);"></div>
<img id="ContentBoxHeadline" class="Title" src="headline.php?text=Featured Article" alt="Contentbox headline">
<div class="Border_2">
<div class="Border_3">
<div class="BoxContent" style="background-image:url('.$layout_name.'/images/global/content/scroll.gif);">
<div id="TeaserThumbnail">
<img src="'.$layout_name.'/images/news/announcement.gif" width="150" height="100" border="0" alt="">
</div>
<div style="position: relative; top: -9px; margin-bottom: 10px;"><br>
<font size="2px"></font><center><font size="2px"><b> IP:</b> otserv.com | <b>Port:</b> 7171 | <b>Version:</b> 12 </font> <br> </a></center><br><font size="2px"><b>'.$config['server']['serverName'].'</b> - <a href="?subtopic=serverinfo" <b="">Server Info</a> - <small>(learn to do <b><a href="?subtopic=serverinfo&action=tutorialdonate" <b="">Donate</a></b> and use our <b><a href="?subtopic=serverinfo&action=tutorialshop" <b="">Shop Online</a></b>)</small> <br><br> Welcome to <b><font color="green">'.$config['server']['serverName'].'</font></b>, we count on map most complete of all servers currently, Cooldown and reworked Spells for a more dynamic and fun PvP.<br>Several bugs fixed and being fixed daily. Come check out the best server of all time! <br><a href="?subtopic=createaccount" <b="">Create your account now</a> here your fun is guaranteed!
</font> </div>
<a id="Link" style="position: absolute; margin-bottom: 10px; top: 40px;" href="?subtopic=newsarchive&view=1">» read more</a>
</div>
</div>
</div>
<div class="Border_1" style="background-image:url('.$layout_name.'/images/global/content/border-1.gif);"></div>
<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url('.$layout_name.'/images/global/content/corner-bl.gif);"></div></div>
<div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url('.$layout_name.'/images/global/content/corner-br.gif);"></div></div>
</div>
';
//End Featured Article
//Functions
function replaceSmile ($text, $smile)
{
$smileys = array(
'
' => 1,
'
' => 2,
'
' => 3,
'
' => 4,
'
' => 5,
'
' => 6,
'
' => 7,
'
' => 8,
'
' => 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, '
') !== FALSE) {
$code = substr($text, stripos($text, '
') - stripos($text, '
Code:
') - 6);
if (!is_int($rows / 2)) {
$bgcolor = 'ABED25';
} else {
$bgcolor = '23ED25';
}
$rows++;
$text = str_ireplace('[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, '
') !== FALSE && stripos($text, '
') !== FALSE) {
$quote = substr($text, stripos($text, '
') - stripos($text, '
') - 7);
if (!is_int($rows / 2)) {
$bgcolor = 'AAAAAA';
} else {
$bgcolor = 'CCCCCC';
}
$rows++;
$text = str_ireplace('
', '<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, '
') !== FALSE && stripos($text, '') !== FALSE) {
$url = substr($text, stripos($text, '
') + 5, stripos($text, '') - stripos($text, '') - 5);
$text = str_ireplace('[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, '
') !== FALSE) {
$img = substr($text, stripos($text, '
') - stripos($text, '') - 5);
$text = str_ireplace('[img]' . $img . '', '<img src="' . $img . '">', $text);
}
while (stripos($text, '[letter]') !== FALSE && stripos($text, '[/letter]') !== FALSE) {
$letter = substr($text, stripos($text, '[letter]') + 8, stripos($text, '[/letter]') - stripos($text, '[letter]') - 8);
$text = str_ireplace('[letter]' . $letter . '[/letter]', '<img src="./images/forum/letters/letter_martel_' . $letter . '.gif">', $text);
}
while (stripos($text, '
') !== FALSE && stripos($text, '') !== FALSE) {
$b = substr($text, stripos($text, '
') + 3, stripos($text, '') - stripos($text, '
') - 3);
$text = str_ireplace('' . $b . '', '<b>' . $b . '</b>', $text);
}
while (stripos($text, '') !== FALSE && stripos($text, '') !== FALSE) {
$i = substr($text, stripos($text, '') + 3, stripos($text, '') - stripos($text, '') - 3);
$text = str_ireplace('' . $i . '', '<i>' . $i . '</i>', $text);
}
while (stripos($text, '') !== FALSE && stripos($text, '') !== FALSE) {
$u = substr($text, stripos($text, '') + 3, stripos($text, '') - stripos($text, '') - 3);
$text = str_ireplace('' . $u . '', '<u>' . $u . '</u>', $text);
}
return replaceSmile($text, $smile);
}
function showPost ($topic, $text, $smile)
{
$post = '';
if (!empty($topic))
$post .= '<b>' . replaceSmile($topic, $smile) . '</b>';
$post .= replaceAll($text, $smile);
return $post;
}
//End Functions
//Most Powerfull Guilds
$main_content .= '
<div class="InnerTableContainer">
<div class="TableShadowContainerRightTop">
<div class="TableShadowRightTop" style="background-image: url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);"></div>
</div>
<div class="TableContentAndRightShadow" style="background-image: url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">
<div class="TableContentContainer">
<table class="TableContent" style="border: 1px solid #faf0d7;">
<tbody>
<tr class="Table">
<td style="padding: 0; margin: 0 auto">
<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/global/content/newsheadline_background.gif)">
<div class="MostPowerfullGuilds">Most Powerfull Guilds</div>
</div>
</div>
<table border="0" cellspacing="3" cellpadding="4" width="100%">
<tr>';
$guildsPower = $SQL->query('SELECT g.id as id, g.name as name, COALESCE(SUM(pd
.unjustified
),0) as frags
FROM players
p LEFT JOIN player_deaths
pd ON pd
.killed_by
= p
.name
INNER JOIN guild_membership
gm ON p
.id
= gm
.player_id
LEFT JOIN guilds
g ON gm
.guild_id
= g
.id
GROUP BY g.id ORDER BY frags
DESC, g.id
ASC LIMIT 0, 4')->fetchAll();
foreach ($guildsPower as $guildp) {
$main_content .= '
<td style="text-align: center;">
<a href="?subtopic=guilds&action=view&GuildName=' . $guildp['name'] . '"><img src="guild_image.php?id=' . $guildp['id'] . '" width="64" height="64" border="0"/><br />' . $guildp['name'] . '</a><br />' . $guildp['frags'] . ' kills
</td>';
}
$main_content .= '
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="TableShadowContainer">
<div class="TableBottomShadow" style="background-image: url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
<div class="TableBottomLeftShadow" style="background-image: url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);"></div>
<div class="TableBottomRightShadow" style="background-image: url(' . $layout_name . '/images/global/content/table-shadow-br.gif);"></div>
</div>
</div>
</div>
<br />';
//Most Powerfull Guilds End
//Here start news
$last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('icon_id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('news_icon') . ', ' . $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('post_date') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll();
if (isset($last_threads[0])) {
foreach ($last_threads as $thread) {
$main_content .= '
<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/global/content/newsheadline_background.gif)">
<img src="' . $layout_name . '/images/global/content/' . $thread['news_icon'] . '.gif" class="NewsHeadlineIcon" alt=\'\' />
<div class="NewsHeadlineDate">' . date('M d 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" ><div style="max-width: 716px; word-wrap: break-word;">' . showPost('', $thread['post_text'], $thread['post_smile']) . '</div><br>';
if ($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
$main_content .= '
<p align="right"><a href="?subtopic=forum&action=edit_post&id=' . $thread['id'] . '">» Edit this news</a></p>';
$main_content .= '
<p align="right"><a href="?subtopic=forum&action=show_thread&id=' . $thread['id'] . '">» Comment on this news</a></p>
</td>';
$main_content .= '
<td>
<img src="' . $layout_name . '/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' />
</td>
</tr>
</table><br />';
}
} else
$main_content .= '';