<!-- NEWS READER --><?php$group = 0; // Specify the Group(id) you want to read the news fromglobal $database;$query = "SELECT post_id,title,group_id,link FROM ".TABLE_PREFIX."mod_news_posts WHERE group_id = $group ORDER BY posted_when DESC LIMIT 0, 5;"; // This limits the results to max 5, so if you want it to be 10, make it LIMIT 0, 10. // The first number defines the starting point, and the second the max/end of the results$error = mysql_error();if (!$result = mysql_query($query)) { print "$error"; exit; }while($data = mysql_fetch_object($result)){ $title = $data->title; $id = $data->post_id; $link = $data->link; ?> <p> <a href="<?php echo WB_URL; ?><?php echo $link ?><?php echo PAGE_EXTENSION; ?>"><?php echo $title; ?></a> </p> <?php }?><!-- END NEWS READER -->
Hm... I'm still happy, but I noticed a small problem. The listing in the snippet is chronological, in order of input. When I change the order of the items in the backend, the order on the news page changes too, so that is correct. But the order of the snippet listing isn't affected by the back end change. Can this be changed? I know the snippet listing is a light version of the normal news listing, but I would like it to be just bit heavier, so that it listens to changes in the back end...You can see it on http://www.bereikbaarheid.nl/cms.This is a site I am working on for a client. It is not operational yet, and a number of things are not finished yet. But the news listing is working. It's a Dutch site, but that shouldn't be problem to see what mean.
You can see it on http://www.bereikbaarheid.nl/cms
Quote from: ArgosYou can see it on http://www.bereikbaarheid.nl/cmsDo I see it correctly that you have written a Javascript menu that uses the WebsiteBaker page tree? If so, would you be willing to release it to the general public?
Yeah, too bad really.I've had a look at your javascript code - quite confusing with all the numbers, spacers and what not.To make an automatically maintained menu, it is necessary to have a way of writing the entries without any individual hacks. So say, I give you a menu structure:Top1---T1Sub1---T1Sub2Top2---T2Sub1---T2Sub2can you (manually) make a nice-looking dhtml menu out of that without any further information, hacks, etc. No tweaking allowed!If so, it's no problem to make the transition to a true WB dynamical menu. I've just not looked into dhtml menus at all, otherwise I would've done it already.
$group = 2; // Specify the Group(id) you want to read the news fromglobal $database;$query = "SELECT post_id,title,group_id,link FROM ".TABLE_PREFIX."mod_news_posts WHERE group_id = $group ORDER BY position DESC LIMIT 0, 5;";/*This limits the results to max 5, so if you want it to be 10, make it LIMIT 0, 10. The first number defines the starting point, and the second the max/end of the results */$error = mysql_error();if (!$result = mysql_query($query)) { print "$error"; exit;}while($data = mysql_fetch_object($result)){ $title = $data->title; $id = $data->post_id; $link = $data->link; echo '<p><a href="'.WB_URL.$link.PAGE_EXTENSION.'">'.$title.'</a></p>';}
thanks craig, but some level of understanding of WB is needed with the code snippets... (dont make to easie for them )