• 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!

Featured Article on website

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
I want to put an Featured Article box in my website (Gesior), and I found this on basics.css:

PHP:
/* Featured Article */

.Content #FeaturedArticle .BoxContent {
  position:relative;
  height: 100px;
  padding: 5px;
  padding-left: 10px;
  min-height: 100px;
  height: auto !important;
  height: 110px;
  line-height: 10.5pt;
}

.Content #FeaturedArticle #TeaserThumbnail {
  position: relative;
  top: 0px;
  right: 0px;
  height: 100px;
  width: 150px;
  margin-left: 10px;
  background-color: black;
  z-index: 90;
  float: right;
}

#ContentHelper #FeaturedArticle:first-child .BoxContent {
  padding: 10px;
}

.Content #FeaturedArticle #TeaserText {
  height: 100px;
  overflow: hidden;
  z-index: 0;
}

.Content #FeaturedArticle #Link {
  position: absolute;
  top: 0px;
  right: 0px;
  margin: 89 165 0 0;
  z-index: 99;
}

.Content #FeaturedArticle .NewsHeadlineBackground {
  position: relative;
  height: 28px;
  margin-bottom: 5px;
  background-repeat: repeat-x;
  border-left: 1px solid #000000;
  border-right: 1px solid #000000;
}

.Content #FeaturedArticle .NewsHeadlineIcon {
  position: absolute;
  top: -1px;
  left: 0px;
  margin-left: 5px;
  margin-right: 5px;
  float:left;
}

.Content #FeaturedArticle .NewsHeadlineDate {
  font-size: 7pt;
  position: absolute;
  top: 9px;
  left: 50px;
  width: 85px;
  color: white;
}

.Content #FeaturedArticle .NewsHeadlineText {
  position: relative;
  top: 8px;
  left: 135px;
  font-size: 10pt;
  font-weight: bold;
  color: white;
}

Any ideas how to add to the site?

PS: Found this in a 2008's topic, the creator wanted to know how to add it as well:

PHP:
//featured article
$layout_name = $GLOBALS['layout_name'];
$news .= '  <div id="featuredarticle" class="Box">
    <div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
    <div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
    <div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
    <img class="Title" src="'.$layout_name.'/images/strings/headline-featuredarticle.gif" alt="Contentbox headline" />
    <div class="Border_2">
      <div class="Border_3">
        <div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
<div id=\'TeaserThumbnail\'><img src="'.$layout_name.'/images/news/features.jpg" width=150 height=100 border=0 alt="" /></div><div id=\'TeaserText\'><div style="position: relative; top: -2px; margin-bottom: 2px;" >
<b>Tutaj wpisz tytul</b></div>
tutaj wpisz tresc newsa<br>
zdjecie laduje sie w <i>tibiacom/images/news/features.jpg</i><br>
skad sie laduje mozesz zmienic linijke ponad komentarzem
</div>        </div>
      </div>
    </div>

Topic: http://otland.net/f16/featured-article-15162/#post155321
 
Steal the html code from cip's site.
HTML:
  <div id="featuredarticle" class="Box">
    <div class="Corner-tl" style="background-image:url(http://static.tibia.com/images/global/content/corner-tl.gif);"></div>
    <div class="Corner-tr" style="background-image:url(http://static.tibia.com/images/global/content/corner-tr.gif);"></div>
    <div class="Border_1" style="background-image:url(http://static.tibia.com/images/global/content/border-1.gif);"></div>
    <div class="BorderTitleText" style="background-image:url(http://static.tibia.com/images/global/content/title-background-green.gif);"></div>
    <img id="ContentBoxHeadline" class="Title" src="http://static.tibia.com/images/global/strings/headline-featuredarticle.gif" alt="Contentbox headline" />

    <div class="Border_2">
      <div class="Border_3">
        <div class="BoxContent" style="background-image:url(http://static.tibia.com/images/global/content/scroll.gif);">
