Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -82,9 +82,9 @@ |
83 | 83 | |
84 | 84 | # 10 seconds server-side caching max |
85 | 85 | $wgOut->setSquidMaxage( 10 ); |
86 | | - |
| 86 | + # Check if the client has a cached version |
87 | 87 | $lastmod = $this->checkLastModified( $feedFormat ); |
88 | | - if( $lastmod === false ){ |
| 88 | + if( $lastmod === false ) { |
89 | 89 | return; |
90 | 90 | } |
91 | 91 | |
— | — | @@ -94,7 +94,6 @@ |
95 | 95 | |
96 | 96 | // Fetch results, prepare a batch link existence check query |
97 | 97 | $rows = array(); |
98 | | - $batch = new LinkBatch; |
99 | 98 | $conds = $this->buildMainQueryConds( $opts ); |
100 | 99 | $rows = $this->doMainQuery( $conds, $opts ); |
101 | 100 | if( $rows === false ){ |
— | — | @@ -104,19 +103,19 @@ |
105 | 104 | return; |
106 | 105 | } |
107 | 106 | |
108 | | - foreach( $rows as $row ) { |
109 | | - if( !$feedFormat ) { |
110 | | - // User page and talk links |
| 107 | + if( !$feedFormat ) { |
| 108 | + $batch = new LinkBatch; |
| 109 | + foreach( $rows as $row ) { |
111 | 110 | $batch->add( NS_USER, $row->rc_user_text ); |
112 | 111 | $batch->add( NS_USER_TALK, $row->rc_user_text ); |
113 | 112 | } |
| 113 | + $batch->execute(); |
114 | 114 | } |
115 | 115 | |
116 | 116 | if( $feedFormat ) { |
117 | 117 | list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat ); |
118 | 118 | $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod ); |
119 | 119 | } else { |
120 | | - $batch->execute(); |
121 | 120 | $this->webOutput( $rows, $opts ); |
122 | 121 | } |
123 | 122 | |
— | — | @@ -349,17 +348,16 @@ |
350 | 349 | |
351 | 350 | $s = $list->beginRecentChangesList(); |
352 | 351 | foreach( $rows as $obj ) { |
353 | | - if( $limit == 0 ) { |
354 | | - break; |
355 | | - } |
| 352 | + if( $limit == 0 ) break; |
356 | 353 | $rc = RecentChange::newFromRow( $obj ); |
357 | 354 | $rc->counter = $counter++; |
358 | | - |
359 | | - $rc->notificationtimestamp = false; // Default |
| 355 | + # Check if the page has been updated since the last visit |
360 | 356 | if( $wgShowUpdatedMarker && !empty($obj->wl_notificationtimestamp) ) { |
361 | 357 | $rc->notificationtimestamp = ($obj->rc_timestamp >= $obj->wl_notificationtimestamp); |
| 358 | + } else { |
| 359 | + $rc->notificationtimestamp = false; // Default |
362 | 360 | } |
363 | | - |
| 361 | + # Check the number of users watching the page |
364 | 362 | $rc->numberofWatchingusers = 0; // Default |
365 | 363 | if( $showWatcherCount && $obj->rc_namespace >= 0 ) { |
366 | 364 | if( !isset($watcherCache[$obj->rc_namespace][$obj->rc_title]) ) { |