• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

AAC [Gesior2012] Bug on layout Lastest News

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,237
Solutions
17
Reaction score
104
Location
Brazil
Hello guys,

I have tried to put a News Ticker on Gesior 2012, but i f*cked up something, layout of page its wrong.

1668122928043.png
When i click on news ticker page got error too:
1668122956284.png

Here follow page:

PHP:
<div id="LayerPop" style="display:block; position:absolute; left:0px; top:0px; background-color:#1e1e22; width:100%; height:100%; z-index:100;margin:0px;opacity:0.85;"></div>
<div id="LayerPop2" style="position: absolute; left: 0%; top: 120px; z-index: 5000;"><a href="?subtopic=buypoints" target="_BLANK"><img src="images/promo.png" class="imgBorder"></a><br><a href="#" onClick="document.getElementById('LayerPop').style.display = 'none';document.getElementById('LayerPop2').style.display = 'none'">
<b><h3><font color=white>Close</font></h3></b></a></div>

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 50px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
</style>

<?php

//######################## SHOW TICKERS AND NEWS #######################
$tickerSql = $SQL->query("SELECT ");
//NEWSTICKER
$time = time();
$vTick = $SQL->query("SELECT " .$SQL->fieldName('date'). " FROM " .$SQL->tableName('z_news_tickers'). " WHERE " .$SQL->fieldName('hide_ticker'). " = '0'")->fetch();
if(isset($vTick['date'])){
    $main_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);"></div>
            <img class="Title" src="'.$layout_name.'/images/header/headline-newsticker.gif" alt="Contentbox headline" />
                <div class="Border_2">
                    <div class="Border_3">
                        <div class="BoxContent" style="background-image: url('.$layout_name.'/images/content/scroll.gif);">';
                        //##################### ADD NEW TICKER #####################
                        if($action == "newticker") {
                            if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
                                $ticker_text = stripslashes(trim($_POST['new_ticker']));
                                $ticker_icon = (int) $_POST['icon_id'];
                                if(empty($ticker_text)) {
                                    $main_content .= 'You can\'t add empty ticker.';
                                }
                                else
                                {
                                if(empty($ticker_icon)) {
                                    $news_icon = 0;
                                }
                        $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)');
                        $main_content .= '
                            <center>
                                <h2>
                                    <font color="red">Added new ticker:</font>
                                </h2>
                            </center>
                            <hr/>
                            <div id="newsticker" class="Box">
                                <div id="TickerEntry-1" class="Row" onclick=\'TickerAction("TickerEntry-1")\'>
                                    <div class="Odd">
                                        <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
                                        <div id="TickerEntry-1-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
                                        <div class="NewsTickerText">
                                                <span class="NewsTickerDate">'.date("d/m/Y", $time).' -</span> 
                                                <div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
                        $main_content .= '
                            <a href="?subtopic=latestnews&action=deleteticker&id='.$time.'">
                                <img src="'.$layout_name.'/images/news/delete.png" border="0">
                            </a>';
                        $main_content .= short_text($ticker_text, 60).'</div>
                            <div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
                        $main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
                        $main_content .= $ticker_text.'
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <hr/>';
        }
    }
    else
    {
        $main_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
    }
        $main_content .= '<form action="?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>';
    }
    //#################### DELETE (HIDE only!) TICKER ############################
    if($action == "deleteticker") {
    if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
    header("Location: ");
    $date = (int) $_REQUEST['id'];
    $SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
    $main_content .= '<center>News tickets with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="?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></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>';
    }
    else
    {
    $main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="?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>';
    }
    }
    //show tickers if any in database or not blocked (tickers limit = 0)
    $tickers = $SQL->query('SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 5;')->fetchAll();
    $number_of_tickers = 0;
    if(!empty($tickers)) {
    foreach($tickers as $ticker) {
        if(is_int($number_of_tickers / 2))
                $color = "Odd";
        else
                $color = "Even";
        $main_content .= '<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['image_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['date']).' -</span>
              <div id="TickerEntry-'.$number_of_tickers.'-ShortText" class="NewsTickerShortText">';
        //if admin show button to delete (hide) ticker
        if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
            $main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
        }
        $main_content .= short_text($ticker['text'], 60).'</div>
              <div id="TickerEntry-'.$number_of_tickers.'-FullText" class="NewsTickerFullText">';
        //if admin show button to delete (hide) ticker
        if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
            $main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
        }
        $main_content .= $ticker['text'].'</div>
            </div>
          </div>
        </div>';
        $number_of_tickers++;
        }
    }
}

