3 * Rename the function to match the name of the module. Names of all news functions must be unique
4 * across all modules installed on a system. Return a variable called $news
6 require('mw_connect.php');
7 // Number of links to be displayed on "detail view" box
8 function mediawiki_news() {
9 global $db_mw, $_config;
11 if($_GET['p'] == "all"){
15 $sql = "SELECT P.page_id, P.page_title, R.rev_timestamp FROM ".MW_DB_PREFIX."page P, ".MW_DB_PREFIX."revision R WHERE R.rev_page = P.page_id ORDER BY R.rev_timestamp DESC";
16 $result = mysql_query($sql, $db_mw);
20 while($row = mysql_fetch_assoc($result)){
22 if($news_count < $link_limit && !in_array( $row['page_id'],$page_ids)){
23 $this_time = AT_date("%Y-%m-%d %G:%i:%s", $row['rev_timestamp'],AT_DATE_MYSQL_TIMESTAMP_14);
24 $page_ids[] = $row['page_id'];
25 $news[] = array('time'=> $this_time,
26 'alt'=>_AT('mediawiki_update'),
27 'thumb'=>'mods/mediawiki/mw_icon_sm.png',
28 'link'=>'<a href="'.AT_BASE_HREF.url_rewrite('mods/mediawiki/index_mystart.php?p='.$row['page_title']).'"'.
29 (strlen($row['page_title']) > SUBLINK_TEXT_LEN ? ' title="'.$row['page_title'].'"' : '') .'>'.
30 validate_length($row['page_title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>');