<div id='TeaserThumbnail'><a href='http://www.tibia.com/news/?subtopic=latestnews&amp;id=1603'><img src="http://static.tibia.com/images/news/featuredthumb_1603.jpg" width=150 height=100 border=0 alt='' /></a></div><a id='Link' style="position: absolute; margin-bottom: 10px; top: 2px;" href='http://www.tibia.com/news/?subtopic=latestnews&amp;id=1603'>&raquo; read more</a><div id='TeaserText'><div style="position: relative; top: -2px; margin-bottom: 2px;" ><b>Tibia's Statement Report System - Better Than Before?</b></div>Within the last year, the rule enforcement in Tibia has changed considerably. Step by step, a new reporting system for rule violations has been introduced and the Tibia Rules have been reformed. So do we yield better results than before? Read on to find out how we answer this question.</div>        </div>
      </div>
    </div>
    <div class="Border_1" style="background-image:url(http://static.tibia.com/images/global/content/border-1.gif);"></div>

    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url(http://static.tibia.com/images/global/content/corner-bl.gif);"></div></div>
    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url(http://static.tibia.com/images/global/content/corner-br.gif);"></div></div>
  </div>
About that code, you would have to add it in latestnews.php
 
PHP:
<?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 `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 4;');
$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_admin_panel']) {
$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
}
$tickers_to_add .= short_text($ticker['text'], 60).'</div>
      <div id="TickerEntry-'.$number_of_tickers.'-FullText" class="NewsTickerFullText">';
//if admin show button to delete (hide) ticker
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
}
$tickers_to_add .= $ticker['text'].'</div>
    </div>
  </div>
</div>';
$number_of_tickers++;
}
}

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_admin_panel'])
$news_content .= '<script type="text/javascript">
var showednewticker_state = "0";
function showNewTickerForm()
{
if(showednewticker_state == "0") {
document.getElementById("newtickerform").innerHTML = \'<form action="?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="images/news/icon_0.gif" width="20"></td><td><img src="images/news/icon_1.gif" width="20"></td><td><img src="images/news/icon_2.gif" width="20"></td><td><img src="images/news/icon_3.gif" width="20"></td><td><img src="images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
document.getElementById("jajo").innerHTML = \'\';
showednewticker_state = "1";
}
else {
document.getElementById("newtickerform").innerHTML = \'\';
document.getElementById("jajo").innerHTML = \'<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div>\';
showednewticker_state = "0";
}
}
</script><div id="newtickerform"></div><div id="jajo"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></div><hr/>';
//add tickers list
$news_content .= $tickers_to_add;
//koniec
$news_content .= '</div>
      </div>
    </div>
    <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  </div>';
}
}
//##################### ADD NEW TICKER #####################
if($action == "newticker") {
if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
$ticker_text = stripslashes(trim($_POST['new_ticker']));
$ticker_icon = (int) $_POST['icon_id'];
if(empty($ticker_text)) {
$main_content .= 'You can\'t add empty ticker.';
}
else
{
if(empty($ticker_icon)) {
$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="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
$main_content .= short_text($ticker_text, 60).'</div>
      <div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
$main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
$main_content .= $ticker_text.'</div>
    </div>
  </div>
</div></div><hr/>';
}
}
else
{
$main_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
}
$main_content .= '<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form>';
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") {
if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
header("Location: ");
$date = (int) $_REQUEST['id'];
$SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
$main_content .= '<center>News tickets with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
else
{
$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
}
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){$main_content .=  '<a href="?subtopic=forum&action=new_topic&section_id=1">Add new news</a>';}
$zapytanie = $SQL->query("SELECT `z_forum`.`post_topic`, `z_forum`.`author_guid`, `z_forum`.`post_date`, `z_forum`.`post_text`, `z_forum`.`id`, `z_forum`.`replies`, `players`.`name` FROM `z_forum`, `players` WHERE `section` = '1' AND `z_forum`.`id` = `first_post` AND `players`.`id` = `z_forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 3;")->fetchAll();
foreach ($zapytanie as $row)
{
         $BB = array(
		'/\[b\](.*?)\[\/b\]/is' => '<strong>$1</strong>',
		'/\[quote\](.*?)\[\/quote\]/is' => '<table cellpadding="0" style="background-color: #c4c4c4; width: 480px; border-style: dotted; border-color: #007900; border-width: 2px"><tr><td>$1</td></tr></table>',
		'/\[u\](.*?)\[\/u\]/is' => '<u>$1</u>',
		'/\[i\](.*?)\[\/i\]/is' => '<i>$1</i>',
		'/\[url](.*?)\[\/url\]/is' => '<a href=$1>$1</a>',
		'/\[img\](.*?)\[\/img\]/is' => '<img src=$1 alt=$1 />',
		'/\[player\](.*?)\[\/player\]/is' => '<a href='.$server['ip'].'?subtopic=characters&amp;name=$1>$1</a>',
		'/\[code\](.*?)\[\/code\]/is' => '<div dir="ltr" style="margin: 0px;padding: 2px;border: 1px inset;width: 500px;height: 290px;text-align: left;overflow: auto"><code style="white-space:nowrap">$1</code></div>'
		);
		$message = preg_replace(array_keys($BB), array_values($BB), nl2br($row['post_text']));
        $main_content .= '<div class=\'NewsHeadline\'>
		<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif);height: 28px;border-left: 1px solid rgb(0, 0, 0);border-right: 1px solid rgb(0, 0, 0)";\'>
		<table border=0 cellpadding="4"><tr><td><img src="'.$layout_name.'/images/news/icon_1.gif" class=\'NewsHeadlineIcon\' alt=\'\' />
		</td><td><font size="1"; font color="'.$layout_ini['news_title_color'].'">'.date('d.m.y H:i:s', $row['post_date']).'</font><font size="2"; font color="'.$layout_ini['news_title_color'].'"> - <b>'.$row['post_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>';
		if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
		{
			$main_content .='<td width="100%">'.$message.'<br><h6><i>Postado por </i><font color="green">'.$row['name'].'</font></h6><p align="right"><a href="?subtopic=forum&action=remove_post&id='.$row['id'].'"><font color="red">[Delete this news]</font></a>  <a href="?subtopic=forum&action=edit_post&id='.$row['id'].'"><font color="green">[Edit this news]</font></a>      <a href="?subtopic=forum&action=show_thread&id='.$row['id'].'">Comments: '.$row['replies'].'</a></p>';
		}
		else		
		{
			$main_content .='<td width="100%">'.$message.'<br><h6><i>Postado por </i><font color="green">'.$row['name'].'</font></h6><p align="right"><a href="?subtopic=forum&action=show_thread&id='.$row['id'].'">Comentarios: '.$row['replies'].'</a></p>';		
		}
		$main_content .= '</td>
		<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
		</tr></table>';
}

?>
 
Code:
<?PHP
//######################## SHOW TICKERS AND NEWS #######################
if($action == "") {
	//show tickers if any in database or not blocked (tickers limit = 0)
	$tickers = $SQL->query('SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 4;');
	if(is_object($tickers)) {
		$i = 0;
		foreach($tickers as $ticker) {
			if(is_int($i / 2))
				$color = "Odd";
			else
				$color = "Even";
			$tickers_to_add .= '<div id="TickerEntry-'.$i.'" class="Row" onclick=\'TickerAction("TickerEntry-'.$i.'")\'>
			<div class="'.$color.'">
				<div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
				<div id="TickerEntry-'.$i.'-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-'.$i.'-ShortText" class="NewsTickerShortText">';
			//if admin show button to delete (hide) ticker
			if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
			$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			}
			$tickers_to_add .= short_text($ticker['text'], 60).'</div>
				<div id="TickerEntry-'.$i.'-FullText" class="NewsTickerFullText">';
			//if admin show button to delete (hide) ticker
			if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
			$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			}
			$tickers_to_add .= $ticker['text'].'</div>
				</div>
			</div>
			</div>';
			$i++;
		}
	}

	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_admin_panel'])
		$news_content .= '<script type="text/javascript">
		var showednewticker_state = "0";
		function showNewTickerForm()
		{
		if(showednewticker_state == "0") {
		document.getElementById("newtickerform").innerHTML = \'<form action="?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="images/news/icon_0.gif" width="20"></td><td><img src="images/news/icon_1.gif" width="20"></td><td><img src="images/news/icon_2.gif" width="20"></td><td><img src="images/news/icon_3.gif" width="20"></td><td><img src="images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></form><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
		document.getElementById("jajo").innerHTML = \'\';
		showednewticker_state = "1";
		}
		else {
		document.getElementById("newtickerform").innerHTML = \'\';
		document.getElementById("jajo").innerHTML = \'<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div>\';
		showednewticker_state = "0";
		}
		}
		</script><div id="newtickerform"></div><div id="jajo"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></div><hr/>';
		//add tickers list
		$news_content .= $tickers_to_add;
		//koniec
		$news_content .= '</div>
			</div>
			</div>
			<div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
			<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
			<div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
		</div>';
	}
}
//##################### ADD NEW TICKER #####################
if($action == "newticker") {
	if($group_id_of_acc_logged == 3) {
		$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;
			$time = time();
			$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="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$main_content .= short_text($ticker_text, 60).'</div>
				<div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
			$main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
			$main_content .= $ticker_text.'</div>
				</div>
			</div>
			</div></div><hr/>';
		}
	}
	else
		$main_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
	$main_content .= '<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form>';
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") {
	if($group_id_of_acc_logged == 3) {
		header("Location: ");
		$date = (int) $_REQUEST['id'];
		$SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
		$main_content .= '<center>News tickets with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	}
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
//featured article
$news_content .= '
	<div id="featuredarticle" class="Box">
		<div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
		<div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
		<div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
		<div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
		<img class="Title" src="'.$layout_name.'/images/strings/headline-featuredarticle.gif" alt="Contentbox headline" />
		<div class="Border_2">
			<div class="Border_3">
				<div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
					<div id=\'TeaserThumbnail\'><img src="'.$layout_name.'/images/news/features.jpg" width=150 height=100 border=0 alt="" /></div>
					<div id=\'TeaserText\'>
						<div style="position: relative; top: -2px; margin-bottom: 2px;" >
							<b>Tutaj wpisz tytul</b>
						</div>
	tutaj wpisz tresc newsa<br/>
	zdjecie laduje sie w <i>tibiacom/images/news/features.jpg</i><br/>
	skad sie laduje mozesz zmienic linijke ponad komentarzem
					</div>
				</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>
';
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) $main_content .=  '<a href="?subtopic=forum&action=new_topic&section_id=1">Add new news</a>';
foreach ($SQL->query("SELECT `z_forum`.`post_topic`, `z_forum`.`author_guid`, `z_forum`.`post_date`, `z_forum`.`post_text`, `z_forum`.`id`, `z_forum`.`replies`, `players`.`name` FROM `z_forum`, `players` WHERE `section` = '1' AND `z_forum`.`id` = `first_post` AND `players`.`id` = `z_forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 3;")->fetchAll() as $row) {
	$BB = array(
	'/\[b\](.*?)\[\/b\]/is' => '<strong>$1</strong>',
	'/\[quote\](.*?)\[\/quote\]/is' => '<table cellpadding="0" style="background-color: #c4c4c4; width: 480px; border-style: dotted; border-color: #007900; border-width: 2px"><tr><td>$1</td></tr></table>',
	'/\[u\](.*?)\[\/u\]/is' => '<u>$1</u>',
	'/\[i\](.*?)\[\/i\]/is' => '<i>$1</i>',
	'/\[url](.*?)\[\/url\]/is' => '<a href=$1>$1</a>',
	'/\[img\](.*?)\[\/img\]/is' => '<img src=$1 alt=$1 />',
	'/\[player\](.*?)\[\/player\]/is' => '<a href='.$server['ip'].'?subtopic=characters&amp;name=$1>$1</a>',
	'/\[code\](.*?)\[\/code\]/is' => '<div dir="ltr" style="margin: 0px;padding: 2px;border: 1px inset;width: 500px;height: 290px;text-align: left;overflow: auto"><code style="white-space:nowrap">$1</code></div>'
	);
	$message = preg_replace(array_keys($BB), array_values($BB), nl2br($row['post_text']));
	$main_content .= '<div class=\'NewsHeadline\'>
	<div class=\'NewsHeadlineBackground\' style=\'background-image:url('.$layout_name.'/images/news/newsheadline_background.gif);height: 28px;border-left: 1px solid rgb(0, 0, 0);border-right: 1px solid rgb(0, 0, 0)";\'>
	<table border=0 cellpadding="4"><tr><td><img src="'.$layout_name.'/images/news/icon_1.gif" class=\'NewsHeadlineIcon\' alt=\'\' />
	</td><td><font size="1"; font color="'.$layout_ini['news_title_color'].'">'.date('d.m.y H:i:s', $row['post_date']).'</font><font size="2"; font color="'.$layout_ini['news_title_color'].'"> - <b>'.$row['post_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>';
	if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
		$main_content .='<td width="100%">'.$message.'<br><h6><i>Postado por </i><font color="green">'.$row['name'].'</font></h6><p align="right"><a href="?subtopic=forum&action=remove_post&id='.$row['id'].'"><font color="red">[Delete this news]</font></a>  <a href="?subtopic=forum&action=edit_post&id='.$row['id'].'"><font color="green">[Edit this news]</font></a>      <a href="?subtopic=forum&action=show_thread&id='.$row['id'].'">Comments: '.$row['replies'].'</a></p>';
	else
		$main_content .='<td width="100%">'.$message.'<br><h6><i>Postado por </i><font color="green">'.$row['name'].'</font></h6><p align="right"><a href="?subtopic=forum&action=show_thread&id='.$row['id'].'">Comentarios: '.$row['replies'].'</a></p>';
	$main_content .= '</td>
	<td><img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' /></td>
	</tr></table>';
}

