• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[SITE]NewsArchive Likes Rl Tibia

Beyond Sky

Weed is Life
Joined
Sep 6, 2010
Messages
120
Reaction score
162
Location
Brazil - CWB
I need instructions for install this News Archive (UnderWar Alternative Tibia Server - Arquivo de Not�cias), in my WebSite.

I have the script of News Archives, but when i add a news it go to Archive Page but no have a link ant tittle of news... look:

Untitled-1-1.png

The News Scripts like Rl Tibia is this:
PHP:
<?php
$news_DB = $SQL->query('SELECT * FROM '.$SQL->tableName('z_news_big').' WHERE hide_news != 1 ORDER BY date DESC');
if(empty($_REQUEST['id']))
{
	$main_content .= '<table border=0 cellspacing=1 cellpadding=4 width=100%>
	<tr bgcolor="'.$config['site']['vdarkborder'].'">
	<TD COLSPAN=3 CLASS=white><B>Archive</B></TD></TR>';
	foreach($news_DB as $news)
	{
		if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$main_content .= '<tr BGCOLOR='.$bgcolor.'><td width=4%><center><img src="'.$layout_name.'/images/news/icon_'.$news['image_id'].'.gif"></center></td><td>'.date("j.n.Y", $news['date']).'</td><td><b><a href="index.php?subtopic=archive&id='.$news['date'].'">'.stripslashes($news['topic']).'</a></b></td></tr>';
	}
	$main_content .= '</table>';
	$showed=true;
}
foreach($news_DB as $news)
	if($_REQUEST['id'] == $news['date'])
	{
		$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.n.Y", $news['date']).' - <b>'.stripslashes($news['topic']).'</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%"><font size=2>'.stripslashes(nl2br($news['text'])).'<br></font><br></td>
		<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
		</tr></table>';
		$main_content .= '<br><a href="index.php?subtopic=archive"><font size="2"><b>Go to Archive</b></font></a>';
		$showed=true;
	}
if(!$showed)
{
	$main_content .= 'This news doeasn\'t exist.<br>';
	$main_content .= '<br /><a href="index.php?subtopic=archive"><font size="2"><b>Go to Archive</b></font></a>';
}
?>

The part of my latestnews.php that add news in the website is this.

PHP:
//adding news
if($action == "newnews") {
if($group_id_of_acc_logged >= $config['site']['access_news']) {
$text = ($_REQUEST['text']);
                $char_id = (int) $_REQUEST['char_id'];
                $post_topic = stripslashes(trim($_REQUEST['topic']));
                $smile = (int) $_REQUEST['smile'];
				$news_icon = (int) $_REQUEST['icon_id'];
if(empty($news_icon)) {
$news_icon = 0;
}
if(empty($post_topic)) {
$an_errors[] .= 'You can\'t add news without topic.';
}
if(empty($text)) {
$an_errors[] .= 'You can\'t add empty news.';
}
if(empty($char_id)) {
$an_errors[] .= 'Select character.';
}
//execute query
if(empty($an_errors)) {
$SQL->query("INSERT INTO `z_forum` (`id` ,`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`, `icon_id`) VALUES ('NULL', '0', '".time()."', '1', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$SQL->quote($text).", ".$SQL->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."', '".$news_icon."')");
                        $thread_id = $SQL->lastInsertId();
                        $SQL->query("UPDATE `z_forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);//show added data

$main_content .= '<form action="?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
{
 
Back
Top