Index: trunk/phase3/skins/monobook/main.css |
— | — | @@ -1154,6 +1154,10 @@ |
1155 | 1155 | span.newpage, span.minor, span.bot { |
1156 | 1156 | font-weight: bold; |
1157 | 1157 | } |
| 1158 | +span.unpatrolled { |
| 1159 | + font-weight: bold; |
| 1160 | + color: red; |
| 1161 | +} |
1158 | 1162 | |
1159 | 1163 | .sharedUploadNotice { |
1160 | 1164 | font-style: italic; |
Index: trunk/phase3/skins/modern/main.css |
— | — | @@ -650,6 +650,10 @@ |
651 | 651 | span.newpage, span.minor, span.searchmatch, span.bot { |
652 | 652 | font-weight: bold; |
653 | 653 | } |
| 654 | +span.unpatrolled { |
| 655 | + font-weight: bold; |
| 656 | + color: red; |
| 657 | +} |
654 | 658 | |
655 | 659 | span.searchmatch { |
656 | 660 | color: red; |
Index: trunk/phase3/skins/common/oldshared.css |
— | — | @@ -212,10 +212,6 @@ |
213 | 213 | font-weight:bold; |
214 | 214 | color:red; |
215 | 215 | } |
216 | | -span.newuser { |
217 | | - font-weight:bold; |
218 | | - color:orange; |
219 | | -} |
220 | 216 | |
221 | 217 | span.updatedmarker { |
222 | 218 | color:black; |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -56,20 +56,8 @@ |
57 | 57 | } |
58 | 58 | |
59 | 59 | /* |
60 | | - * Recent changes |
| 60 | + * rev_deleted stuff |
61 | 61 | */ |
62 | | -span.unpatrolled { |
63 | | - font-weight: bold; |
64 | | - color: red; |
65 | | -} |
66 | | -span.newuser { |
67 | | - font-weight:bold; |
68 | | - color:orange; |
69 | | -} |
70 | | - |
71 | | -/* |
72 | | - * RevisionDelete stuff |
73 | | - */ |
74 | 62 | li span.deleted, span.history-deleted { |
75 | 63 | text-decoration: line-through; |
76 | 64 | color: #888; |
Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1231,7 +1231,6 @@ |
1232 | 1232 | &$tables: array of tables to be queried |
1233 | 1233 | &$join_conds: join conditions for the tables |
1234 | 1234 | $opts: FormOptions for this request |
1235 | | -&$fields: select fields |
1236 | 1235 | |
1237 | 1236 | 'SpecialSearchNogomatch': called when user clicked the "Go" button but the target doesn't exist |
1238 | 1237 | $title: title object generated from the text entred by the user |
Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -49,13 +49,15 @@ |
50 | 50 | |
51 | 51 | # Factory methods |
52 | 52 | |
53 | | - public static function newFromRow( $row ) { |
| 53 | + public static function newFromRow( $row ) |
| 54 | + { |
54 | 55 | $rc = new RecentChange; |
55 | 56 | $rc->loadFromRow( $row ); |
56 | 57 | return $rc; |
57 | 58 | } |
58 | 59 | |
59 | | - public static function newFromCurRow( $row ) { |
| 60 | + public static function newFromCurRow( $row ) |
| 61 | + { |
60 | 62 | $rc = new RecentChange; |
61 | 63 | $rc->loadFromCurRow( $row ); |
62 | 64 | $rc->notificationtimestamp = false; |
— | — | @@ -108,22 +110,26 @@ |
109 | 111 | |
110 | 112 | # Accessors |
111 | 113 | |
112 | | - function setAttribs( $attribs ) { |
| 114 | + function setAttribs( $attribs ) |
| 115 | + { |
113 | 116 | $this->mAttribs = $attribs; |
114 | 117 | } |
115 | 118 | |
116 | | - function setExtra( $extra ) { |
| 119 | + function setExtra( $extra ) |
| 120 | + { |
117 | 121 | $this->mExtra = $extra; |
118 | 122 | } |
119 | 123 | |
120 | | - function &getTitle() { |
| 124 | + function &getTitle() |
| 125 | + { |
121 | 126 | if ( $this->mTitle === false ) { |
122 | 127 | $this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] ); |
123 | 128 | } |
124 | 129 | return $this->mTitle; |
125 | 130 | } |
126 | 131 | |
127 | | - function getMovedToTitle() { |
| 132 | + function getMovedToTitle() |
| 133 | + { |
128 | 134 | if ( $this->mMovedToTitle === false ) { |
129 | 135 | $this->mMovedToTitle = Title::makeTitle( $this->mAttribs['rc_moved_to_ns'], |
130 | 136 | $this->mAttribs['rc_moved_to_title'] ); |
— | — | @@ -132,7 +138,8 @@ |
133 | 139 | } |
134 | 140 | |
135 | 141 | # Writes the data in this object to the database |
136 | | - function save() { |
| 142 | + function save() |
| 143 | + { |
137 | 144 | global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, |
138 | 145 | $wgRC2UDPPort, $wgRC2UDPPrefix, $wgRC2UDPOmitBots; |
139 | 146 | $fname = 'RecentChange::save'; |
— | — | @@ -171,6 +178,35 @@ |
172 | 179 | # Update old rows, if necessary |
173 | 180 | if ( $this->mAttribs['rc_type'] == RC_EDIT ) { |
174 | 181 | $lastTime = $this->mExtra['lastTimestamp']; |
| 182 | + #$now = $this->mAttribs['rc_timestamp']; |
| 183 | + #$curId = $this->mAttribs['rc_cur_id']; |
| 184 | + |
| 185 | + # Don't bother looking for entries that have probably |
| 186 | + # been purged, it just locks up the indexes needlessly. |
| 187 | + global $wgRCMaxAge; |
| 188 | + $age = time() - wfTimestamp( TS_UNIX, $lastTime ); |
| 189 | + if( $age < $wgRCMaxAge ) { |
| 190 | + # live hack, will commit once tested - kate |
| 191 | + # Update rc_this_oldid for the entries which were current |
| 192 | + # |
| 193 | + #$oldid = $this->mAttribs['rc_last_oldid']; |
| 194 | + #$ns = $this->mAttribs['rc_namespace']; |
| 195 | + #$title = $this->mAttribs['rc_title']; |
| 196 | + # |
| 197 | + #$dbw->update( 'recentchanges', |
| 198 | + # array( /* SET */ |
| 199 | + # 'rc_this_oldid' => $oldid |
| 200 | + # ), array( /* WHERE */ |
| 201 | + # 'rc_namespace' => $ns, |
| 202 | + # 'rc_title' => $title, |
| 203 | + # 'rc_timestamp' => $dbw->timestamp( $lastTime ) |
| 204 | + # ), $fname |
| 205 | + #); |
| 206 | + } |
| 207 | + |
| 208 | + # Update rc_cur_time |
| 209 | + #$dbw->update( 'recentchanges', array( 'rc_cur_time' => $now ), |
| 210 | + # array( 'rc_cur_id' => $curId ), $fname ); |
175 | 211 | } |
176 | 212 | |
177 | 213 | # Notify external application via UDP |
— | — | @@ -540,43 +576,13 @@ |
541 | 577 | public function getAttribute( $name ) { |
542 | 578 | return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : NULL; |
543 | 579 | } |
544 | | - |
545 | | - /* |
546 | | - * Get RC select fields for changes lists |
547 | | - */ |
548 | | - public static function getSelectFields() { |
549 | | - return array( |
550 | | - 'rc_timestamp', |
551 | | - 'rc_cur_time', |
552 | | - 'rc_user', |
553 | | - 'rc_user_text', |
554 | | - 'rc_namespace', |
555 | | - 'rc_title', |
556 | | - 'rc_comment', |
557 | | - 'rc_minor', |
558 | | - 'rc_type', |
559 | | - 'rc_cur_id', |
560 | | - 'rc_this_oldid', |
561 | | - 'rc_last_oldid', |
562 | | - 'rc_bot', |
563 | | - 'rc_moved_to_ns', |
564 | | - 'rc_moved_to_title', |
565 | | - 'rc_patrolled', |
566 | | - 'rc_old_len', |
567 | | - 'rc_new_len', |
568 | | - 'rc_params', |
569 | | - 'rc_log_type', |
570 | | - 'rc_log_action', |
571 | | - 'rc_log_id', |
572 | | - 'rc_deleted' // this one REALLY should be set... |
573 | | - ); |
574 | | - } |
575 | 580 | |
576 | 581 | /** |
577 | 582 | * Gets the end part of the diff URL associated with this object |
578 | 583 | * Blank if no diff link should be displayed |
579 | 584 | */ |
580 | | - function diffLinkTrail( $forceCur ) { |
| 585 | + function diffLinkTrail( $forceCur ) |
| 586 | + { |
581 | 587 | if ( $this->mAttribs['rc_type'] == RC_EDIT ) { |
582 | 588 | $trail = "curid=" . (int)($this->mAttribs['rc_cur_id']) . |
583 | 589 | "&oldid=" . (int)($this->mAttribs['rc_last_oldid']); |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -75,38 +75,17 @@ |
76 | 76 | * @param bool $patrolled |
77 | 77 | * @param string $nothing, string to use for empty space |
78 | 78 | * @param bool $bot |
79 | | - * @param bool $newbie |
80 | 79 | * @return string |
81 | 80 | */ |
82 | | - protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false, $newbie = false ) { |
| 81 | + protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) { |
83 | 82 | $f = $new ? '<span class="newpage">' . $this->message['newpageletter'] . '</span>' |
84 | 83 | : $nothing; |
85 | 84 | $f .= $minor ? '<span class="minor">' . $this->message['minoreditletter'] . '</span>' |
86 | 85 | : $nothing; |
87 | 86 | $f .= $bot ? '<span class="bot">' . $this->message['boteditletter'] . '</span>' : $nothing; |
88 | 87 | $f .= $patrolled ? '<span class="unpatrolled">!</span>' : $nothing; |
89 | | - $f .= $newbie ? '<span class="newuser">*</span>' : $nothing; |
90 | 88 | return $f; |
91 | 89 | } |
92 | | - |
93 | | - protected static function userIsNew( $attribs ) { |
94 | | - global $wgAutoConfirmCount, $wgAutoConfirmAge; |
95 | | - if( !array_key_exists('user_editcount',$attribs) || !array_key_exists('user_registration',$attribs) ) { |
96 | | - return false; // missing input! |
97 | | - } |
98 | | - static $time; |
99 | | - $time = time(); |
100 | | - $edits = $attribs['user_editcount']; |
101 | | - $age = $attribs['user_registration']; |
102 | | - if( $wgAutoConfirmCount && !$edits || $wgAutoConfirmAge && !$age ) { |
103 | | - return true; |
104 | | - } else if( $wgAutoConfirmCount && $edits < $wgAutoConfirmCount ) { |
105 | | - return true; |
106 | | - } else if( $wgAutoConfirmAge && ($time - wfTimestampOrNull(TS_UNIX,$age)) < $wgAutoConfirmAge ) { |
107 | | - return true; |
108 | | - } |
109 | | - return false; |
110 | | - } |
111 | 90 | |
112 | 91 | /** |
113 | 92 | * Returns text for the start of the tabular part of RC |
— | — | @@ -364,10 +343,9 @@ |
365 | 344 | wfProfileIn($fname.'-page'); |
366 | 345 | |
367 | 346 | $this->insertDiffHist($s, $rc, $unpatrolled); |
| 347 | + |
368 | 348 | # M, N, b and ! (minor, new, bot and unpatrolled) |
369 | | - $newbie = self::userIsNew( $rc->mAttribs ); |
370 | | - $s .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '', |
371 | | - $rc_bot, $newbie ); |
| 349 | + $s .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '', $rc_bot ); |
372 | 350 | $this->insertArticleLink($s, $rc, $unpatrolled, $watched); |
373 | 351 | |
374 | 352 | wfProfileOut($fname.'-page'); |
— | — | @@ -564,14 +542,15 @@ |
565 | 543 | # Collate list of users |
566 | 544 | $userlinks = array(); |
567 | 545 | # Other properties |
568 | | - $unpatrolled = $isnew = $newbie = false; |
| 546 | + $unpatrolled = false; |
| 547 | + $isnew = false; |
569 | 548 | $curId = $currentRevision = 0; |
570 | 549 | # Some catalyst variables... |
571 | 550 | $namehidden = true; |
572 | 551 | $alllogs = true; |
573 | 552 | foreach( $block as $rcObj ) { |
574 | 553 | $oldid = $rcObj->mAttribs['rc_last_oldid']; |
575 | | - if( $rcObj->mAttribs['rc_type'] == RC_NEW ) { |
| 554 | + if( $rcObj->mAttribs['rc_new'] ) { |
576 | 555 | $isnew = true; |
577 | 556 | } |
578 | 557 | // If all log actions to this page were hidden, then don't |
— | — | @@ -589,9 +568,6 @@ |
590 | 569 | if( $rcObj->mAttribs['rc_type'] != RC_LOG ) { |
591 | 570 | $alllogs = false; |
592 | 571 | } |
593 | | - if( self::userIsNew( $rcObj->mAttribs ) ) { |
594 | | - $newbie = true; |
595 | | - } |
596 | 572 | # Get the latest entry with a page_id and oldid |
597 | 573 | # since logs may not have these. |
598 | 574 | if( !$curId && $rcObj->mAttribs['rc_cur_id'] ) { |
— | — | @@ -630,7 +606,7 @@ |
631 | 607 | $r .= '<td valign="top" style="white-space: nowrap"><tt>'.$tl.' '; |
632 | 608 | |
633 | 609 | # Main line |
634 | | - $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, ' ', $bot, $newbie ); |
| 610 | + $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, ' ', $bot ); |
635 | 611 | |
636 | 612 | # Timestamp |
637 | 613 | $r .= ' '.$block[0]->timestamp.' </tt></td><td>'; |
— | — | @@ -713,8 +689,7 @@ |
714 | 690 | #$r .= '<tr><td valign="top">'.$this->spacerArrow(); |
715 | 691 | $r .= '<tr><td valign="top">'; |
716 | 692 | $r .= '<tt>'.$this->spacerIndent() . $this->spacerIndent(); |
717 | | - $newbie = self::userIsNew( $rcObj->mAttribs ); |
718 | | - $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot, $newbie ); |
| 693 | + $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot ); |
719 | 694 | $r .= ' </tt></td><td valign="top">'; |
720 | 695 | |
721 | 696 | $o = ''; |
— | — | @@ -840,15 +815,14 @@ |
841 | 816 | $curIdEq = 'curid='.$rc_cur_id; |
842 | 817 | |
843 | 818 | $r = '<table cellspacing="0" cellpadding="0" border="0" style="background: none"><tr>'; |
| 819 | + |
844 | 820 | $r .= '<td valign="top" style="white-space: nowrap"><tt>' . $this->spacerArrow() . ' '; |
845 | 821 | |
846 | 822 | # Flag and Timestamp |
847 | 823 | if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { |
848 | 824 | $r .= ' '; // 4 flags -> 4 spaces |
849 | 825 | } else { |
850 | | - $newbie = self::userIsNew( $rcObj->mAttribs ); |
851 | | - $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, |
852 | | - ' ', $rc_bot, $newbie ); |
| 826 | + $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot ); |
853 | 827 | } |
854 | 828 | $r .= ' '.$rcObj->timestamp.' </tt></td><td>'; |
855 | 829 | |
— | — | @@ -864,7 +838,7 @@ |
865 | 839 | } |
866 | 840 | |
867 | 841 | # Diff and hist links |
868 | | - if( $rc_type != RC_LOG ) { |
| 842 | + if ( $rc_type != RC_LOG ) { |
869 | 843 | $r .= ' ('. $rcObj->difflink . $this->message['semicolon-separator']; |
870 | 844 | $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' ) . ')'; |
871 | 845 | } |
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -264,11 +264,8 @@ |
265 | 265 | public function doMainQuery( $conds, $opts ) { |
266 | 266 | global $wgUser; |
267 | 267 | |
268 | | - $tables = array( 'recentchanges', 'user' ); |
269 | | - $join_conds = array( 'user' => array('LEFT JOIN','rc_user != 0 AND user_id = rc_user') ); |
270 | | - $fields = RecentChange::getSelectFields(); |
271 | | - $fields[] = 'user_editcount'; |
272 | | - $fields[] = 'user_registration'; |
| 268 | + $tables = array( 'recentchanges' ); |
| 269 | + $join_conds = array(); |
273 | 270 | |
274 | 271 | $uid = $wgUser->getId(); |
275 | 272 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -279,10 +276,10 @@ |
280 | 277 | // JOIN on watchlist for users |
281 | 278 | if( $uid ) { |
282 | 279 | $tables[] = 'watchlist'; |
283 | | - $join_conds['watchlist'] = array('LEFT JOIN',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace"); |
| 280 | + $join_conds = array( 'watchlist' => array('LEFT JOIN',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") ); |
284 | 281 | } |
285 | 282 | |
286 | | - wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$fields ) ); |
| 283 | + wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) ); |
287 | 284 | |
288 | 285 | // Is there either one namespace selected or excluded? |
289 | 286 | // Also, if this is "all" or main namespace, just use timestamp index. |
— | — | @@ -316,7 +313,7 @@ |
317 | 314 | } |
318 | 315 | |
319 | 316 | /** |
320 | | - * Send output to $wgOut, only called if not using feeds |
| 317 | + * Send output to $wgOut, only called if not used feeds |
321 | 318 | * |
322 | 319 | * @param $rows array of database rows |
323 | 320 | * @param $opts FormOptions |
Index: trunk/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); |
95 | | - list($page,$watchlist,$recentchanges,$user) = $dbr->tableNamesN('page','watchlist','recentchanges','user'); |
| 95 | + list( $page, $watchlist, $recentchanges ) = $dbr->tableNamesN( 'page', 'watchlist', 'recentchanges' ); |
96 | 96 | |
97 | 97 | $watchlistCount = $dbr->selectField( 'watchlist', 'COUNT(*)', |
98 | 98 | array( 'wl_user' => $uid ), __METHOD__ ); |
— | — | @@ -198,10 +198,9 @@ |
199 | 199 | } else { |
200 | 200 | $wltsfield = ''; |
201 | 201 | } |
202 | | - $sql = "SELECT ${recentchanges}.* ${wltsfield}, {$user}.user_editcount, {$user}.user_registration |
| 202 | + $sql = "SELECT ${recentchanges}.* ${wltsfield} |
203 | 203 | FROM $watchlist,$recentchanges |
204 | 204 | LEFT JOIN $page ON rc_cur_id=page_id |
205 | | - LEFT JOIN $user ON (rc_user !='0' AND rc_user = user_id) |
206 | 205 | WHERE wl_user=$uid |
207 | 206 | AND wl_namespace=rc_namespace |
208 | 207 | AND wl_title=rc_title |