Hokku
Member
Edit:
Fixed it, will post the solution on sunday cuz im out.
Im trying to display a featured article on my website but i cant figure how to code and link it to the db, im using gesior and tfs 1.1, tried all the codes on the web and nothings semm to work on my server, its like the php is written differently.
what i wrote but nothing:
I looked at this to write:
full code:
z_featured_article in db:
If someone can tip me how can i link to the db would apreciate
Fixed it, will post the solution on sunday cuz im out.
Im trying to display a featured article on my website but i cant figure how to code and link it to the db, im using gesior and tfs 1.1, tried all the codes on the web and nothings semm to work on my server, its like the php is written differently.
what i wrote but nothing:
PHP:
$featured_article = $SQL->query("SELECT `z_featured_article`.`read_more` AS `read_more`, `z_featured_article`.`text` AS `text`, `z_featured_article`.`title` AS `title`, `z_featured_article`.`id` AS `id`, `z_featured_article`.`date` AS `date` FROM `z_featured_article` ORDER BY `date` DESC LIMIT 1;")->fetchAll();
I looked at this to write:
PHP:
$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 6;")->fetchAll();
full code:
PHP:
//FEATURED ARTICLE
$featured_article = $SQL->query("SELECT `z_featured_article`.`read_more` AS `read_more`, `z_featured_article`.`text` AS `text`, `z_featured_article`.`title` AS `title`, `z_featured_article`.`id` AS `id`, `z_featured_article`.`date` AS `date` FROM `z_featured_article` ORDER BY `date` DESC LIMIT 1;")->fetchAll();
if(isset($featured_article[0]))
{
foreach($featured_article as $featured)
{
$news_content .= '
<div id="FeaturedArticle" class="Box">
<div class="Corner-tl" style="background-image:url('.$layout_name.'/images/content/corner-tl.gif);"></div>
<div class="Corner-tr" style="background-image:url('.$layout_name.'/images/content/corner-tr.gif);"></div>
<div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
<div class="BorderTitleText" style="background-image:url('.$layout_name.'/images/content/title-background-green.gif);"></div>
<img id="ContentBoxHeadline" class="Title" src="'.$layout_name.'/images/header/headline-featuredarticle.gif" alt="Contentbox headline" />
<div class="Border_2">
<div class="Border_3">
<div class="BoxContent" style="background-image:url('.$layout_name.'/images/content/scroll.gif);">
<div id="TeaserThumbnail">';
if(!empty($featured['read_more'])){
$news_content .= '
<a href="'.$featured['read_more'].'">';
}
$news_content .= '
<img src="'.$layout_name.'/images/news/announcement.jpg" width="150" height="100" border=0 alt="" />';
if(!empty($featured['read_more'])){
$news_content .= '
</a>';
}
$news_content .= '
</div>';
if(!empty($featured['read_more'])){
$news_content .= '
<a id="Link" href="'.$featured['read_more'].'">» read more</a>';
}
$news_content .= '
<div id="TeaserText">
<div style="position: relative; top: -2px; margin-bottom: 2px;" >
<b>'.$featured['title'].'</b>
</div>
'.$featured['text'].'
</div>
</div>
</div>
</div>
<div class="Border_1" style="background-image:url('.$layout_name.'/images/content/border-1.gif);"></div>
<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
<div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
</div>
';
}
}
//FEATURED ARTICLE END
z_featured_article in db:
If someone can tip me how can i link to the db would apreciate
Last edited: