Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 02:41:11 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155361 Posts in 21694 Topics by 7729 Members
Latest Member: piset
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Bugs in Andreas00 at Latest News Section  (Read 595 times)
GeekF

Offline Offline

Posts: 1



« on: June 13, 2008, 09: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:
$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:
$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:
echo '<p><a href="'.WB_URL.'/pages/'.$link.PAGE_EXTENSION.'" class="latestnews">'.$title.'</a></p>';

with the line
Code:
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.
« Last Edit: June 13, 2008, 03:31:22 PM by GeekF » Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7972



WWW
« Reply #1 on: June 13, 2008, 09:19:01 AM »

Hello,

wouldn't it be better to use:

Code:
href="'.WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION.'"

instead of:

Code:
href="'.WB_URL.mysql_query($query).$link.PAGE_EXTENSION.'"

Matthias
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!