WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<!-- NEWS READER --><?php$group = 0; // Specify the Group&#40;id&#41; 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&#40;&#41;;if &#40;!$result = mysql_query&#40;$query&#41;&#41; &#123; print "$error"; exit; &#125;while&#40;$data = mysql_fetch_object&#40;$result&#41;&#41;&#123; $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 &#125;?><!-- END NEWS READER -->
how I can make in order to visualize the list of the existing groups?
Ruud can you please remove your zip files (v0.13 and v0.14) from this thread as v0.21 includes all your changes?
<?php$url = $_SERVER['REQUEST_URI'];if (function_exists('display_news_items')) { if (strrpos($url,"/en/")) { display_news_items(1,3,-1,1,"Latest news","read more","No news available",false); } else { display_news_items(2,3,-1,1,"Laatste nieuws","verder lezen","geen nieuws beschikbaar",false); }} ?>
$url = $_SERVER['REQUEST_URI'];
$output .= "<p class=\"dateformat\">" . strftime("%d %B %Y",$data['published_when'])."</p>\n";
I missed one line you will need to have too:Before testing the $url variable, it needs to be defined with something Code: [Select]$url = $_SERVER['REQUEST_URI'];Ruud
If you want to have the first 3 news with heading and short text display_news_items(0,3,40,1) and the next 10 wit just heading like display_news_items(3,10,0,1), is it possible?