}
return new FeedItem(
- $title->getText(),
+ $title->getPrefixedText(),
$this->feedItemDesc( $row ),
$title->getFullURL(),
$date,
}
function feedItemDesc( $row ) {
- $text = '';
- if( isset( $row->comment ) ) {
- $text = htmlspecialchars( $row->comment );
- } else {
- $text = '';
- }
-
- if( isset( $row->text ) ) {
- $text = '<p>' . htmlspecialchars( wfMsg( 'summary' ) ) . ': ' . $text . "</p>\n<hr />\n<div>" .
- nl2br( htmlspecialchars( $row->text ) ) . "</div>";;
- }
- return $text;
+ return isset( $row->comment )
+ ? htmlspecialchars( $row->comment )
+ : '';
}
function feedItemAuthor( $row ) {
'{$usepatrol}' as usepatrol,
rc_patrolled AS patrolled,
rc_id AS rcid,
- length(old_text) as length,
- old_text as text
- FROM $recentchanges,$page,$text
+ page_len as length,
+ page_latest as rev_id
+ FROM $recentchanges,$page
WHERE rc_cur_id=page_id AND rc_new=1
- AND rc_namespace=".NS_MAIN." AND page_is_redirect=0
- AND page_latest=old_id";
+ AND rc_namespace=".NS_MAIN." AND page_is_redirect=0";
}
function formatResult( $skin, $result ) {
return $s;
}
+
+ function feedItemDesc( $row ) {
+ if( isset( $row->rev_id ) ) {
+ $revision = Revision::newFromId( $row->rev_id );
+ if( $revision ) {
+ return '<p>' . htmlspecialchars( wfMsg( 'summary' ) ) . ': ' . $text . "</p>\n<hr />\n<div>" .
+ nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
+ }
+ }
+ return parent::feedItemDesc( $row );
+ }
}
/**