Ir para conteúdo
  • Cadastre-se

(Resolvido)Erros de Lastnews e Pages Alguem ajuda?


Ir para solução Resolvido por Digoshow,

Posts Recomendados

Galera estou com alguns erros aqui no Gesior que eu não estou conseguindo resolver se alguem ae saber como resolver me da uma mão porfavor.

Bom vou postar as imagens deles aqui!

 

1- Entro na pagina e fica aparecendo aquelas mensagens falando que tal função não existe..

Pagina de Videos

Spoiler

29y5roy.jpg

 

Scrip da Pagina de Videos

Spoiler

<?PHP
$main_content .= '<h4 style="" id="pt">
<br>
<center><h2><b> Videos</b></h2></center><br><br>
 
<center><object height="350" width="425"><img
 
src="http://icons.iconarchive.com/icons/thiago-silva/palm/256/Videos-icon.png" height="700"
 
width="525"></object></center><br>
 
<br><br> </h4>
 
 
<b></b><center><b>Nessa secao voce pode postar o video de uma war bem legal, ou uma quest ou voce com seu time cacando, os melhores videos serao divulgados aqui!
Fique de olho no canal sempre tem videos de eventos e de voces.
';
?>
<?php
if($logged)
{
    $account_login = $account_logged->getName();
    $account_players = $account_logged->getPlayers();
    foreach($account_players as $player)
    {
        $player = $player->getName();
$player2 = str_replace(strtoupper("'"),"+",strtoupper($player));
                    }
}
 
include('videossql.php');

$videoid = $_GET["videoid"];
$cat = $_GET["cat"];
 
