Just a simple droplet that generates linked headlines from a newsgroup.
if ( !isset($max) ){ $max = 10; }
if ( !isset($start_date) ){ $start_date= "-10 day"; }
if ( !isset($stop_date) ){ $stop_date= "now"; }
if ( !isset($order) ){ $order= "DESC"; }
global $database, $wb;
$mod_query = $database->query("SELECT title, link, published_when FROM ".TABLE_PREFIX.
"mod_news_posts WHERE active='1' AND group_id = ".$group.
" AND published_when>=".strtotime($start_date).
" AND published_when<=".strtotime($stop_date).
" ORDER BY post_id ".$order." LIMIT ".$max);
$mod_list = " ";
while ( $row =& $mod_query->fetchRow()){
$mod_list .= '<a href="'.WB_URL.PAGES_DIRECTORY.$row['link'].PAGE_EXTENSION.'">'.$row['title'].'</a><br>';
}
return $mod_list;
start_date : earlyest newspost headlines to collect * optional ("-10 day" by default)
order : Newest or Oldest posts first * optional ("ASC" or "DESC", "DESC" by default)