Difference between revisions of "RC-Summary.php"

From Organic Design wiki
m
m
Line 1: Line 1:
 
<?
 
<?
 +
global $wgLang, $wgContLang, $$title;
 
if ( $event == 'data' ) {
 
if ( $event == 'data' ) {
 
# Appends article with a compact list of last 5 non-minor changes
 
# Appends article with a compact list of last 5 non-minor changes
global $wgLang, $wgContLang, $rcs;
 
 
$db =& wfGetDB( DB_MASTER );
 
$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" );
 
$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" );
Line 26: Line 26:
 
# Add only this transform
 
# Add only this transform
 
xwSetProperty($properties, 'view', $tTitle);
 
xwSetProperty($properties, 'view', $tTitle);
$rcs= join( '&', $changes );
+
$$title = join( '&', $changes );
 
}
 
}
 
else $article = join( '<br>', $changes );
 
else $article = join( '<br>', $changes );
 
}
 
}
 
elseif ( $event == 'view' ) {
 
elseif ( $event == 'view' ) {
$article = $rcs;
+
$article = $$title;
 
}
 
}
 
?>
 
?>

Revision as of 23:59, 23 February 2006

<? global $wgLang, $wgContLang, $$title; if ( $event == 'data' ) { # Appends article with a compact list of last 5 non-minor changes $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" ); $changes = array(); while ($row = mysql_fetch_assoc($result)) { $t = $wgLang->time( $row['rc_timestamp'], true ); $n = $wgContLang->getNsText( $row['rc_namespace'] ); $a = $n ? "$n:".$row['rc_title'] : $row['rc_title']; $changes[] = 'id'.$row['rc_id']."=$t,".$row['rc_user_text'].",$a,".$row['rc_comment']; } if ( $_REQUEST['SWF'] ) { $root = $properties->document_element(); # Remove all view transforms if (php(4)) { while ( count($tNodes = $root->get_elements_by_tagname('view')) ) $tNodes[0]->unlink_node(); } else { while ( ($tNodes = $root->getElementsByTagname('view')) && $tNodes->length ) { $tNode = $tNodes->item(0); $tNode->parentNode->removeChild( $tNode ); } } # Add only this transform xwSetProperty($properties, 'view', $tTitle); $$title = join( '&', $changes ); } else $article = join( '
', $changes ); } elseif ( $event == 'view' ) { $article = $$title; } ?>