$main_content .= '
 
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<TR BGCOLOR="#F1E0C6"> 
<TD COLSPAN=3 CLASS=red>
<font size="4px"><strong>Selecione uma categoria.</strong></font><br />
<strong><a href="index.php?subtopic=videos">Ultimos 5</a></strong> | <strong><a href="index.php?subtopic=videos&amp;cat=War">War</a></strong> | <strong><a href="index.php?subtopic=videos&amp;cat=Quest">Quest</a></strong> | <strong><a href="index.php?subtopic=videos&amp;cat=Hunt">Hunt</a></strong> | <strong><a href="index.php?subtopic=videos&amp;cat=counter strike">Counter Strike</a></strong> | <strong><a href="index.php?subtopic=videos&amp;cat=others">Others</a></strong>
</TD> 
</TR>
<TR BGCOLOR="#505050">
<TD COLSPAN=3 bgcolor="#D4C0A1" CLASS=white style="font-size:11px"><em><a href="index.php?subtopic=videos&amp;action=add">
Click aqui para enviar seu video, somente videos do youtube por gentileza.
</a></em></TD>
</TR> 
</TABLE>
<br />';
if($action == ''){
if($cat != ''){
include('videossql.php');
$sql = "SELECT * FROM videos  WHERE  categoria='$cat' AND aprovado='1' ORDER BY data DESC";
$limite = mysql_query("$sql");
while ($sql = mysql_fetch_array($limite)) {
 
$videoid = $sql["id"];
$charnick = $sql["charnick"];
$comentario = $sql["comentario"];
$categoria = $sql["categoria"];
$link = $sql["link"];
$data = $sql["data"];
$data2 = date('d/m/Y - H:i', $data);
$server = $sql["server"];
$link = str_replace('http://www.youtube.com/watch?v=', $link);
$link = str_replace('&feature=player_embedded', '', $link);
 
$main_content .= '
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<TR BGCOLOR="#505050"> 
<TD CLASS=white COLSPAN=3><B>Postado por: '.$charnick.' ('.$server.')</B></TD>
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#F1E0C6"><a href="?subtopic=videos&amp;action=view&amp;videoid='.$videoid.'">Nome do video: '.$comentario.'</a></TD> 
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD align="right" bgcolor="#D4C0A1">Postado dia: '.$data2.'</TD> 
  </TR> 
                <TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#F1E0C6"><a href="?subtopic=videos&amp;action=view&amp;videoid='.$videoid.'"></a></TD> 
</TR> 
</TABLE>';
};
}
if($cat == ''){
$main_content .= '
 
<font size="4px"><strong>Ultimos videos postados</strong></font>
<br />
 
';
 
$sql = "SELECT * FROM videos  WHERE aprovado='1' ORDER BY data DESC LIMIT 5";
$limite = mysql_query("$sql");
{
 
$videoid = $sql["id"];
$charnick = $sql["charnick"];
$comentario = $sql["comentario"];
$categoria = $sql["categoria"];
$link = $sql["link"];
$data = $sql["data"];
$server = $sql["server"];
$link = str_replace('http://www.youtube.com/watch?v=', $link);
$link = str_replace('&feature=player_embedded', '', $link);
 
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<TR BGCOLOR="#505050"> 
<TD CLASS=white COLSPAN=3><B> [Categoria : '.$categoria.'] - Postado por: '.$charnick.' ('.$server.')</B></TD>
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#F1E0C6"><a href="?subtopic=videos&amp;action=view&amp;videoid='.$videoid.'">Nome do video: '.$comentario.'</a></TD> 
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD align="right" bgcolor="#D4C0A1">Postado dia: '.$data2.' - <i>'.$categoria.'</i>
</TD> 
  </TR> 
               
</TABLE>';
};
 
};
 
}
if($action == 'add'){
if($logged)
{
    $account_login = $account_logged->getName();
    $account_players = $account_logged->getPlayers();
    foreach($account_players as $player)
    {
        $player = $player->getName();
$player2 = str_replace(strtoupper("'"),"+",strtoupper($player));
   }
 
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<form action="/index.php?subtopic=videos&action=add1" method="POST"><input type="hidden" name="videos" value=""> 
<TR BGCOLOR="#505050"> 
<TD CLASS=white COLSPAN=3><B>Submit YouTube Videos</B></TD>
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#F1E0C6">Char: ';
                 $main_content .= '
 <select name="charnick" id="charnick">';
 
$players_from_logged_acc = $account_logged->getPlayersList();
            if(count($players_from_logged_acc) > 0)
            {
              $players_from_logged_acc->orderBy('name');
              foreach($players_from_logged_acc as $player)
              {
                $main_content .= '
<option>'.$player->getName().'</option>';
 
              }
            }
            else
            {
              $main_content .= 'You don\'t have any character on your account.'; 
             }
 
               $main_content .= '
</select>';
 
$main_content .= '</TD> 
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#D4C0A1">Link YouTube: 
   <input name="link" type="text" id="link" size="40" /></TD> 
</TR> 
                <TR BGCOLOR=#F1E0C6> 
<TD bgcolor="#F1E0C6">Video Name:
 <input name="comentario" type="text" id="comentario" size="50" /></TD> 
</TR> 
                <TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#D4C0A1">Categoria::
 <select name="categoria" id="categoria">
   <option>War</option>
   <option>Quest</option>
   <option>Hunt</option>
   <option>Counter Strike</option>
   <option>Others</option>
     </select></TD> 
</TR> 
                <TR BGCOLOR=#F1E0C6> 
<TD bgcolor="#F1E0C6">Server:  <select name="server" id="server">
   <option>World Tibia</option>
      <option>World Tibia Counter Strike</option>
     </select></TD> 
</TR> 
 
</TABLE><BR> 
<center><input type="image" value="submit" src="layouts/tibiacom/images/buttons/sbutton_submit.gif"/> 
</form>';
}
else
{
        $main_content .= 'To add videos, you need to log into your account.';
}
 
}
if($action == 'add1'){
$charnick = $_POST["charnick"];
$link = $_POST["link"];
$comentario = $_POST["comentario"];
$server = $_POST["server"];
$categoria = $_POST["categoria"];
$aprovado = "1";
$data = time();
 
 
include('videossql.php');
$sql = "INSERT INTO videos (id, charnick, link, comentario, categoria, server, aprovado, data) VALUES ('', '$charnick', '$link', '$comentario', '$categoria', '$server', '$aprovado', '$data')";
$main_content .= '
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<TR BGCOLOR="#505050"> 
<TD COLSPAN=3 CLASS=white><center>
 Video Enviado!<strong><a href="index.php?subtopic=videos&amp;cat=OUTROS"></a></strong>
</center></TD> 
</TR>
<TR BGCOLOR="#505050">
 <TD COLSPAN=3 bgcolor="#D4C0A1" CLASS=black><p>Your video was sent as soon as approved by our GM, will be posted automatically if something goes wrong with the video, we will contact In-Game.</p>
     <p>Obrigado!</p></TD>
  </TR> 
</TABLE>';
 
$sql = mysql_query($sql)
or die ("There was an error in recording data, please click back and check the required fields!");
};
 
