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

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>
';
 
Help me with this please! its buged..

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("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");">
<table border="0" cellspacing="3" cellpadding="4" width="100%">
            <tr>
                <td style="width: 25%; text-align: center;">
            <a rel="nofollow" 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("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>
';
 
PHP:
//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/header/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");">
				<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)
					$news_content .= '
						<td style="width: 25%; text-align: center;">
							<a rel="nofollow" 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>';

$news_content .= '
					</tr>
				</table>
			</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>';
 
Back
Top