?>
 
Last edited:
Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\latestnews.php on line 118

I've made some modifications, changed this:

PHP:
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") {
	if($group_id_of_acc_logged == 3)
		header("Location: ");
		$date = (int) $_REQUEST['id'];
		$SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
		$main_content .= '<center>News tickets with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
	else
		$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}

To this:

PHP:
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") {
if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
header("Location: ");
$date = (int) $_REQUEST['id'];
$SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
$main_content .= '<center>News tickets with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
else
{
$main_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
}

Now the page opens, but the Featured Article doesn't show up, it's like we've never edited the file

Ok, fixed, CANT TANK YOU ENOUGH CYK!!!!!!!

Here's the final version:

PHP:
//featured article
$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-featuredarticle.gif" alt="Contentbox headline" />
	<div class="Border_2">
		<div class="Border_3">
			<div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
				<div id=\'TeaserThumbnail\'><img src="'.$layout_name.'/images/news/features.jpg" width=150 height=100 border=0 alt="" /></div>
				<div id=\'TeaserText\'>
					<div style="position: relative; top: -2px; margin-bottom: 2px;" >
						<b>Is it working?</b>
					</div>
tutaj wpisz tresc newsa<br/>
zdjecie laduje sie w <i>tibiacom/images/news/features.jpg</i><br/>
				</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>
