Bugs in Andreas00 at Latest News Section

ruebenwurzel

Hello,

wouldn't it be better to use:

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

instead of:

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

Matthias

fakhu420

#1
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
$query = "SELECT post_id,title,content_short,group_id,link FROM ".TABLE_PREFIX."mod_news_posts ORDER BY position DESC LIMIT 0, 5;";
with
$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
echo '<p><a href="'.WB_URL.'/pages/'.$link.PAGE_EXTENSION.'" class="latestnews">'.$title.'</a></p>';
with the line
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]