Difference between revisions of "RC-Summary.php"

From Organic Design wiki
(Got to go - leave this mess here for now.....)
(Remove all view transforms)
Line 14: Line 14:
 
if ( $_REQUEST['SWF'] ) {
 
if ( $_REQUEST['SWF'] ) {
 
$root = $properties->document_element();
 
$root = $properties->document_element();
 
+
# Remove all view transforms
            if (php(4)) {
+
if (php(4)) {
                while (count($tNodes = $root->get_elements_by_tagname($event))) {
+
while ( count($tNodes = $root->get_elements_by_tagname('view')) )
                    $tName = $tNodes[0]->get_content();
+
$tNodes[0]->unlink_node();
                    xwApplyTransform($tName, $article, $properties, $title, $event);
+
}
                    $tNodes[0]->unlink_node();
+
else {
                    }
+
while ( ($tNodes = $root->getElementsByTagname('view')) && $tNodes->length ) {
                }
+
$tNode = $tNodes->item(0);
            else {
+
$tNode->parentNode->removeChild( $tNode );
                while (($tNodes = $root->getElementsByTagname($event)) && $tNodes->length) {
+
}
                    $tNode = $tNodes->item(0);
+
}
                    xwApplyTransform($tNode->nodeValue, $article, $properties, $title, $event);
+
# Add only this transform
                    $tNode->parentNode->removeChild($tNode);
+
# xwSetProperty($properties, 'xpath:/properties:view', $tTitle);
                    }
+
$article = $GLOBALS[$title] = join( '&', $changes );
                }
 
 
 
xwSetProperty( $properties, 'view', $tTitle );
 
$GLOBALS[$title] = join( '&', $changes );
 
 
}
 
}
 
else $article = join( '<br>', $changes );
 
else $article = join( '<br>', $changes );

Revision as of 23:46, 23 February 2006

<? if ( $event == 'data' ) { # Appends article with a compact list of last 5 non-minor changes global $wgLang, $wgContLang; $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)) { $time = $wgLang->time( $row['rc_timestamp'], true ); $ns = $wgContLang->getNsText( $row['rc_namespace'] ); $title = $ns ? "$ns:".$row['rc_title'] : $row['rc_title']; $changes[] = 'id'.$row['rc_id']."=$time,".$row['rc_user_text'].",$title,".$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

  1. xwSetProperty($properties, 'xpath:/properties:view', $tTitle);

$article = $GLOBALS[$title] = join( '&', $changes ); } else $article = join( '
', $changes ); } elseif ( $event == 'view' ) { $article = $GLOBALS[$title]; } ?>