';

news_content instead of news
Added </div> to the bottom and bottom_1, cornerwrapper-b to close the box
 
Last edited:
Do not working
PHP:
//featured article
$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/strings/headline-featuredarticle.gif" alt="Contentbox headline" />
		<div class="Border_2">
			<div class="Border_3">
				<div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
					<div id=\'TeaserThumbnail\'><img src="'.$layout_name.'/images/news/features.jpg" width=150 height=100 border=0 alt="" /></div>
					<div id=\'TeaserText\'>
						<div style="position: relative; top: -2px; margin-bottom: 2px;" >
							<b>Tutaj wpisz tytul</b>
						</div>
	tutaj wpisz tresc newsa<br/>
	zdjecie laduje sie w <i>tibiacom/images/news/features.jpg</i><br/>
	skad sie laduje mozesz zmienic linijke ponad komentarzem
					</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>
';
 
Last edited:
maybe you don't have echo $news_content in your layout.php? it's only for tibia.com layout
Code:
            <div id="ContentHelper"><script type="text/javascript" src="<?PHP echo $layout_name; ?>/newsticker.js"></script>
		[B][COLOR="red"]<?PHP echo $news_content; ?>[/COLOR][/B]
    <div id="<?PHP echo $subtopic; ?>" class="Box">
 
