Ir para conteúdo
  • Cadastre-se

(Resolvido){Ajuda} Step 3 Gesior


Ir para solução Resolvido por Bruno Minervino,

Posts Recomendados

Olá!

 

Estou tentando instalar o Gesior 0.3.6, mas no Step 3 pede para adicionar algumas colunas, só que eu não sei como instala, pede o seguinte:

 

STEP 3

Add tables and columns to DB
Installer try to add new tables and columns to database.
Add columns to table accounts

Can't add column page_lastday to table accounts, already exist?
Can't add column email_new to table accounts, already exist?
Can't add column email_new_time to table accounts, already exist?
Can't add column created to table accounts, already exist?
Can't add column rlname to table accounts, already exist?
Can't add column location to table accounts, already exist?
Can't add column page_access to table accounts, already exist?
Can't add column email_code to table accounts, already exist?
Can't add column next_email to table accounts, already exist?
Can't add column premium_points to table accounts, already exist?
Can't add column vote to table players, already exist?
Can't add column last posts to table accounts, already exist?
Can't add column flag to table accounts, already exist?
Can't add column vip_time to table accounts, already exist?
Add columns to table guilds

Can't add column description to table guilds, already exist?
Can't add column logo_gfx_name to table guilds, already exist?
Add columns to table players

Can't add column created to table players, already exist?
Can't add column nick_verify to table players, already exist?
Can't add column old_name to table players, already exist?
Can't add column hide_char to table players, already exist?
Can't add column worldtransfer to table players, already exist?
Can't add column comment to table players, already exist?
Can't add column comment to table players, already exist?
Can't add column comment to table players, already exist?
Can't add column comment to table players, already exist?
Can't add column comment to table players, already exist?
Can't add column comment to table players, already exist?
Add new tables to database

Table z_news_tickers not added. Already exist?
Table z_spells not added. Already exist?
Table z_monsters not added. Already exist?
Table z_ots_comunication not added. Already exist?
Table z_shop_offer not added. Already exist?
Table z_shop_history_item not added. Already exist?
Table z_shop_history_pacc not added. Already exist?
Table z_polls not added. Already exist?
Table z_polls_answers not added. Already exist?
Table zaypay_payment not added. Already exist?
Table z_bug_tracker not added. Already exist?
Table z_changelog not added. Already exist?
Table z_forum not added. Already exist?

Tables and columns added to database.
Go to STEP 4 - Add samples

 

Alguém pode me ajudar?

Oi

Link para o post
Compartilhar em outros sites

E quando você tenta ir para a Etapa 4, da algum erro?

Essas msg's dizem que as colunas já existem, sem a necessidade de criar novamente...

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites

E quando você tenta ir para a Etapa 4, da algum erro?

Essas msg's dizem que as colunas já existem, sem a necessidade de criar novamente...

Não, dá pra seguir normal, até que quando vou entrar em "http://127.0.0.1/xampp/"que dá o seguinte error:

 

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'argos.z_news_big' doesn't exist' in C:\xampp\htdocs\xampp\latestnews.php:103 Stack trace: #0 C:\xampp\htdocs\xampp\latestnews.php(103): PDO->query('SELECT image_id...') #1 C:\xampp\htdocs\xampp\index.php(63): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\xampp\latestnews.php on line 103

 

Meu letestnews.php é o seguinte:

 

<?php
//######################## SHOW TICKERS AND NEWS #######################
$time = time();
if($action == "") 
{
	//show tickers if any in database or not blocked (tickers limit = 0)
	$tickers = $SQL->query('SELECT * FROM '.$SQL->tableName('z_news_tickers').' WHERE hide_ticker != 1 ORDER BY date DESC LIMIT '.$config['site']['news_ticks_limit'].';');
	$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("j 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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$tickers_to_add .= $ticker['text'].'</div>
				</div>
			  </div>
			</div>';
			$number_of_tickers++;
		}
	}
	if(!empty($tickers_to_add)) 
	{
		//show table with tickers
		$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);">';
					if($group_id_of_acc_logged >= $config["site"]["access_news"])
					$tickers_to_add .= '<script type="text/javascript">
					var showednewticker_state = "0";
					function showNewTickerForm()
					{
						if(showednewticker_state == "0") 
						{
							document.getElementById("newtickerform").innerHTML = \'<form action="index.php?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
							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>';
	}
	//show "BIG" news here
	if($config['site']['langSystem'])
		$main_content .= '<br>
		';
	if($lang == 'en')
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	elseif($lang == $config['site']['chooseLang'])
	{
		$newsLanguageSystem = 'topic_ot, text_ot';
		$newsTopicInfo = 'topic_ot';
		$newsTextInfo = 'text_ot';
	}
	else
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	$news_DB = $SQL->query('SELECT image_id, date, author, '.$newsLanguageSystem.' FROM z_news_big WHERE hide_news != 1 ORDER BY date DESC LIMIT '.$config['site']['news_big_limit'].';');
	//dla kazdego duzego newsa
	if(!empty($news_DB)) 
	{
		if($group_id_of_acc_logged >= $config['site']['access_news'])
			$main_content .= '<script type="text/javascript">
				var showednewnews_state = "0";
				function showNewNewsForm()
				{
					if(showednewnews_state == "0") 
					{
						document.getElementById("newnewsform").innerHTML = \'<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><img src="images/flags/us.png"> Topic defutal language:</b></td><td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="F1E0C6"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td><td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/us.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_df" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_ot" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="F1E0C6"><b>Your nick:</b></td><td><input type="text" name="news_name" maxlenght="40" style="width: 200px" ></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="showNewNewsForm()" alt="CancelAddNews" /></div></div></td></tr></table>\';
						document.getElementById("chicken").innerHTML = \'\';
						showednewnews_state = "1";
					}
					else 
					{
						document.getElementById("newnewsform").innerHTML = \'\';
						document.getElementById("chicken").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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div>\';
						showednewnews_state = "0";
					}
				}
			</script><div id="newnewsform"></div><div id="chicken"><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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div></div><hr/>';
		foreach($news_DB as $news) 
		{
			$newsTopic = stripslashes($news[''.$newsTopicInfo.'']);
			$newsText = stripslashes($news[''.$newsTextInfo.'']);
			$main_content .= '
			<div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0>
						<tr>
							<td><img src="'.$layout_name.'/images/news/icon_'.$news['image_id'].'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' /></td>
							<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $news['date']).' - <b>'.$newsTopic.'</b></font></td>
						</tr>
					</table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			<td width="100%">'.$newsText.'<br><h6><i>Posted by </i><font color="green">'.stripslashes($news['author']).'</font>';
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$main_content .= '&nbsp;<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$news['date'].'&edit_author='.urlencode(stripslashes($news['author'])).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news['date'].'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a>';
			}
			$main_content .= '</h6></td>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			</tr></table>';
		}
	}
}
//featured article
//creditos PiabetaMan01.
$news_content .= '
    <div id="news" class="Box">
    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
    <img class="Title" src="'.$layout_name.'/images/header/headline-archive.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\'><img src="images/article/Staff.png" width=140 height=100 border=0 alt="" ALIGN=right hspace="5" /></div>
                <div id=\'TeaserText\'>
                    <div style="position: relative; top: -2px; margin-bottom: 2px;" >
                        <b>A Equipe precisa da sua ajuda!</b>
                    </div>

