Difference between revisions of "RC-Summary.php"

From Organic Design wiki
m
(Format timestamp)
Line 5: Line 5:
 
$result = $db->query( "SELECT rc_id, rc_timestamp, rc_user_text, rc_namespace, rc_title, rc_comment FROM recentchanges WHERE rc_minor=0 ORDER BY rc_timestamp DESC LIMIT 5" );
 
$result = $db->query( "SELECT rc_id, rc_timestamp, rc_user_text, rc_namespace, rc_title, rc_comment FROM recentchanges WHERE rc_minor=0 ORDER BY rc_timestamp DESC LIMIT 5" );
 
while ($row = mysql_fetch_assoc($result)) {
 
while ($row = mysql_fetch_assoc($result)) {
$row['rc_timestamp'] = $wgLang->timeanddate( $row['rc_timestamp'], false);
+
$row['rc_timestamp'] = $wgLang->timeanddate( $row['rc_timestamp'], true);
 
$article .= join(',',$row);
 
$article .= join(',',$row);
 
$article .= "<br>";
 
$article .= "<br>";
 
}
 
}
 
?>
 
?>

Revision as of 20:12, 23 February 2006

<?

  1. Appends article with a compact list of last 5 non-minor changes

global $wgLang; $db =& wfGetDB( DB_MASTER ); $result = $db->query( "SELECT rc_id, rc_timestamp, rc_user_text, rc_namespace, rc_title, rc_comment FROM recentchanges WHERE rc_minor=0 ORDER BY rc_timestamp DESC LIMIT 5" ); while ($row = mysql_fetch_assoc($result)) { $row['rc_timestamp'] = $wgLang->timeanddate( $row['rc_timestamp'], true); $article .= join(',',$row); $article .= "
"; } ?>