maybe you don't have echo $news_content in your layout.php? it's only for tibia.com layout
Code:
            <div id="ContentHelper"><script type="text/javascript" src="<?PHP echo $layout_name; ?>/newsticker.js"></script>
		[B][COLOR="red"]<?PHP echo $news_content; ?>[/COLOR][/B]
    <div id="<?PHP echo $subtopic; ?>" class="Box">

Yes, i got it.


bump
 
This server have it: http://hades.tibiamax.com/.

Cyko, it don't works
PHP:
//featured article
$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/strings/headline-featuredarticle.gif" alt="Contentbox headline" />
        <div class="Border_2">
            <div class="Border_3">
                <div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
                    <div id=\'TeaserThumbnail\'><img src="'.$layout_name.'/images/news/features.jpg" width=150 height=100 border=0 alt="" /></div>
                    <div id=\'TeaserText\'>
                        <div style="position: relative; top: -2px; margin-bottom: 2px;" >
                            <b>Tutaj wpisz tytul</b>
                        </div>
    tutaj wpisz tresc newsa<br/>
    zdjecie laduje sie w <i>tibiacom/images/news/features.jpg</i><br/>
    skad sie laduje mozesz zmienic linijke ponad komentarzem
                    </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>
';
bump
 
Last edited:
try
Lua:
<div id="featuredarticle" class="Box">
    <div class="Corner-tl" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-tl.gif&quot;);"></div>
    <div class="Corner-tr" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-tr.gif&quot;);"></div>
    <div class="Border_1" style="background-image: url(&quot;http://static.tibia.com/images/global/content/border-1.gif&quot;);"></div>
    <div class="BorderTitleText" style="background-image: url(&quot;http://static.tibia.com/images/global/content/title-background-green.gif&quot;);"></div>
    <img id="ContentBoxHeadline" class="Title" src="http://static.tibia.com/images/global/strings/headline-featuredarticle.gif" alt="Contentbox headline">
    <div class="Border_2">
      <div class="Border_3">
        <div class="BoxContent" style="background-image: url(&quot;http://static.tibia.com/images/global/content/scroll.gif&quot;);">