</br>Nos ajude reportando bugs para o link abaixo, para tornarmos o server sempre melhor para voce!
</br> </br><b></b><a href="?subtopic=forum&action=show_board&id=5">Reportar Bugs Forum</a>
                </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>
';
//Fim do featured Article
//##################### ADD NEW TICKER #####################
if($action == "newticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		$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)) 
				$ticker_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("j M Y", $time).' -</span>
						<div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/delete.png" border="0"></a>';
					$main_content .= short_text($ticker_text, 60).'</div>
						<div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/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="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>';
	}
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		header("Location: index.php");
		$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="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
//################## ADD NEW NEWS ##################
if($action == "newnews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		$news_icon = (int) $_POST['icon_id'];
		$news_text_df = stripslashes(trim($_POST['news_text_df']));
		$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
		$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
		$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
		$news_name = stripslashes(trim($_POST['news_name']));
		if(empty($news_icon)) 
			$news_icon = 0;
		if(empty($news_topic_df)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_df)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_topic_ot)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_ot)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_name)) 
			$an_errors[] .= 'You can\'t add news without author.';
		if(empty($an_errors)) 
		{
			$SQL->query('INSERT INTO z_news_big (hide_news, date, author, author_id, image_id, topic_df, text_df, topic_ot, text_ot) VALUES (0, '.$time.', '.$SQL->quote($news_name).', '.$account_logged->getId().', '.$news_icon.', '.$SQL->quote($news_topic_df).', '.$SQL->quote($news_text_df).', '.$SQL->quote($news_topic_ot).', '.$SQL->quote($news_text_ot).')');
			//show added data
			$main_content .= '<center><h2><font color="red">Added to news:</font></h2></center><hr/><div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0><tr><td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' />
						</td><td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td></tr></table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
				<tr>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
					<td width="100%"><img src="images/flags/us.png"> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png"> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
					<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$time.'&edit_author='.urlencode($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$time.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
				</tr>
			</table><br/><hr/>';
			//back button
			$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="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
						<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
						<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
						<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
						<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_name.'" /></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>
						<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'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.';
		//back button
		$main_content .= '<br><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>';
	}
}
//################## EDIT NEWS ##################
if($action == "editnews") 
{
	if(!empty($_REQUEST['edit_date'])) 
	{
		if(!empty($_REQUEST['edit_author'])) 
		{
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$news_date = (int) $_REQUEST['edit_date'];
				$news_old_name = stripslashes(trim($_REQUEST['edit_author']));
				if($_POST['saveedit'] == 1) 
				{
					$news_icon = (int) $_POST['icon_id'];
					$news_text_df = stripslashes(trim($_POST['news_text_df']));
					$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
					$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
					$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
					$news_name = stripslashes(trim($_POST['news_name']));
					if(empty($news_icon)) 
						$news_icon = 0;
					if(empty($news_topic_df)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_df)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_topic_ot)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_ot)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_name))
						$an_errors[] .= 'You can\'t save news without author.';
					if(empty($an_errors)) 
					{
						$SQL->query('UPDATE z_news_big SET hide_news = "0", author = "'.$news_name.'", author_id = '.$account_logged->getId().', image_id = '.$news_icon.', topic_df = "'.$news_topic_df.'", text_df = "'.$news_text_df.'", topic_ot = "'.$news_topic_ot.'", text_ot = "'.$news_text_ot.'" WHERE author = "'.$news_old_name.'" AND date = '.$news_date.';');
						//show added data
						$main_content .= '<center><h2><font color="red">After edit:</font></h2></center><hr/><div class=NewsHeadline>
							<div class=NewsHeadlineBackground style=background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)>
								<table border=0>
									<tr>
										<td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class="NewsHeadlineIcon" alt="" /></td>
										<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td>
									</tr>
								</table>
							</div>
						</div>
						<table style=clear:both border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
							<tr>
								<td width="100%"><img src="images/flags/us.png" alt=""> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png" alt=""> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
								<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.htmlspecialchars($news_date).'&edit_author='.htmlspecialchars($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;
								<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news_date.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
							</tr>
						</table><br/><hr/>';
						//back button
						$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
						//<img src="images/flags/us.png">
						//<img src="images/flags/'.$config['site']['chooseLang'].'.png">
						$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
							<input type="hidden" name="saveedit" value="1"><input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
							<input type="hidden" name="edit_author" value="'.$_REQUEST['edit_author'].'">
								<table border="0">
									<tr>
										<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
										<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
										<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
										<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
										<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_nick.'" /></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>
										<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'index.php?subtopic=latestnews\'" alt="CancelAddNews" /></div></div></td>
									</tr>
								</table>';
					}
				}
				else
				{
					//wyswietlic zaladowany z bazy news do edycji wedlug ID
					$edited = $SQL->query('SELECT * FROM z_news_big WHERE '.$SQL->fieldName('date').' = "'.$news_date.'" AND '.$SQL->fieldName('author').' = '.$SQL->quote($news_old_name).';')->fetch();
					$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
						<input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
						<input type="hidden" name="edit_author" value="'.htmlspecialchars(stripslashes($_REQUEST['edit_author'])).'">
						<input type="hidden" name="saveedit" value="1">
						<table border="0">
							<tr>
								<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
								<td>
									<table border="0" bgcolor="'.$config['site']['lightborder'].'">
										<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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
								<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_df'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
								<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_ot'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.stripslashes($edited['text_df']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.stripslashes($edited['text_ot']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
								<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.htmlspecialchars(stripslashes($edited['author'])).'"></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>
								<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location = \'index.php?subtopic=latestnews\'" alt="CancelEditNews" /></div></div></td>
							</tr>
						</table>';
				}
			}
			else
			{
				$main_content .= 'You don\'t have site-admin rights. You can\'t edit news.';
				//back button
				$main_content .= '<br><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>';
			}
		}
	}
}
//################## DELETE (hide only!) NEWS ##################
if($action == "deletenews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		header("Location: index.php");
		$date = (int) $_REQUEST['id'];
		$SQL->query('UPDATE '.$SQL->tableName('z_news_big').' SET hide_news = "1" WHERE date = '.$date);
		$main_content .= '<center>News with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete news.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
?>

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

Oi

Link para o post
Compartilhar em outros sites
  • Sub-Admin

Não, dá pra seguir normal, até que quando vou entrar em "http://127.0.0.1/xampp/"que dá o seguinte error:

 

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'argos.z_news_big' doesn't exist' in C:\xampp\htdocs\xampp\latestnews.php:103 Stack trace: #0 C:\xampp\htdocs\xampp\latestnews.php(103): PDO->query('SELECT image_id...') #1 C:\xampp\htdocs\xampp\index.php(63): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\xampp\latestnews.php on line 103

 

Meu letestnews.php é o seguinte:

 

<?php
//######################## SHOW TICKERS AND NEWS #######################
$time = time();
if($action == "") 
{
	//show tickers if any in database or not blocked (tickers limit = 0)
	$tickers = $SQL->query('SELECT * FROM '.$SQL->tableName('z_news_tickers').' WHERE hide_ticker != 1 ORDER BY date DESC LIMIT '.$config['site']['news_ticks_limit'].';');
	$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("j 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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$tickers_to_add .= $ticker['text'].'</div>
				</div>
			  </div>
			</div>';
			$number_of_tickers++;
		}
	}
	if(!empty($tickers_to_add)) 
	{
		//show table with tickers
		$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);">';
					if($group_id_of_acc_logged >= $config["site"]["access_news"])
					$tickers_to_add .= '<script type="text/javascript">
					var showednewticker_state = "0";
					function showNewTickerForm()
					{
						if(showednewticker_state == "0") 
						{
							document.getElementById("newtickerform").innerHTML = \'<form action="index.php?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
							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>';
	}
	//show "BIG" news here
	if($config['site']['langSystem'])
		$main_content .= '<br>
		';
	if($lang == 'en')
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	elseif($lang == $config['site']['chooseLang'])
	{
		$newsLanguageSystem = 'topic_ot, text_ot';
		$newsTopicInfo = 'topic_ot';
		$newsTextInfo = 'text_ot';
	}
	else
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	$news_DB = $SQL->query('SELECT image_id, date, author, '.$newsLanguageSystem.' FROM z_news_big WHERE hide_news != 1 ORDER BY date DESC LIMIT '.$config['site']['news_big_limit'].';');
	//dla kazdego duzego newsa
	if(!empty($news_DB)) 
	{
		if($group_id_of_acc_logged >= $config['site']['access_news'])
			$main_content .= '<script type="text/javascript">
				var showednewnews_state = "0";
				function showNewNewsForm()
				{
					if(showednewnews_state == "0") 
					{
						document.getElementById("newnewsform").innerHTML = \'<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><img src="images/flags/us.png"> Topic defutal language:</b></td><td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="F1E0C6"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td><td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/us.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_df" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_ot" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="F1E0C6"><b>Your nick:</b></td><td><input type="text" name="news_name" maxlenght="40" style="width: 200px" ></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="showNewNewsForm()" alt="CancelAddNews" /></div></div></td></tr></table>\';
						document.getElementById("chicken").innerHTML = \'\';
						showednewnews_state = "1";
					}
					else 
					{
						document.getElementById("newnewsform").innerHTML = \'\';
						document.getElementById("chicken").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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div>\';
						showednewnews_state = "0";
					}
				}
			</script><div id="newnewsform"></div><div id="chicken"><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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div></div><hr/>';
		foreach($news_DB as $news) 
		{
			$newsTopic = stripslashes($news[''.$newsTopicInfo.'']);
			$newsText = stripslashes($news[''.$newsTextInfo.'']);
			$main_content .= '
			<div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0>
						<tr>
							<td><img src="'.$layout_name.'/images/news/icon_'.$news['image_id'].'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' /></td>
							<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $news['date']).' - <b>'.$newsTopic.'</b></font></td>
						</tr>
					</table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			<td width="100%">'.$newsText.'<br><h6><i>Posted by </i><font color="green">'.stripslashes($news['author']).'</font>';
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$main_content .= '&nbsp;<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$news['date'].'&edit_author='.urlencode(stripslashes($news['author'])).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news['date'].'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a>';
			}
			$main_content .= '</h6></td>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			</tr></table>';
		}
	}
}
//featured article
//creditos PiabetaMan01.
$news_content .= '
    <div id="news" class="Box">
    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
    <img class="Title" src="'.$layout_name.'/images/header/headline-archive.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\'><img src="images/article/Staff.png" width=140 height=100 border=0 alt="" ALIGN=right hspace="5" /></div>
                <div id=\'TeaserText\'>
                    <div style="position: relative; top: -2px; margin-bottom: 2px;" >
                        <b>A Equipe precisa da sua ajuda!</b>
                    </div>

