WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Bugs in Andreas00 at Latest News Section

(1/1)

fakhu420:
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;";
--- End code ---

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;";
--- End code ---

2. Replace line 43

--- Code: ---echo '<p><a href="'.WB_URL.'/pages/'.$link.PAGE_EXTENSION.'" class="latestnews">'.$title.'</a></p>';
--- End code ---

with the line

--- Code: ---echo '<p><a href="'.WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION.'" class="latestnews">'.$title.'</a></p>';
--- End code ---

I have also created an updated package of the above template.


[gelöscht durch Administrator]

ruebenwurzel:
Hello,

wouldn't it be better to use:


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

instead of:


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

Matthias

Navigation

[0] Message Index

Go to full version