<div id="TeaserThumbnail"><a href="http://www.tibia.com/news/?subtopic=latestnews&amp;id=1761"><img src="http://static.tibia.com/images/news/featuredthumb_1761.jpg" alt="" width="150" border="0" height="100"></a></div><a id="Link" style="position: absolute; margin-bottom: 10px; top: 2px;" href="http://www.tibia.com/news/?subtopic=latestnews&amp;id=1761">» read more</a><div id="TeaserText"><div style="position: relative; top: -2px; margin-bottom: 2px;"><b>Tibians, what is your vocation?</b></div>The featured article has been updated with the concept of the Sorcerer.</div>        </div>

      </div>
    </div>
    <div class="Border_1" style="background-image: url(&quot;http://static.tibia.com/images/global/content/border-1.gif&quot;);"></div>
    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-bl.gif&quot;);"></div></div>
    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-br.gif&quot;);"></div></div>
  </div>

and change url for your images in your ot.
 
how to add most powerfull guilds in that box? please help me!

Here is the most powerfull guild code:
PHP:
$main_content .= '<div class="NewsHeadline">
	<div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
		<table border="0">
			<tr>
				<td style="text-align: center; font-weight: bold;">
					<font color="white">Most powerfull guilds</font>
				</td>
			</tr>
		</table>
	</div>
</div>
<table border="0" cellspacing="3" cellpadding="4" width="100%">
	<tr>';
 
foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
	`g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags`
FROM `killers` k
	LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
	LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
	LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
	LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
	GROUP BY `name`
	ORDER BY `frags` DESC, `name` ASC
	LIMIT 0, 4;') as $guild)
	$main_content .= '		<td style="width: 25%; text-align: center;">
			<a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guilds/' . ((!empty($guild['logo']) && file_exists('guilds/' . $guild['logo'])) ? $guild['logo'] : 'default_logo.gif') . '" width="64" height="64" border="0"/><br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
		</td>';
 
$main_content .= '	</tr>
</table>';
 
make a new box div and put that code inside the boxcontent div

That is what i've been trying to do.. but it getting wrong :S

1zdogvk.jpg


This is the code i use:

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

//featured article
$news_content .= '
    <div id="featuredarticle" class="Box">
    <div class="Corner-tl" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-tl.gif&quot;);"></div>
    <div class="Corner-tr" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-tr.gif&quot;);"></div>
    <div class="Border_1" style="background-image: url(&quot;http://static.tibia.com/images/global/content/border-1.gif&quot;);"></div>
    <div class="BorderTitleText" style="background-image: url(&quot;http://static.tibia.com/images/global/content/title-background-green.gif&quot;);"></div>
    <img id="ContentBoxHeadline" class="Title" src="http://static.tibia.com/images/global/strings/headline-featuredarticle.gif" alt="Contentbox headline">
    <div class="Border_2">
      <div class="Border_3">
        <div class="BoxContent" style="background-image: url(&quot;http://static.tibia.com/images/global/content/scroll.gif&quot;);">
<table border="0" cellspacing="3" cellpadding="4" width="100%">
            <tr>
                <td style="width: 25%; text-align: center;">
            <a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guilds/' . ((!empty($guild['logo']) && file_exists('guilds/' . $guild['logo'])) ? $guild['logo'] : 'default_logo.gif') . '" width="64" height="64" border="0"/><br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
        </td>
            </tr>
        </table>
		</div>
      </div>
    </div>
    <div class="Border_1" style="background-image: url(&quot;http://static.tibia.com/images/global/content/border-1.gif&quot;);"></div>
    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-bl.gif&quot;);"></div></div>
    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url(&quot;http://static.tibia.com/images/global/content/corner-br.gif&quot;);"></div></div>
  </div>
';
 
Back
Top