$players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch();
$accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch();

    $main_content .= '
    <center><font style="text-decoration: inherit; text-shadow:#000 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px" size="3px" color="white"><b>| Welcome to ExtremeOT |</b></font></center>
    <br>
    <center><font style="text-decoration: inherit; text-shadow:#000 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px" size="2px" color="white">| IP: <font color="#FF131B">extremeot.com.br</font> | Port: <font color="#FF131B">'.$config['server']['loginPort'].'</font> | Version: <font color="#FF131B">7.6</font> |</font></center><br></center>    
    <br/>
    <p align="center"><img src="images/lastnews/line.png" alt="*"><br/>
    <table class="tg"><td>
    <img src="images/lastnews/logo1.gif" alt="*">


';


                $main_content .= '<font color="green"><a href="?subtopic=whoisonline">Online</a>: '.$config['status']['serverStatus_players'].'</font>';

               
               
        $main_content .= '       
  </td>
  <td>
  <img src="images/lastnews/logo4.gif" alt="*"> Exp rate: <a href="?subtopic=serverinfo">Here</a>
  </td>
  <td>
  <img src="images/lastnews/logo7.gif" alt="*"> ADM FX-6300 - 3.5 ghz
  </td>
  <tr>
  <td>
<img src="images/lastnews/logo2.gif" alt="*"> Accounts: '.$accounts[0].'
  </td>
    <td>
  <img src="images/lastnews/logo5.gif" alt="*"> Loot rate: 2x '.$config['site']['sInfoLoot'].'
  </td>
 
    <td>
  <img src="images/lastnews/logo8.gif" alt="*"> Ram: 12 GB
  </td>
 
  <tr>
   <td>
<img src="images/lastnews/logo3.gif" alt="*"> Players: '.$players[0].'
  </td>
      <td>
  <img src="images/lastnews/logo6.gif" alt="*"> Skills rate: 30x '.$config['site']['sInfoSkill'].'
  </td>
 
      <td>
  <img src="images/lastnews/logo9.gif" alt="*"> Magic Rate: 15x
  </td>
  <tr>
  
</table>
<p align="center"><img src="images/lastnews/line.png" alt="*"><br/>
</p>
    ';

    $main_content .= '<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
<table border="0">
<tr>

<center><font style="text-decoration: inherit; text-shadow:#000 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px" size="3px" color="white">| Most powerfull guilds |</font></center>

</tr>
</table>
</div>
</div>
<table border="0" cellspacing="3" cellpadding="4" width="100%">
<tr> ';

foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
`g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags`
FROM `killers` k
LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
GROUP BY `name`
ORDER BY `frags` DESC, `name` ASC
LIMIT 0, 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></table>';

    $main_content .= '
        <p align="center"><img src="images/lastnews/line.png" alt="*"><br/>
        <p align="center"><img src="images/lastnews/latest.png" alt="*">
';
   
    if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){$main_content .=  '<a href="?subtopic=forum&action=new_topic&section_id=1">Add new news</a>';}
$tables = $SQL->query("SELECT `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();
foreach ($tables as $row)
{
         $BB = array(
        '/\[b\](.*?)\[\/b\]/is' => '<strong>$1</strong>',
        '/\[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>',
        '/\[u\](.*?)\[\/u\]/is' => '<u>$1</u>',
        '/\[i\](.*?)\[\/i\]/is' => '<i>$1</i>',
        '/\[url](.*?)\[\/url\]/is' => '<a href=$1>$1</a>',
        '/\[img\](.*?)\[\/img\]/is' => '<img src=$1 alt=$1 />',
        '/\[player\](.*?)\[\/player\]/is' => '<a href='.$server['ip'].'?subtopic=characters&amp;name=$1>$1</a>',
        '/\[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>'
        );
        $message = preg_replace(array_keys($BB), array_values($BB), nl2br($row['post_text']));
        $main_content .= '<div class=\'NewsHeadline\'>

        </div>
        <table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>
        ';
        if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
        {
                  $main_content .='<td width="100%">'.$message.'<br><h6><i>Posted by </i><font color="green">'.$row['name'].'</font></h6><p align="right"><a href="?subtopic=forum&action=remove_post&id='.$row['id'].'"><font color="red">[Delete this news]</font></a>  <a href="?subtopic=forum&action=edit_post&id='.$row['id'].'"><font color="green">[Edit this news]</font></a>      <a href="?subtopic=forum&action=show_thread&id='.$row['id'].'">Comments: '.$row['replies'].'</a></p>';
                $main_content .= '<tr style="background-color:black;width:100%;height:3px"><td colspan="2"></td></tr>';
        }
        else       
        {
            $main_content .='<td width="100%">'.$message.'<br><h6><i>Posted by </i><font color="green">'.$row['name'].'</font></h6><p align="right"><a href="?subtopic=forum&action=show_thread&id='.$row['id'].'">Comments: '.$row['replies'].'</a></p>';       
            $main_content .= '<tr style="background-color:black;width:100%;height:3px"><td colspan="2"></td></tr>';
     }
        $main_content .= '</td>
        </tr></table>';
}

?>
 
Top