</br>Nos ajude reportando bugs para o link abaixo, para tornarmos o server sempre melhor para voce!
</br> </br><b></b><a href="?subtopic=forum&action=show_board&id=5">Reportar Bugs Forum</a>
                </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>
';
//Fim do featured Article
//##################### ADD NEW TICKER #####################
if($action == "newticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		$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)) 
				$ticker_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("j M Y", $time).' -</span>
						<div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/delete.png" border="0"></a>';
					$main_content .= short_text($ticker_text, 60).'</div>
						<div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/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="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>';
	}
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		header("Location: index.php");
		$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="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
//################## ADD NEW NEWS ##################
if($action == "newnews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		$news_icon = (int) $_POST['icon_id'];
		$news_text_df = stripslashes(trim($_POST['news_text_df']));
		$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
		$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
		$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
		$news_name = stripslashes(trim($_POST['news_name']));
		if(empty($news_icon)) 
			$news_icon = 0;
		if(empty($news_topic_df)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_df)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_topic_ot)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_ot)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_name)) 
			$an_errors[] .= 'You can\'t add news without author.';
		if(empty($an_errors)) 
		{
			$SQL->query('INSERT INTO z_news_big (hide_news, date, author, author_id, image_id, topic_df, text_df, topic_ot, text_ot) VALUES (0, '.$time.', '.$SQL->quote($news_name).', '.$account_logged->getId().', '.$news_icon.', '.$SQL->quote($news_topic_df).', '.$SQL->quote($news_text_df).', '.$SQL->quote($news_topic_ot).', '.$SQL->quote($news_text_ot).')');
			//show added data
			$main_content .= '<center><h2><font color="red">Added to news:</font></h2></center><hr/><div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0><tr><td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' />
						</td><td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td></tr></table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
				<tr>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
					<td width="100%"><img src="images/flags/us.png"> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png"> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
					<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$time.'&edit_author='.urlencode($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$time.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
				</tr>
			</table><br/><hr/>';
			//back button
			$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="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
						<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
						<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
						<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
						<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_name.'" /></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>
						<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'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.';
		//back button
		$main_content .= '<br><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>';
	}
}
//################## EDIT NEWS ##################
if($action == "editnews") 
{
	if(!empty($_REQUEST['edit_date'])) 
	{
		if(!empty($_REQUEST['edit_author'])) 
		{
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$news_date = (int) $_REQUEST['edit_date'];
				$news_old_name = stripslashes(trim($_REQUEST['edit_author']));
				if($_POST['saveedit'] == 1) 
				{
					$news_icon = (int) $_POST['icon_id'];
					$news_text_df = stripslashes(trim($_POST['news_text_df']));
					$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
					$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
					$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
					$news_name = stripslashes(trim($_POST['news_name']));
					if(empty($news_icon)) 
						$news_icon = 0;
					if(empty($news_topic_df)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_df)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_topic_ot)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_ot)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_name))
						$an_errors[] .= 'You can\'t save news without author.';
					if(empty($an_errors)) 
					{
						$SQL->query('UPDATE z_news_big SET hide_news = "0", author = "'.$news_name.'", author_id = '.$account_logged->getId().', image_id = '.$news_icon.', topic_df = "'.$news_topic_df.'", text_df = "'.$news_text_df.'", topic_ot = "'.$news_topic_ot.'", text_ot = "'.$news_text_ot.'" WHERE author = "'.$news_old_name.'" AND date = '.$news_date.';');
						//show added data
						$main_content .= '<center><h2><font color="red">After edit:</font></h2></center><hr/><div class=NewsHeadline>
							<div class=NewsHeadlineBackground style=background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)>
								<table border=0>
									<tr>
										<td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class="NewsHeadlineIcon" alt="" /></td>
										<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td>
									</tr>
								</table>
							</div>
						</div>
						<table style=clear:both border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
							<tr>
								<td width="100%"><img src="images/flags/us.png" alt=""> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png" alt=""> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
								<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.htmlspecialchars($news_date).'&edit_author='.htmlspecialchars($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;
								<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news_date.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
							</tr>
						</table><br/><hr/>';
						//back button
						$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
						//<img src="images/flags/us.png">
						//<img src="images/flags/'.$config['site']['chooseLang'].'.png">
						$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
							<input type="hidden" name="saveedit" value="1"><input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
							<input type="hidden" name="edit_author" value="'.$_REQUEST['edit_author'].'">
								<table border="0">
									<tr>
										<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
										<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
										<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
										<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
										<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_nick.'" /></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>
										<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'index.php?subtopic=latestnews\'" alt="CancelAddNews" /></div></div></td>
									</tr>
								</table>';
					}
				}
				else
				{
					//wyswietlic zaladowany z bazy news do edycji wedlug ID
					$edited = $SQL->query('SELECT * FROM z_news_big WHERE '.$SQL->fieldName('date').' = "'.$news_date.'" AND '.$SQL->fieldName('author').' = '.$SQL->quote($news_old_name).';')->fetch();
					$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
						<input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
						<input type="hidden" name="edit_author" value="'.htmlspecialchars(stripslashes($_REQUEST['edit_author'])).'">
						<input type="hidden" name="saveedit" value="1">
						<table border="0">
							<tr>
								<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
								<td>
									<table border="0" bgcolor="'.$config['site']['lightborder'].'">
										<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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
								<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_df'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
								<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_ot'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.stripslashes($edited['text_df']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.stripslashes($edited['text_ot']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
								<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.htmlspecialchars(stripslashes($edited['author'])).'"></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>
								<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location = \'index.php?subtopic=latestnews\'" alt="CancelEditNews" /></div></div></td>
							</tr>
						</table>';
				}
			}
			else
			{
				$main_content .= 'You don\'t have site-admin rights. You can\'t edit news.';
				//back button
				$main_content .= '<br><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>';
			}
		}
	}
}
//################## DELETE (hide only!) NEWS ##################
if($action == "deletenews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		header("Location: index.php");
		$date = (int) $_REQUEST['id'];
		$SQL->query('UPDATE '.$SQL->tableName('z_news_big').' SET hide_news = "1" WHERE date = '.$date);
		$main_content .= '<center>News with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete news.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
?>

 

add lá e vai mandando os erros pra mim

add isso no data base

 

CREATE TABLE IF NOT EXISTS `z_news_big` (

`hide_news` tinyint(1) NOT NULL DEFAULT '0',

`date` int(11) NOT NULL DEFAULT '0',

`author` varchar(255) NOT NULL,

`author_id` int(11) NOT NULL,

`image_id` int(3) NOT NULL DEFAULT '0',

`topic` varchar(255) NOT NULL,

`text` text NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

add lá e vai mandando os erros pra mim

add isso no data base

 

CREATE TABLE IF NOT EXISTS `z_news_big` (

`hide_news` tinyint(1) NOT NULL DEFAULT '0',

`date` int(11) NOT NULL DEFAULT '0',

`author` varchar(255) NOT NULL,

`author_id` int(11) NOT NULL,

`image_id` int(3) NOT NULL DEFAULT '0',

`topic` varchar(255) NOT NULL,

`text` text NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

Executei o comando mas o error continua. Olhe:

Seu comando SQL foi executado com sucesso ( Consulta levou 0.0003 segundos )
CREATE TABLE IF NOT EXISTS  `news` (
 `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
 `title` VARCHAR( 150 ) DEFAULT  '',
 `body` TEXT,
 `time` INT( 11 ) DEFAULT  '0',
PRIMARY KEY (  `id` )
) ENGINE = INNODB DEFAULT CHARSET = latin1 AUTO_INCREMENT =1;

Oi

Link para o post
Compartilhar em outros sites

@NathanAmaro,

Execute essa query no seu MySQL:

CREATE TABLE `z_news_big` (
	`hide_news` INT(11) NOT NULL DEFAULT 0,
	`date`  INT(11) NOT NULL,
	`author` VARCHAR(255) NOT NULL,
	`author_id` INT(11) NOT NULL,
	`image_id` INT(11) NOT NULL DEFAULT 0,
	`topic` VARCHAR(255) NOT NULL,
	`text` TEXT NOT NULL
);

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites
  • Sub-Admin

Executei o comando mas o error continua. Olhe:

Seu comando SQL foi executado com sucesso ( Consulta levou 0.0003 segundos )
CREATE TABLE IF NOT EXISTS  `news` (
 `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
 `title` VARCHAR( 150 ) DEFAULT  '',
 `body` TEXT,
 `time` INT( 11 ) DEFAULT  '0',
PRIMARY KEY (  `id` )
) ENGINE = INNODB DEFAULT CHARSET = latin1 AUTO_INCREMENT =1;

eu modifiquei olha lá

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

 

@NathanAmaro,

Execute essa query no seu MySQL:

CREATE TABLE "z_news_big" (
	"hide_news" INTEGER NOT NULL DEFAULT 0,
	"date" INTEGER NOT NULL,
	"author" VARCHAR(255) NOT NULL,
	"author_id" INTEGER NOT NULL,
	"image_id" INTEGER NOT NULL DEFAULT 0,
	"topic" VARCHAR(255) NOT NULL,
	"text" TEXT NOT NULL
);

Error na hora de executar a query:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"z_news_big" ( "hide_news" INTEGER NOT NULL DEFAULT 0, "date" INTEGER NOT NU' at line 1

-------------EDIT-------

Arrisquei a sorte e fui no letestnews.php e na linha 103 em que pede o error coloquei dois "//" tirando ela do script, deu certo. Quero sabe se isso influenciaria em algo.

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

Oi

Link para o post
Compartilhar em outros sites

NathanAmaro, em 25 Mar 2015 - 2:12 PM, disse:

Error na hora de executar a query:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"z_news_big" ( "hide_news" INTEGER NOT NULL DEFAULT 0, "date" INTEGER NOT NU' at line 1
O error continua

Foi desatenção minha

Corrigi no meu post.

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites
  • Sub-Admin

Error na hora de executar a query:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"z_news_big" ( "hide_news" INTEGER NOT NULL DEFAULT 0, "date" INTEGER NOT NU' at line 1

O error continua

mano olha lá em cima que editei

 

11026191_823361271078696_593429763255648

 

 

CREATE TABLE IF NOT EXISTS `z_news_big` (

`hide_news` tinyint(1) NOT NULL DEFAULT '0',

`date` int(11) NOT NULL DEFAULT '0',

`author` varchar(255) NOT NULL,

`author_id` int(11) NOT NULL,

`image_id` int(3) NOT NULL DEFAULT '0',

`topic` varchar(255) NOT NULL,

`text` text NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

Foi desatenção minha

Corrigi no meu post.

Bruno, continuou o mesmo error. Tirei os "//" do latestnews.php que eu tinha colocado.

 

 

mano olha lá em cima que editei

 

11026191_823361271078696_593429763255648

 

 

CREATE TABLE IF NOT EXISTS `z_news_big` (

`hide_news` tinyint(1) NOT NULL DEFAULT '0',

`date` int(11) NOT NULL DEFAULT '0',

`author` varchar(255) NOT NULL,

`author_id` int(11) NOT NULL,

`image_id` int(3) NOT NULL DEFAULT '0',

`topic` varchar(255) NOT NULL,

`text` text NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

O error persiste, mas no phpmyadmin diz: 

Seu comando SQL foi executado com sucesso ( Consulta levou 0.0507 segundos )

O que deu certo ainda foi colocar "//" antes da linha 103 do meu arquivo latestnews.php

Oi

Link para o post
Compartilhar em outros sites

NathanAmaro, em 25 Mar 2015 - 2:23 PM, disse:

Bruno, continuou o mesmo error. Tirei os "//" do latestnews.php que eu tinha colocado.

O error persiste, mas no phpmyadmin diz:

Seu comando SQL foi executado com sucesso ( Consulta levou 0.0507 segundos )
O que deu certo ainda foi colocar "//" antes da linha 103 do meu arquivo latestnews.php

Isso que você fez, não foi resolver o problema, você comentou a linha impedindo o funcionamento dela...

Tira o comentário e mostra qual o erro que está dando.

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites

NathanAmaro, em 25 Mar 2015 - 2:25 PM, disse:

Nenhum, rodou normal o latest news na página do site.

Isso que você fez, não foi resolver o problema, você comentou a linha impedindo o funcionamento dela...

Tira o comentário e mostra qual o erro que está dando.

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites

Isso que você fez, não foi resolver o problema, você comentou a linha impedindo o funcionamento dela...

Tira o comentário e mostra qual o erro que está dando.

 

O mesmo error, nada mudou, deu error na hora de executar sua query

Oi

Link para o post
Compartilhar em outros sites

NathanAmaro, em 25 Mar 2015 - 2:31 PM, disse:

O mesmo error, nada mudou, deu error na hora de executar sua query

Você poderia tirar uma print?

Porque assim, não tem como ser o mesmo erro se você já criou a tabela...

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites

Você poderia tirar uma print?

Porque assim, não tem como ser o mesmo erro se você já criou a tabela...

 

Agora o error mudou:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'topic_ot' in 'field list'' in C:\xampp\htdocs\xampp\latestnews.php:103 Stack trace: #0 C:\xampp\htdocs\xampp\latestnews.php(103): PDO->query('SELECT image_id...') #1 C:\xampp\htdocs\xampp\index.php(63): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\xampp\latestnews.php on line 103

Oi

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

Agora o error mudou:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'topic_ot' in 'field list'' in C:\xampp\htdocs\xampp\latestnews.php:103 Stack trace: #0 C:\xampp\htdocs\xampp\latestnews.php(103): PDO->query('SELECT image_id...') #1 C:\xampp\htdocs\xampp\index.php(63): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\xampp\latestnews.php on line 103

Altera seu latestnews.php para este:

<?php
//######################## SHOW TICKERS AND NEWS #######################
$time = time();
if($action == "") 
{
	//show tickers if any in database or not blocked (tickers limit = 0)
	$tickers = $SQL->query('SELECT * FROM '.$SQL->tableName('z_news_tickers').' WHERE hide_ticker != 1 ORDER BY date DESC LIMIT '.$config['site']['news_ticks_limit'].';');
	$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("j 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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$tickers_to_add .= $ticker['text'].'</div>
				</div>
			  </div>
			</div>';
			$number_of_tickers++;
		}
	}
	if(!empty($tickers_to_add)) 
	{
		//show table with tickers
		$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);">';
					if($group_id_of_acc_logged >= $config["site"]["access_news"])
					$tickers_to_add .= '<script type="text/javascript">
					var showednewticker_state = "0";
					function showNewTickerForm()
					{
						if(showednewticker_state == "0") 
						{
							document.getElementById("newtickerform").innerHTML = \'<form action="index.php?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
							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>';
	}
	//show "BIG" news here
	if($config['site']['langSystem'])
		$main_content .= '<br>
		';
	if($lang == 'en')
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	elseif($lang == $config['site']['chooseLang'])
	{
		$newsLanguageSystem = 'topic_ot, text_ot';
		$newsTopicInfo = 'topic_ot';
		$newsTextInfo = 'text_ot';
	}
	else
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	$news_DB = $SQL->query('SELECT image_id, date, author, topic FROM z_news_big WHERE hide_news != 1 ORDER BY date DESC LIMIT '.$config['site']['news_big_limit'].';');
	//dla kazdego duzego newsa
	if(!empty($news_DB)) 
	{
		if($group_id_of_acc_logged >= $config['site']['access_news'])
			$main_content .= '<script type="text/javascript">
				var showednewnews_state = "0";
				function showNewNewsForm()
				{
					if(showednewnews_state == "0") 
					{
						document.getElementById("newnewsform").innerHTML = \'<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><img src="images/flags/us.png"> Topic defutal language:</b></td><td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="F1E0C6"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td><td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/us.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_df" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_ot" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="F1E0C6"><b>Your nick:</b></td><td><input type="text" name="news_name" maxlenght="40" style="width: 200px" ></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="showNewNewsForm()" alt="CancelAddNews" /></div></div></td></tr></table>\';
						document.getElementById("chicken").innerHTML = \'\';
						showednewnews_state = "1";
					}
					else 
					{
						document.getElementById("newnewsform").innerHTML = \'\';
						document.getElementById("chicken").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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div>\';
						showednewnews_state = "0";
					}
				}
			</script><div id="newnewsform"></div><div id="chicken"><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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div></div><hr/>';
		foreach($news_DB as $news) 
		{
			$newsTopic = stripslashes($news[''.$newsTopicInfo.'']);
			$newsText = stripslashes($news[''.$newsTextInfo.'']);
			$main_content .= '
			<div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0>
						<tr>
							<td><img src="'.$layout_name.'/images/news/icon_'.$news['image_id'].'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' /></td>
							<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $news['date']).' - <b>'.$newsTopic.'</b></font></td>
						</tr>
					</table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			<td width="100%">'.$newsText.'<br><h6><i>Posted by </i><font color="green">'.stripslashes($news['author']).'</font>';
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$main_content .= '&nbsp;<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$news['date'].'&edit_author='.urlencode(stripslashes($news['author'])).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news['date'].'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a>';
			}
			$main_content .= '</h6></td>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			</tr></table>';
		}
	}
}
//featured article
//creditos PiabetaMan01.
$news_content .= '
    <div id="news" class="Box">
    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
    <img class="Title" src="'.$layout_name.'/images/header/headline-archive.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\'><img src="images/article/Staff.png" width=140 height=100 border=0 alt="" ALIGN=right hspace="5" /></div>
                <div id=\'TeaserText\'>
                    <div style="position: relative; top: -2px; margin-bottom: 2px;" >
                        <b>A Equipe precisa da sua ajuda!</b>
                    </div>

</br>Nos ajude reportando bugs para o link abaixo, para tornarmos o server sempre melhor para voce!
</br> </br><b></b><a href="?subtopic=forum&action=show_board&id=5">Reportar Bugs Forum</a>
                </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>
';
//Fim do featured Article
//##################### ADD NEW TICKER #####################
if($action == "newticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		$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)) 
				$ticker_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("j M Y", $time).' -</span>
						<div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/delete.png" border="0"></a>';
					$main_content .= short_text($ticker_text, 60).'</div>
						<div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/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="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>';
	}
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		header("Location: index.php");
		$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="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
//################## ADD NEW NEWS ##################
if($action == "newnews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		$news_icon = (int) $_POST['icon_id'];
		$news_text_df = stripslashes(trim($_POST['news_text_df']));
		$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
		$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
		$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
		$news_name = stripslashes(trim($_POST['news_name']));
		if(empty($news_icon)) 
			$news_icon = 0;
		if(empty($news_topic_df)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_df)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_topic_ot)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_ot)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_name)) 
			$an_errors[] .= 'You can\'t add news without author.';
		if(empty($an_errors)) 
		{
			$SQL->query('INSERT INTO z_news_big (hide_news, date, author, author_id, image_id, topic_df, text_df, topic_ot, text_ot) VALUES (0, '.$time.', '.$SQL->quote($news_name).', '.$account_logged->getId().', '.$news_icon.', '.$SQL->quote($news_topic_df).', '.$SQL->quote($news_text_df).', '.$SQL->quote($news_topic_ot).', '.$SQL->quote($news_text_ot).')');
			//show added data
			$main_content .= '<center><h2><font color="red">Added to news:</font></h2></center><hr/><div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0><tr><td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' />
						</td><td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td></tr></table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
				<tr>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
					<td width="100%"><img src="images/flags/us.png"> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png"> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
					<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$time.'&edit_author='.urlencode($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$time.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
				</tr>
			</table><br/><hr/>';
			//back button
			$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="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
						<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
						<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
						<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
						<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_name.'" /></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>
						<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'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.';
		//back button
		$main_content .= '<br><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>';
	}
}
//################## EDIT NEWS ##################
if($action == "editnews") 
{
	if(!empty($_REQUEST['edit_date'])) 
	{
		if(!empty($_REQUEST['edit_author'])) 
		{
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$news_date = (int) $_REQUEST['edit_date'];
				$news_old_name = stripslashes(trim($_REQUEST['edit_author']));
				if($_POST['saveedit'] == 1) 
				{
					$news_icon = (int) $_POST['icon_id'];
					$news_text_df = stripslashes(trim($_POST['news_text_df']));
					$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
					$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
					$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
					$news_name = stripslashes(trim($_POST['news_name']));
					if(empty($news_icon)) 
						$news_icon = 0;
					if(empty($news_topic_df)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_df)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_topic_ot)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_ot)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_name))
						$an_errors[] .= 'You can\'t save news without author.';
					if(empty($an_errors)) 
					{
						$SQL->query('UPDATE z_news_big SET hide_news = "0", author = "'.$news_name.'", author_id = '.$account_logged->getId().', image_id = '.$news_icon.', topic_df = "'.$news_topic_df.'", text_df = "'.$news_text_df.'", topic_ot = "'.$news_topic_ot.'", text_ot = "'.$news_text_ot.'" WHERE author = "'.$news_old_name.'" AND date = '.$news_date.';');
						//show added data
						$main_content .= '<center><h2><font color="red">After edit:</font></h2></center><hr/><div class=NewsHeadline>
							<div class=NewsHeadlineBackground style=background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)>
								<table border=0>
									<tr>
										<td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class="NewsHeadlineIcon" alt="" /></td>
										<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td>
									</tr>
								</table>
							</div>
						</div>
						<table style=clear:both border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
							<tr>
								<td width="100%"><img src="images/flags/us.png" alt=""> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png" alt=""> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
								<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.htmlspecialchars($news_date).'&edit_author='.htmlspecialchars($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;
								<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news_date.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
							</tr>
						</table><br/><hr/>';
						//back button
						$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
						//<img src="images/flags/us.png">
						//<img src="images/flags/'.$config['site']['chooseLang'].'.png">
						$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
							<input type="hidden" name="saveedit" value="1"><input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
							<input type="hidden" name="edit_author" value="'.$_REQUEST['edit_author'].'">
								<table border="0">
									<tr>
										<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
										<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
										<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
										<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
										<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_nick.'" /></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>
										<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'index.php?subtopic=latestnews\'" alt="CancelAddNews" /></div></div></td>
									</tr>
								</table>';
					}
				}
				else
				{
					//wyswietlic zaladowany z bazy news do edycji wedlug ID
					$edited = $SQL->query('SELECT * FROM z_news_big WHERE '.$SQL->fieldName('date').' = "'.$news_date.'" AND '.$SQL->fieldName('author').' = '.$SQL->quote($news_old_name).';')->fetch();
					$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
						<input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
						<input type="hidden" name="edit_author" value="'.htmlspecialchars(stripslashes($_REQUEST['edit_author'])).'">
						<input type="hidden" name="saveedit" value="1">
						<table border="0">
							<tr>
								<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
								<td>
									<table border="0" bgcolor="'.$config['site']['lightborder'].'">
										<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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
								<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_df'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
								<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_ot'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.stripslashes($edited['text_df']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.stripslashes($edited['text_ot']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
								<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.htmlspecialchars(stripslashes($edited['author'])).'"></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>
								<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location = \'index.php?subtopic=latestnews\'" alt="CancelEditNews" /></div></div></td>
							</tr>
						</table>';
				}
			}
			else
			{
				$main_content .= 'You don\'t have site-admin rights. You can\'t edit news.';
				//back button
				$main_content .= '<br><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>';
			}
		}
	}
}
//################## DELETE (hide only!) NEWS ##################
if($action == "deletenews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		header("Location: index.php");
		$date = (int) $_REQUEST['id'];
		$SQL->query('UPDATE '.$SQL->tableName('z_news_big').' SET hide_news = "1" WHERE date = '.$date);
		$main_content .= '<center>News with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete news.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
?> 

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites

Altera seu latestnews.php para este:

<?php
//######################## SHOW TICKERS AND NEWS #######################
$time = time();
if($action == "") 
{
	//show tickers if any in database or not blocked (tickers limit = 0)
	$tickers = $SQL->query('SELECT * FROM '.$SQL->tableName('z_news_tickers').' WHERE hide_ticker != 1 ORDER BY date DESC LIMIT '.$config['site']['news_ticks_limit'].';');
	$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("j 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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$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_news"]) 
				$tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$tickers_to_add .= $ticker['text'].'</div>
				</div>
			  </div>
			</div>';
			$number_of_tickers++;
		}
	}
	if(!empty($tickers_to_add)) 
	{
		//show table with tickers
		$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);">';
					if($group_id_of_acc_logged >= $config["site"]["access_news"])
					$tickers_to_add .= '<script type="text/javascript">
					var showednewticker_state = "0";
					function showNewTickerForm()
					{
						if(showednewticker_state == "0") 
						{
							document.getElementById("newtickerform").innerHTML = \'<form action="index.php?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
							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>';
	}
	//show "BIG" news here
	if($config['site']['langSystem'])
		$main_content .= '<br>
		';
	if($lang == 'en')
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	elseif($lang == $config['site']['chooseLang'])
	{
		$newsLanguageSystem = 'topic_ot, text_ot';
		$newsTopicInfo = 'topic_ot';
		$newsTextInfo = 'text_ot';
	}
	else
	{
		$newsLanguageSystem = 'topic_df, text_df';
		$newsTopicInfo = 'topic_df';
		$newsTextInfo = 'text_df';
	}
	$news_DB = $SQL->query('SELECT image_id, date, author, topic FROM z_news_big WHERE hide_news != 1 ORDER BY date DESC LIMIT '.$config['site']['news_big_limit'].';');
	//dla kazdego duzego newsa
	if(!empty($news_DB)) 
	{
		if($group_id_of_acc_logged >= $config['site']['access_news'])
			$main_content .= '<script type="text/javascript">
				var showednewnews_state = "0";
				function showNewNewsForm()
				{
					if(showednewnews_state == "0") 
					{
						document.getElementById("newnewsform").innerHTML = \'<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><img src="images/flags/us.png"> Topic defutal language:</b></td><td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="F1E0C6"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td><td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" ></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/us.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_df" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="D4C0A1"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td><td bgcolor="F1E0C6"><textarea name="news_text_ot" rows="6" cols="40"></textarea></td></tr><tr><td align="center" bgcolor="F1E0C6"><b>Your nick:</b></td><td><input type="text" name="news_name" maxlenght="40" style="width: 200px" ></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="showNewNewsForm()" alt="CancelAddNews" /></div></div></td></tr></table>\';
						document.getElementById("chicken").innerHTML = \'\';
						showednewnews_state = "1";
					}
					else 
					{
						document.getElementById("newnewsform").innerHTML = \'\';
						document.getElementById("chicken").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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div>\';
						showednewnews_state = "0";
					}
				}
			</script><div id="newnewsform"></div><div id="chicken"><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="AddNews" src="'.$layout_name.'/images/buttons/addnews.gif" onClick="showNewNewsForm()" alt="AddNews" /></div></div></div><hr/>';
		foreach($news_DB as $news) 
		{
			$newsTopic = stripslashes($news[''.$newsTopicInfo.'']);
			$newsText = stripslashes($news[''.$newsTextInfo.'']);
			$main_content .= '
			<div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0>
						<tr>
							<td><img src="'.$layout_name.'/images/news/icon_'.$news['image_id'].'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' /></td>
							<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $news['date']).' - <b>'.$newsTopic.'</b></font></td>
						</tr>
					</table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'><tr>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			<td width="100%">'.$newsText.'<br><h6><i>Posted by </i><font color="green">'.stripslashes($news['author']).'</font>';
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$main_content .= '&nbsp;<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$news['date'].'&edit_author='.urlencode(stripslashes($news['author'])).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news['date'].'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a>';
			}
			$main_content .= '</h6></td>
			<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
			</tr></table>';
		}
	}
}
//featured article
//creditos PiabetaMan01.
$news_content .= '
    <div id="news" class="Box">
    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
    <img class="Title" src="'.$layout_name.'/images/header/headline-archive.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\'><img src="images/article/Staff.png" width=140 height=100 border=0 alt="" ALIGN=right hspace="5" /></div>
                <div id=\'TeaserText\'>
                    <div style="position: relative; top: -2px; margin-bottom: 2px;" >
                        <b>A Equipe precisa da sua ajuda!</b>
                    </div>