if($action == 'view'){
$videoid = $_GET["videoid"];
 
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<TR BGCOLOR="#F1E0C6"> 
<TD COLSPAN=3 CLASS=red><center>
<strong><a href="javascript:history.back(1)"><< Voltar</a></strong>
</center></TD> 
</TR>
</TABLE>';
 
 
$sql = "SELECT * FROM videos  WHERE  id='$videoid' AND aprovado='1' LIMIT 1";
$limite = mysql_query("$sql");
while ($sql = mysql_fetch_array($limite)) {
 
$charnick = $sql["charnick"];
$comentario = $sql["comentario"];
$categoria = $sql["categoria"];
$link = $sql["link"];
$data = $sql["data"];
$server = $sql["server"];
$link = str_replace('http://www.youtube.com/watch?v=', $link);
$link = str_replace('&feature=player_embedded', '', $link);
 
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
<TR BGCOLOR="#505050"> 
<TD CLASS=white COLSPAN=3><B>Posted on: '.$charnick.' ('.$server.')</B></TD>
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#F1E0C6">Comment: '.$comentario.'</TD>
</TR> 
<TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#D4C0A1"><center><object width="480" height="385"><param name="movie" value="http://www.youtube.com/watch?v='.$link.'?fs=1&amp;hl=pt_BR&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/watch?v='.$link.'?fs=1&amp;hl=pt_BR&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></center></TD> 
</TR> 
                <TR BGCOLOR=#D4C0A1> 
<TD bgcolor="#F1E0C6">Posted on: '.$data2.' - <i>'.$cat.'</i></TD>
</TR> 
                <TR BGCOLOR=#D4C0A1> 
<TD>&nbsp;</TD> 
</TR> 
 
</TABLE>';
};
 
 
$sql = "SELECT * FROM comentarios WHERE  videoid='$videoid' ORDER BY data ASC";
$limite = mysql_query("$sql");
while ($sql = mysql_fetch_array($limite)) {
 
$id = $sql["id"];
$videoid = $sql["videoid"];
$charnick = $sql["charnick"];
$servidor = $sql["servidor"];
$comentariox2 = $sql["comentario"];
$account_comment = $sql["account"];
 
 
$data = $sql["data"];
$data2 = date('d/m/Y - H:i:s', $data);
 
if ($account_login == $account_comment){
 $owner = "1";
$delmsg = "<a href='?subtopic=videos&action=delcomment&videoid=$videoid&idcoment=$id'><img src=layouts/tibiacom/images/news/delete.png />";
} else {
 $owner = "0";
$delmsg = "";
}
 
$main_content .= '
<table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr BGCOLOR="#505050">
                                        <TD CLASS=white><b>-</b></TD>
                                </tr>
  <tr bgcolor="#D4C0A1">
    <td bgcolor="#F1E0C6">Posted by: <a href="index.php?subtopic=characters&name='.$charnick.'"> <i>'.$charnick.'</i></a> | Server: <i>'.$servidor.'</i></td>
  </tr>
  <tr>
    <td bgcolor="#D4C0A1">Comment:</td>
  </tr>
  <tr>
    <td bgcolor="#F1E0C6"><b>'.$comentariox2.'</b></td>
  </tr>
  <tr>
    <td bgcolor="#D4C0A1">Data: '.$data2.' - '.$delmsg.'</td>
  </tr>
  <tr>
    <td bgcolor="#F1E0C6"></td>
  </tr>
</table>';
};
 
 
if($logged)
{
 
    $account_login = $account_logged->getName();
    $account_players = $account_logged->getPlayers();
    foreach($account_players as $player)
    {
        $player = $player->getName();
$player2 = str_replace(strtoupper("'"),"+",strtoupper($player));
   }
 
$main_content .= '
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
<TR BGCOLOR="#505050">
<TD CLASS=white><b>Make comment:</b></TD>
</TR>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form id="fazercomentario" name="fazercomentario" method="post" action="?subtopic=videos&action=view&videoid='.$videoid.'&coment=add">
  <tr bgcolor="#D4C0A1">
    <td bgcolor="#F1E0C6">
 
Comment with the character: ';
 
                                                  $main_content .= '
                                                                          <select name="charnick" id="charnick">';
 
$players_from_logged_acc = $account_logged->getPlayersList();
            if(count($players_from_logged_acc) > 0)
            {
              $players_from_logged_acc->orderBy('name');
              foreach($players_from_logged_acc as $player)
              {
                $main_content .= '
                                <option>'.$player->getName().'</option>';
 
              }
            }
            else
            {
              $main_content .= 'You don\'t have any character on your account.';
                                      }
 
                                                $main_content .= '
                                </select>';
 
$main_content .= '
</td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#D4C0A1">Comment:
      <label for="comentariox1"></label>
    <textarea name="comentariox1" id="comentariosx1" cols="60" rows="5"></textarea></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#F1E0C6"><input type="submit" name="button" id="button" value="Enviar" />
    </form></td>
  </tr>
</table>';
$coment = $_GET["coment"];
if ($coment  == "add"){
echo $_POST['comentariox1'];
$charnick2 = "$player";
$servidor2 = "Heoria";
$comentariox1 = $_POST['comentariox1'];
$data2 = time();
$videoid2 = $_GET["videoid"];
include('videossql.php');
$comentariox1=strtr($comentariox1, '\'', '*');
if ($comentariox1 != ""){
$sql = "INSERT INTO comentarios (id, videoid, charnick, servidor, comentario, data, account) VALUES ('', '$videoid', '$charnick2', '$servidor2', '$comentariox1', '$data2', '$account_login')";
} else {
$msgerro = "Empty Comments!";
$erro = "?subtopic=videos&action=view&videoid=$videoid&msg=$msgerro";
header("Location: $erro");
}
if(!mysql_query($sql)){
    $erro = mysql_error();
    echo "Ocorreu o seguinte erro: ", '"', $erro, '"';
} else {
$sucesso = "Comment Sucessfull!";
$sucesso = "?subtopic=videos&action=view&videoid=$videoid&msg=$sucesso";
header("Location: $sucesso");
}
 
}
}
else
{
        $main_content .= 'Please enter your account number and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=videos&action=view&videoid='.$videoid.'" method="post" ><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Login</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Number:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><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="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';
}
 
}
$idcoment = $_GET["idcoment"];
$idcoment=strtr($idcoment, '\'', '*');
if (($action == "delcomment") && ($idcoment != "")){
$sql = "SELECT * FROM comentarios WHERE  id=$idcoment LIMIT 1";
$limite = mysql_query("$sql");
while ($sql = mysql_fetch_array($limite)) {
$accountvideo = $sql["account"];
 
if ($account_login == $accountvideo){
$vidx = "DELETE FROM comentarios WHERE id='$idcoment'";
$resultado = mysql_query($vidx)
or die ("Unable to perform the deletion of data.");
echo "<h1>Video deleted successfully!</h1>";
 
$sucesso = "?subtopic=videos&action=view&videoid=$videoid&msg=Deleted";
header("Location: $sucesso");
} else {
$sucesso = "?subtopic=videos&action=view&videoid=$videoid&msg=ERRO";
header("Location: $sucesso");
}
}
}
?>

 

 

