I am still curious about the News Module functionality, but I have fixed my issue specific to the Blog Menu.
To properly display the number of visible posts in the Blog Menu...
In the Blog Menu module, open include.php
change:
// make database query and obtain active groups and amount of posts per group
$result = $database->query($query);
if($result->numRows() > 0){
if ($group_header != "") {
echo $group_header;
}
while($group = $result->fetchRow()){
$id = $group['group_id'];
$query_detail = "SELECT * FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true AND group_id=$id;";
$detail_result = $database->query($query_detail);
$num = $detail_result->numRows();
$output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?g=".$group['group_id']."\">" .$group['title'] ."</a> (".$num.")</li>\n";
}
}
$output = "<ul>".$output."</ul>";
echo $output;
}
if($display_option==0 or $display_option==1){ //show history
To:
// make database query and obtain active groups and amount of posts per group
$t = time();
$result = $database->query($query);
if($result->numRows() > 0){
if ($group_header != "") {
echo $group_header;
}
while($group = $result->fetchRow()){
$id = $group['group_id'];
$query_detail = "SELECT * FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) AND group_id=$id;";
$detail_result = $database->query($query_detail);
$num = $detail_result->numRows();
$output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?g=".$group['group_id']."\">" .$group['title'] ."</a> (".$num.")</li>\n";
}
}
$output = "<ul>".$output."</ul>";
echo $output;
}
if($display_option==0 or $display_option==1){ //show history
To fix the post count in the monthly Blog Menu listing:
Change:
$query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true GROUP BY y,m ORDER BY y DESC,m DESC;";
To:
$query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) GROUP BY y,m ORDER BY y DESC,m DESC;";
Hope this helps.