</br>Nos ajude reportando bugs para o link abaixo, para tornarmos o server sempre melhor para voce!
</br> </br><b></b><a href="?subtopic=forum&action=show_board&id=5">Reportar Bugs Forum</a>
                </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>
';
//Fim do featured Article
//##################### ADD NEW TICKER #####################
if($action == "newticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		$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)) 
				$ticker_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("j M Y", $time).' -</span>
						<div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/delete.png" border="0"></a>';
					$main_content .= short_text($ticker_text, 60).'</div>
						<div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
					$main_content .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="http://i63.photobucket.com/albums/h122/Mister_Dude/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="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>';
	}
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") 
{
	if($group_id_of_acc_logged >= $config["site"]["access_news"]) 
	{
		header("Location: index.php");
		$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="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
//################## ADD NEW NEWS ##################
if($action == "newnews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		$news_icon = (int) $_POST['icon_id'];
		$news_text_df = stripslashes(trim($_POST['news_text_df']));
		$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
		$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
		$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
		$news_name = stripslashes(trim($_POST['news_name']));
		if(empty($news_icon)) 
			$news_icon = 0;
		if(empty($news_topic_df)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_df)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_topic_ot)) 
			$an_errors[] .= 'You can\'t add news without topic.';
		if(empty($news_text_ot)) 
			$an_errors[] .= 'You can\'t add empty news.';
		if(empty($news_name)) 
			$an_errors[] .= 'You can\'t add news without author.';
		if(empty($an_errors)) 
		{
			$SQL->query('INSERT INTO z_news_big (hide_news, date, author, author_id, image_id, topic_df, text_df, topic_ot, text_ot) VALUES (0, '.$time.', '.$SQL->quote($news_name).', '.$account_logged->getId().', '.$news_icon.', '.$SQL->quote($news_topic_df).', '.$SQL->quote($news_text_df).', '.$SQL->quote($news_topic_ot).', '.$SQL->quote($news_text_ot).')');
			//show added data
			$main_content .= '<center><h2><font color="red">Added to news:</font></h2></center><hr/><div class=\'NewsHeadline\'>
				<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)\'>
					<table border=0><tr><td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class=\'NewsHeadlineIcon\'  alt=\'\' />
						</td><td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td></tr></table>
				</div>
			</div>
			<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
				<tr>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
					<td width="100%"><img src="images/flags/us.png"> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png"> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
					<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.$time.'&edit_author='.urlencode($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;<a href="index.php?subtopic=latestnews&action=deletenews&id='.$time.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
					<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
				</tr>
			</table><br/><hr/>';
			//back button
			$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="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
						<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
						<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
						<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
						<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
					</tr>
					<tr>
						<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
						<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_name.'" /></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>
						<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'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.';
		//back button
		$main_content .= '<br><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>';
	}
}
//################## EDIT NEWS ##################
if($action == "editnews") 
{
	if(!empty($_REQUEST['edit_date'])) 
	{
		if(!empty($_REQUEST['edit_author'])) 
		{
			if($group_id_of_acc_logged >= $config['site']['access_news']) 
			{
				$news_date = (int) $_REQUEST['edit_date'];
				$news_old_name = stripslashes(trim($_REQUEST['edit_author']));
				if($_POST['saveedit'] == 1) 
				{
					$news_icon = (int) $_POST['icon_id'];
					$news_text_df = stripslashes(trim($_POST['news_text_df']));
					$news_topic_df = stripslashes(trim($_POST['news_topic_df']));
					$news_text_ot = stripslashes(trim($_POST['news_text_ot']));
					$news_topic_ot = stripslashes(trim($_POST['news_topic_ot']));
					$news_name = stripslashes(trim($_POST['news_name']));
					if(empty($news_icon)) 
						$news_icon = 0;
					if(empty($news_topic_df)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_df)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_topic_ot)) 
						$an_errors[] .= 'You can\'t save news without topic.';
					if(empty($news_text_ot)) 
						$an_errors[] .= 'You can\'t save empty news.';
					if(empty($news_name))
						$an_errors[] .= 'You can\'t save news without author.';
					if(empty($an_errors)) 
					{
						$SQL->query('UPDATE z_news_big SET hide_news = "0", author = "'.$news_name.'", author_id = '.$account_logged->getId().', image_id = '.$news_icon.', topic_df = "'.$news_topic_df.'", text_df = "'.$news_text_df.'", topic_ot = "'.$news_topic_ot.'", text_ot = "'.$news_text_ot.'" WHERE author = "'.$news_old_name.'" AND date = '.$news_date.';');
						//show added data
						$main_content .= '<center><h2><font color="red">After edit:</font></h2></center><hr/><div class=NewsHeadline>
							<div class=NewsHeadlineBackground style=background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)>
								<table border=0>
									<tr>
										<td><img src="'.$layout_name.'/images/news/icon_'.$news_icon.'.gif" class="NewsHeadlineIcon" alt="" /></td>
										<td><font color="'.$layout_ini['news_title_color'].'">'.date("j M Y", $time).' - <b>'.$news_topic_df.' or '.$news_topic_ot.'</b></font></td>
									</tr>
								</table>
							</div>
						</div>
						<table style=clear:both border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
							<tr>
								<td width="100%"><img src="images/flags/us.png" alt=""> '.$news_text_df.'<br><br><img src="images/flags/'.$config['site']['chooseLang'].'.png" alt=""> '.$news_text_ot.'<br><br><h6><i>Posted by </i><font color="green">'.$news_name.'</font>&nbsp;
								<a href="index.php?subtopic=latestnews&action=editnews&edit_date='.htmlspecialchars($news_date).'&edit_author='.htmlspecialchars($news_name).'"><img src="'.$layout_name.'/images/news/edit_news.png" border="0"></a>&nbsp;
								<a href="index.php?subtopic=latestnews&action=deletenews&id='.$news_date.'"><img src="'.$layout_name.'/images/news/delete_news.png" border="0"></a></h6></td>
							</tr>
						</table><br/><hr/>';
						//back button
						$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
						//<img src="images/flags/us.png">
						//<img src="images/flags/'.$config['site']['chooseLang'].'.png">
						$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
							<input type="hidden" name="saveedit" value="1"><input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
							<input type="hidden" name="edit_author" value="'.$_REQUEST['edit_author'].'">
								<table border="0">
									<tr>
										<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
										<td><table border="0" bgcolor="'.$config['site']['lightborder'].'"><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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
										<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.$news_topic_df.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
										<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.$news_topic_ot.'" /></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.$news_text_df.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b>News text:</b></td>
										<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.$news_text_ot.'</textarea></td>
									</tr>
									<tr>
										<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
										<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.$news_nick.'" /></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>
										<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location =\'index.php?subtopic=latestnews\'" alt="CancelAddNews" /></div></div></td>
									</tr>
								</table>';
					}
				}
				else
				{
					//wyswietlic zaladowany z bazy news do edycji wedlug ID
					$edited = $SQL->query('SELECT * FROM z_news_big WHERE '.$SQL->fieldName('date').' = "'.$news_date.'" AND '.$SQL->fieldName('author').' = '.$SQL->quote($news_old_name).';')->fetch();
					$main_content .= '<form action="index.php?subtopic=latestnews&action=editnews" method="post" >
						<input type="hidden" name="edit_date" value="'.$_REQUEST['edit_date'].'">
						<input type="hidden" name="edit_author" value="'.htmlspecialchars(stripslashes($_REQUEST['edit_author'])).'">
						<input type="hidden" name="saveedit" value="1">
						<table border="0">
							<tr>
								<td bgcolor="'.$config['site']['darkborder'].'" align="center"><b>Select icon:</b></td>
								<td>
									<table border="0" bgcolor="'.$config['site']['lightborder'].'">
										<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="'.$config['site']['lightborder'].'"><b><img src="images/flags/us.png"> Topic defutal language:</b></td>
								<td><input type="text" name="news_topic_df" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_df'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> Topic onther language:</b></td>
								<td><input type="text" name="news_topic_ot" maxlenght="50" style="width: 300px" value="'.htmlspecialchars(stripslashes($edited['topic_ot'])).'" /></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/us.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_df" rows="6" cols="60">'.stripslashes($edited['text_df']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['darkborder'].'"><b><img src="images/flags/'.$config['site']['chooseLang'].'.png"> News text:</b></td>
								<td bgcolor="'.$config['site']['lightborder'].'"><textarea name="news_text_ot" rows="6" cols="60">'.stripslashes($edited['text_ot']).'</textarea></td>
							</tr>
							<tr>
								<td align="center" bgcolor="'.$config['site']['lightborder'].'"><b>Your nick:</b></td>
								<td><input type="text" name="news_name" maxlenght="40" style="width: 200px" value="'.htmlspecialchars(stripslashes($edited['author'])).'"></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>
								<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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="window.location = \'index.php?subtopic=latestnews\'" alt="CancelEditNews" /></div></div></td>
							</tr>
						</table>';
				}
			}
			else
			{
				$main_content .= 'You don\'t have site-admin rights. You can\'t edit news.';
				//back button
				$main_content .= '<br><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>';
			}
		}
	}
}
//################## DELETE (hide only!) NEWS ##################
if($action == "deletenews") 
{
	if($group_id_of_acc_logged >= $config['site']['access_news']) 
	{
		header("Location: index.php");
		$date = (int) $_REQUEST['id'];
		$SQL->query('UPDATE '.$SQL->tableName('z_news_big').' SET hide_news = "1" WHERE date = '.$date);
		$main_content .= '<center>News with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete news.<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
?> 

 

Certinho :) Obrigado!

Oi

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