2- Assim que entra na pagina fica uma mensagem de erro Last News

LastNews imagem do erro

Spoiler

wji0li.jpg

Scrip Lastnews

Spoiler

<?php
$main_content .= '
<div class="InnerTableContainer">
    <table>
        <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">
                                <table class="TableContent" style="border: 1px solid #faf0d7;">
                                    <tbody>
                                        <tr style="background-color: #505050;">
                                        </tr>
                                            <tr class="Table" style="background-color: #d4c0a1;">
                                                <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7;">
                                                    <div class="NewsHeadline">
                                                        <div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
                                                            <table border="0">
                                                                <tr>
                                                                    <td style="text-align: center; font-weight: bold;">
                                                                        <font color="white">Most powerful guilds</font>
                                                                    </td>
                                                                </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 />' . $guild['name'] . '</a><br />' . $guild['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/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>
<br />';
if(!defined('INITIALIZED'))
    exit;

$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'])){
$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);"></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)) {
                                $news_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)');
                    $news_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">';
                    $news_content .= '
                        <a href="?subtopic=latestnews&action=deleteticker&id='.$time.'">
                            <img src="'.$layout_name.'/images/news/delete.png" border="0">
                        </a>';
                    $news_content .= short_text($ticker_text, 60).'</div>
                          <div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
                    $news_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
                    $news_content .= $ticker_text.'
                        </div>
                    </div>
                  </div>
            </div>
        </div>
    <hr/>';
    }
}
else
{
    $news_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
}
    $news_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.';');
$news_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
{
$news_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;');
$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['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']) {
$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
}
$tickers_to_add .= 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']) {
$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
}
$tickers_to_add .= $ticker['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` ,`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."')");
$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 .= '<script type="text/javascript">
var showednewticker_state = "0";
function showNewTickerForm()
{
if(showednewticker_state == "0") {
document.getElementById("newtickerform").innerHTML = \'<form action="?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="images/news/icon_0.gif" width="20"></td><td><img src="images/news/icon_1.gif" width="20"></td><td><img src="images/news/icon_2.gif" width="20"></td><td><img src="images/news/icon_3.gif" width="20"></td><td><img src="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>\';
document.getElementById("jajo").innerHTML = \'\';
showednewticker_state = "1";
}
else {
document.getElementById("newtickerform").innerHTML = \'\';
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>\';
showednewticker_state = "0";
}
}
</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/>';
//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
$featured_article = $SQL->query("SELECT * FROM z_featured_article ORDER BY id DESC LIMIT 1")->fetchAll();

 if(isset($featured_article[0]))
    {
        foreach($featured_article as $featured)
        {

            $news_content .= '
                <div id="FeaturedArticle" 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 id="ContentBoxHeadline" class="Title" src="'.$layout_name.'/images/header/headline-featuredarticle.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);">
                                <div id="TeaserThumbnail">';
                                if(!empty($featured['read_more'])){
                                    $news_content .= '
                                    <a href="'.$featured['read_more'].'">';
                                }
                                $news_content .= '
                                        <img src="'.$layout_name.'/images/news/announcement.jpg" width="150" height="100" border=0 alt="" />';
                                if(!empty($featured['read_more'])){
                                $news_content .= '
                                    </a>';
                                    }
                            $news_content .= '
                                </div>';
                                if(!empty($featured['read_more'])){
                                $news_content .= '
                                <a id="Link" href="'.$featured['read_more'].'">&raquo; read more</a>';
                                }
                                $news_content .= '
                                <div id="TeaserText">
                                    <div style="position: relative; top: -2px; margin-bottom: 2px;" >
                                        <b>'.$featured['title'].'</b>
                                    </div>
                                    '.$featured['text'].'
                                </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
        
function replaceSmile($text, $smile)
{
    $smileys = array(
                        ':p' => 1, 
                        ':eek:' => 2, 
                        ':rolleyes:' => 3, 
                        ';)' => 4, 
                        ':o' => 5, 
                        ':D' => 6,  
                        ':(' => 7, 
                        ':mad:' => 8,
                        ':)' => 9,
                        ':cool:' => 10
                    );
    if($smile == 1)
        return $text;
    else
    {
        foreach($smileys as $search => $replace)
            $text = str_replace($search, '<img src="layouts/tibiarl/images/forum/smile/'.$replace.'.gif" />', $text);
        return $text;
    }
}

function replaceAll($text, $smile)
{
    $rows = 0;
    while(stripos($text, '

') !== false && stripos($text, '

') !== false )
    {
        $code = substr($text, stripos($text, '

')+6, stripos($text, '

') - stripos($text, '

') - 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, '

')+7, stripos($text, '

') - stripos($text, '

') - 7);


        if(!is_int($rows / 2)) { $bgcolor = 'AAAAAA'; } else { $bgcolor = 'CCCCCC'; } $rows++;
        $text = str_ireplace('
    }
    $rows = 0;
    while(stripos($text, '') !== false && stripos($text, '') !== false )
    {
        $url = substr($text, stripos($text, '')+5, stripos($text, '') - stripos($text, '') - 5);
        $text = str_ireplace(''.$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=&name='.urlencode($player).'">'.$player.'</a>', $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/letters/letter_martel_'.$letter.'.gif">', $text);
    }
    while(stripos($text, ') !== false && stripos($text,') !== false )
    {
        $img = substr($text, stripos($text, ')+5, stripos($text,') - stripos($text, '') - 5);
        $text = str_ireplace('.$img.', '<img src="'.$img.'">', $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)
{
    $text = nl2br($text);
    $post = '';
    if(!empty($topic))
        $post .= '<b>'.replaceSmile($topic, $smile).'</b>';
    $post .= replaceAll($text, $smile);
    return $post;
}

if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action != 'newnews')
    {
        $main_content .= '
            <font style="font-size: 16px; font-weight: bold; margin-left: 20px;">Adding News</font>
            <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">
                                <tr bgcolor="F1E0C6">
                                    <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 bgcolor="D4C0A1">
                                    <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" ></td>
                </tr>
                <tr>
                    <td align="center" bgcolor="D4C0A1"><b>News<br>text:</b></td>';
                //Tiny Editor
                $main_content .= '
                    <script type="text/javascript" src="'.$layout_name.'/tiny_mce/tiny_mce.js"></script>
                    <script type="text/javascript">
                        tinyMCE.init({
                            // General options
                            mode : "textareas",
                            theme : "advanced",
                            plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
                    
                            // Theme options
                            theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl",
                            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",
                            theme_advanced_toolbar_location : "top",
                            theme_advanced_toolbar_align : "left",
                            theme_advanced_statusbar_location : "bottom",
                            theme_advanced_resizing : true,
                    
                            // Example content CSS (should be your site CSS)
                            content_css : "css/content.css",
                    
                            // Drop lists for link/image/media/template dialogs
                            template_external_list_url : "lists/template_list.js",
                            external_link_list_url : "lists/link_list.js",
                            external_image_list_url : "lists/image_list.js",
                            media_external_list_url : "lists/media_list.js",
                    
                            // Style formats
                            style_formats : [
                                {title : \'Bold text\', inline : \'b\'},
                                {title : \'Red text\', inline : \'span\', styles : {color : \'#ff0000\'}},
                                {title : \'Red header\', block : \'h1\', styles : {color : \'#ff0000\'}},
                                {title : \'Example 1\', inline : \'span\', classes : \'example1\'},
                                {title : \'Example 2\', inline : \'span\', classes : \'example2\'},
                                {title : \'Table styles\'},
                                {title : \'Table row 1\', selector : \'tr\', classes : \'tablerow1\'}
                            ],
                    
                            // Replace values for the template plugin
                            template_replace_values : {
                                username : "Some User",
                                staffid : "991234"
                            }
                        });
                    </script>';
                $main_content .= '
                    <td bgcolor="F1E0C6">
                        <textarea name="text" id="elm1" rows="6" cols="60"></textarea>
                    </td>
                </tr>
                <tr>
                    <td width="180"><b>Character:</b></td>
                    <td>
                        <select name="char_id">
                           <option value="0">(Choose character)</option>';
                            foreach($account_logged->getPlayers() as $player)
                            {
                             $main_content .= '<option value="'.$player->getID().'">'.$player->getName().'</option>';
                            }       
                            $main_content .= '       
                          </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>
        </td>
    </tr>
</table>
<hr/>';
}


    $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('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();
    
    //Here start news
    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/news/newsheadline_background.gif)">
                        <img src="'.$layout_name.'/images/news/icons/newsicon_'.$thread['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;\' >' . showPost('', $thread['post_text'], $thread['post_smile']) . '<br><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 .= '<h3>No news. Go forum and make new thread on board News.</h3>';

 

3- Coloquei um box no website de Like facebook, porem quando clica lá não curte a pagina e o botao Like muda para "Erro"

 

Box Facebok imagem

Imagem da sql na minha database, caso precise for algo em "FUNÇÃO"

Layout.php script da box facebook

                    <!-- networks theme box -->
                        <?PHP
                        $nF = $SQL->query("SELECT " .$SQL->fieldName('network_link'). " FROM " .$SQL->tableName('z_network_box'). " WHERE " .$SQL->fieldName('network_name'). " = 'facebook'")->fetch();
                        $nT = $SQL->query("SELECT " .$SQL->fieldName('network_link'). " FROM " .$SQL->tableName('z_network_box'). " WHERE " .$SQL->fieldName('network_name'). " = 'twitter'")->fetch();
                        ?>
                        <?PHP if(!empty($nF)){ ?>
                        <div id="NetworksBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/networks/networksbox.png);">
                              <div id="FacebookBlock">
                                <div id="FacebookLikeBox">
                                      <div class="fb-like-box fb_iframe_widget" data-href="https://www.facebook.com/worldtibia/<?PHP echo $nF['network_link']; ?>" data-width="175" data-height="180" data-show-faces="true" data-stream="false" data-border-color="none" data-header="false" fb-xfbml-state="rendered">
                                        <span style="vertical-align: bottom; width: 181px; height: 180px;">
                                        </span>
                                    </div>
                                </div>
                                <div id="FacebookSendBox">
                                      <div class="fb-send fb_iframe_widget" data-href="https://www.facebook.com/worldtibia/<?PHP echo $nF['network_link']; ?>" data-width="50" data-height="20" fb-xfbml-state="rendered">
                                        <span style="vertical-align: bottom; width: 50px; height: 20px;">
                                        </span>
                                    </div>
                                </div>
                                <div id="FacebookLikes">
                                      <div class="fb-like fb_edge_widget_with_comment fb_iframe_widget" data-href="https://www.facebook.com/worldtibia/<?PHP echo $nF['network_link']; ?>" data-send="false" data-width="225" data-show-faces="false" fb-xfbml-state="rendered">
                                        <span style="height: 28px; width: 225px;">
                                        </span>
                                    </div>
                                </div>

 

REP+.

'.$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);
Editado por Rodrigo0lg (veja o histórico de edições)

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Quais codigos voce fala?  Lastnews, video...

Eu coloquei apenas um comando na minha DB e foi o de Videos, se voces acha que falta algum comando sql me mandem ae que eu tento executar no phpadmyn!

 

 

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites
1 hora atrás, Rodrigo0lg disse:

Quais codigos voce fala?  Lastnews, video...

Eu coloquei apenas um comando na minha DB e foi o de Videos, se voces acha que falta algum comando sql me mandem ae que eu tento executar no phpadmyn!

 

 

Creio que este resolve o problema do LatestNews:

Spoiler

DROP TABLE IF EXISTS `announcements`;
CREATE TABLE IF NOT EXISTS `announcements` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `title` varchar(50) NOT NULL,
  `text` varchar(255) NOT NULL,
  `date` varchar(20) NOT NULL,
  `author` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, Aklayos disse:

Creio que este resolve o problema do LatestNews:

  Mostrar conteúdo oculto


DROP TABLE IF EXISTS `announcements`;
CREATE TABLE IF NOT EXISTS `announcements` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `title` varchar(50) NOT NULL,
  `text` varchar(255) NOT NULL,
  `date` varchar(20) NOT NULL,
  `author` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

o erro continua a mesma coisa amigo, talvez o erro seja no script lastnews.php mesmo!

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites
1 minuto atrás, Rodrigo0lg disse:

o erro continua a mesma coisa amigo, talvez o erro seja no script lastnews.php mesmo!

Qual versão se esta usando? e qual Gesior?

por via das duvidas teste esse:

Spoiler

DROP TABLE IF EXISTS announcements;
CREATE TABLE announcements ( 
    id     INT( 10 )       NOT NULL,
    title  VARCHAR( 50 )   NOT NULL,
    text   VARCHAR( 255 )  NOT NULL,
    date   VARCHAR( 20 )   NOT NULL,
    author VARCHAR( 50 )   NOT NULL,
    PRIMARY KEY ( id ) 
);

 

Editado por Aklayos (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Bom o Gesior que estou usando é este...

Link: GesiorACC 2012 8.60 UPDATE 16/03/2016 Tibiaking

 

E o Xampp, ja usei o 1.7.3 como diz no posto do link a cima e ja usei 1.7.4 e o 1.7.5 até agora ambos com o mesmo problema...

 

Editado por Rodrigo0lg (veja o histórico de edições)

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites
  • Solução

@UP

Alguem pode me ajudar por favor? Alguem que testou esse Gesior sabe como resolver...

 

@EDITE

 

O Erro do Latestnews eu arrumei, vou postar aqui pra quem ter o problema futuramente achar, porque peleguei de mais pra achar! KKK :grin:

 

Troque esta parte do Latestnews.php

Spoiler

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)

 

 

Por esta aqui!

Spoiler

foreach($SQL->query('SELECT ' . $SQL->tableName('g') . '.' . $SQL->fieldName('id') . ' AS ' . $SQL->fieldName('id') . ', ' . $SQL->tableName('g') . '.' . $SQL->fieldName('name') . ' AS ' . $SQL->fieldName('name') . ', COUNT(' . $SQL->tableName('g') . '.' . $SQL->fieldName('name') . ') AS ' . $SQL->fieldName('frags') . ' FROM ' . $SQL->tableName('killers') . ' k LEFT JOIN ' . $SQL->tableName('player_killers') . ' pk ON ' . $SQL->tableName('k') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('pk') . '.' . $SQL->fieldName('kill_id') . ' LEFT JOIN ' . $SQL->tableName('players') . ' p ON ' . $SQL->tableName('pk') . '.' . $SQL->fieldName('player_id') . ' = ' . $SQL->tableName('p') . '.' . $SQL->fieldName('id') . ' LEFT JOIN ' . $SQL->tableName('guild_ranks') . ' gr ON ' . $SQL->tableName('p') . '.' . $SQL->fieldName('rank_id') . ' = ' . $SQL->tableName('gr') . '.' . $SQL->fieldName('id') . ' LEFT JOIN ' . $SQL->tableName('guilds') . ' g ON ' . $SQL->tableName('gr') . '.' . $SQL->fieldName('guild_id') . ' = ' . $SQL->tableName('g') . '.' . $SQL->fieldName('id') . ' WHERE ' . $SQL->tableName('g') . '.' . $SQL->fieldName('id') . ' > 0 AND ' . $SQL->tableName('k') . '.' . $SQL->fieldName('unjustified') . ' = 1 AND ' . $SQL->tableName('k') . '.' . $SQL->fieldName('final_hit') . ' = 1 GROUP BY ' . $SQL->fieldName('name') . ' ORDER BY ' . $SQL->fieldName('frags') . ' DESC, ' . $SQL->fieldName('name') . ' ASC LIMIT 4;') as $guild)

 

Agora falta os erros da page Videos, to procurando saber tambem, mais se alguem souber de algo, me ajuda ae! Obrigado.

Editado por Digoshow
achei a solução de 1 erro.. (veja o histórico de edições)

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

@UP

 

Alguem por favor me ajuda com esses erros da pagina de videos?

 

@Edite

Problema resolvido!

Acabei tirando a pagina de video da Gesior, pois pesquisei e acabei descobrindo que a pagina de Videos tem injection! :facepalm:

Então vai ficar sem no momento ate que um dia saia um seguro. HEHE :laugh:

 

@Aklayos, obrigado por tentar ajudar, REP+!

Editado por Digoshow (veja o histórico de edições)

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo