WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: fakhu420 on June 13, 2008, 10:11:52 AM

Title: Bugs in Andreas00 at Latest News Section
Post by: fakhu420 on June 13, 2008, 10:11:52 AM
Two bugs are present in the template Andreas00

1. In the latest news column it also shows the news which are not active.
    On clicking the link to a non-active news it displays a dreadful error.
    (See line 32 in andreas00/index.php )
2. It takes it obvious that you have your pages directory set to WB_URL/pages.
    This makes incorrect display of the links to latest news if the pages directory has been changed.
    (See line 43 in andreas00/index.php )

The solution to the above problems are:

1. At line 32 replace the line
Code: [Select]
$query = "SELECT post_id,title,content_short,group_id,link FROM ".TABLE_PREFIX."mod_news_posts ORDER BY position DESC LIMIT 0, 5;";
with
Code: [Select]
$query = "SELECT post_id,title,content_short,group_id,link FROM ".TABLE_PREFIX."mod_news_posts WHERE active=1 ORDER BY position DESC LIMIT 0, 5;";
2. Replace line 43
Code: [Select]
echo '<p><a href="'.WB_URL.'/pages/'.$link.PAGE_EXTENSION.'" class="latestnews">'.$title.'</a></p>';
with the line
Code: [Select]
echo '<p><a href="'.WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION.'" class="latestnews">'.$title.'</a></p>';
I have also created an updated package of the above template.


[gelöscht durch Administrator]
Title: Re: Bugs in Andreas00 in
Post by: ruebenwurzel on June 13, 2008, 10:19:01 AM
Hello,

wouldn't it be better to use:

Code: [Select]
href="'.WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION.'"
instead of:

Code: [Select]
href="'.WB_URL.mysql_query($query).$link.PAGE_EXTENSION.'"
Matthias