Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -161,11 +161,13 @@ |
162 | 162 | /** |
163 | 163 | * @var $title Title |
164 | 164 | */ |
165 | | - list( $title, $userName ) = $info; |
| 165 | + list( $title, $userName, $edits ) = $info; |
166 | 166 | |
167 | 167 | $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
168 | 168 | $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false; |
169 | 169 | |
| 170 | + $changes = wfMsgExt( 'nchanges', 'parsemag', $this->getLanguage()->formatNum( $edits ) ); |
| 171 | + |
170 | 172 | $out->addHTML( '<li>' . |
171 | 173 | Xml::check( |
172 | 174 | 'pages[]', |
— | — | @@ -179,7 +181,7 @@ |
180 | 182 | ( $userName ? wfMsgExt( 'nuke-editby', 'parseinline', $userName ) . ', ' : '' ) . |
181 | 183 | Linker::linkKnown( |
182 | 184 | $title, |
183 | | - wfMsg( 'nuke-viewchanges' ), |
| 185 | + $changes, |
184 | 186 | array(), |
185 | 187 | array( 'action' => 'history' ) |
186 | 188 | ) . |
— | — | @@ -204,13 +206,29 @@ |
205 | 207 | protected function getNewPages( $username, $limit ) { |
206 | 208 | $dbr = wfGetDB( DB_SLAVE ); |
207 | 209 | |
| 210 | + /** |
| 211 | + * This is the worst-case query: |
| 212 | + * |
| 213 | + * SELECT rc_user_text, rc_namespace, rc_title, SUM(1) AS edits, MAX(rc_new) |
| 214 | + * FROM recentchanges |
| 215 | + * WHERE (rc_log_type IS NULL OR (rc_log_type = 'upload' AND rc_log_action='upload')) |
| 216 | + * AND rc_title LIKE 'Test%' |
| 217 | + * GROUP BY rc_user_text, rc_namespace, rc_title |
| 218 | + * HAVING MIN(CASE |
| 219 | + * WHEN rc_log_type IS NULL THEN 2 |
| 220 | + * WHEN rc_log_type = 'upload' THEN 1 |
| 221 | + * ELSE 0 END) = 1 |
| 222 | + * OR MAX(rc_new) = 1 |
| 223 | + * ORDER BY min(rc_timestamp) DESC; |
| 224 | + * |
| 225 | + */ |
| 226 | + |
208 | 227 | $what = array( |
209 | 228 | 'rc_namespace', |
210 | 229 | 'rc_title', |
211 | | - 'rc_timestamp', |
212 | 230 | ); |
213 | 231 | |
214 | | - $where = array( "(rc_new = 1) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" ); |
| 232 | + $where = array( "(rc_log_type IS NULL) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" ); |
215 | 233 | |
216 | 234 | if ( $username === '' ) { |
217 | 235 | $what[] = 'rc_user_text'; |
— | — | @@ -222,16 +240,23 @@ |
223 | 241 | if ( !is_null( $pattern ) && trim( $pattern ) !== '' ) { |
224 | 242 | $where[] = 'rc_title LIKE ' . $dbr->addQuotes( $pattern ); |
225 | 243 | } |
226 | | - $group = implode( ', ', $what ); |
| 244 | + $group = implode( ', ', $what ); |
| 245 | + $what[] = "sum(1) AS edits"; |
227 | 246 | |
228 | 247 | $result = $dbr->select( 'recentchanges', |
229 | 248 | $what, |
230 | 249 | $where, |
231 | 250 | __METHOD__, |
232 | 251 | array( |
233 | | - 'ORDER BY' => 'rc_timestamp DESC', |
234 | 252 | 'GROUP BY' => $group, |
235 | | - 'LIMIT' => $limit |
| 253 | + 'LIMIT' => $limit, |
| 254 | + 'ORDER BY' => 'MIN(rc_timestamp) DESC', |
| 255 | + 'HAVING' => <<<QUERY |
| 256 | + MIN(CASE WHEN rc_log_type IS NULL THEN 2 |
| 257 | + WHEN rc_log_type = 'upload' THEN 1 |
| 258 | + ELSE 0 END) = 1 |
| 259 | + OR MAX(rc_new) = 1 |
| 260 | +QUERY |
236 | 261 | ) |
237 | 262 | ); |
238 | 263 | |
— | — | @@ -240,7 +265,8 @@ |
241 | 266 | foreach ( $result as $row ) { |
242 | 267 | $pages[] = array( |
243 | 268 | Title::makeTitle( $row->rc_namespace, $row->rc_title ), |
244 | | - $username === '' ? $row->rc_user_text : false |
| 269 | + $username === '' ? $row->rc_user_text : false, |
| 270 | + $row->edits, |
245 | 271 | ); |
246 | 272 | } |
247 | 273 | |
Index: trunk/extensions/Nuke/Nuke.i18n.php |
— | — | @@ -37,7 +37,6 @@ |
38 | 38 | 'nuke-delete-more' => '[[Special:Nuke|Delete more pages]]', |
39 | 39 | 'nuke-pattern' => 'Pattern for the page name:', |
40 | 40 | 'nuke-nopages-global'=> 'There are no new pages in [[Special:RecentChanges|recent changes]].', |
41 | | - 'nuke-viewchanges' => 'view changes', |
42 | 41 | ); |
43 | 42 | |
44 | 43 | /** Message documentation (Message documentation) |
— | — | @@ -196,7 +195,6 @@ |
197 | 196 | 'nuke-delete-more' => '[[Special:Nuke|Desaniciar más páxines]]', |
198 | 197 | 'nuke-pattern' => 'Patrón pal nome de páxina:', |
199 | 198 | 'nuke-nopages-global' => 'Nun hai páxines nueves nos [[Special:RecentChanges|cambios recientes]].', |
200 | | - 'nuke-viewchanges' => 'ver los cambios', |
201 | 199 | ); |
202 | 200 | |
203 | 201 | /** Azerbaijani (Azərbaycanca) |
— | — | @@ -288,7 +286,6 @@ |
289 | 287 | 'nuke-delete-more' => '[[Special:Nuke|Масавае выдаленьне старонак]]', |
290 | 288 | 'nuke-pattern' => 'Узор для назвы старонкі:', |
291 | 289 | 'nuke-nopages-global' => 'У [[Special:RecentChanges|апошніх зьменах]] больш няма новых старонак.', |
292 | | - 'nuke-viewchanges' => 'праглядзець зьмены', |
293 | 290 | ); |
294 | 291 | |
295 | 292 | /** Bulgarian (Български) |
— | — | @@ -356,7 +353,6 @@ |
357 | 354 | 'nuke-delete-more' => '[[Special:Nuke|Diverkañ pajennoù all]]', |
358 | 355 | 'nuke-pattern' => 'Patrom evit anv ar bajenn :', |
359 | 356 | 'nuke-nopages-global' => "N'eus pajenn nevez ebet er [[Special:RecentChanges|c'hemmoù diwezhañ]].", |
360 | | - 'nuke-viewchanges' => "Diskouez ar c'hemmoù", |
361 | 357 | ); |
362 | 358 | |
363 | 359 | /** Bosnian (Bosanski) |
— | — | @@ -509,7 +505,6 @@ |
510 | 506 | 'nuke-delete-more' => '[[Special:Nuke|Weitere Seiten löschen]]', |
511 | 507 | 'nuke-pattern' => 'Muster für den Seitennamen:', |
512 | 508 | 'nuke-nopages-global' => 'Es gibt keine neuen Seiten unter den [[Special:RecentChanges|letzten Änderungen]].', |
513 | | - 'nuke-viewchanges' => 'Änderungen ansehen', |
514 | 509 | ); |
515 | 510 | |
516 | 511 | /** German (formal address) (Deutsch (Sie-Form)) |
— | — | @@ -569,7 +564,6 @@ |
570 | 565 | 'nuke-delete-more' => '[[Special:Nuke|Dalšne boki lašowaś]]', |
571 | 566 | 'nuke-pattern' => 'Pśikład za bokowe mě:', |
572 | 567 | 'nuke-nopages-global' => 'Njejsu žedne nowe boki w [[Special:RecentChanges|aktualnych změnach]].', |
573 | | - 'nuke-viewchanges' => 'změny pokazaś', |
574 | 568 | ); |
575 | 569 | |
576 | 570 | /** Ewe (Eʋegbe) */ |
— | — | @@ -668,7 +662,6 @@ |
669 | 663 | 'nuke-delete-more' => '[[Special:Nuke|Borrar más páginas]]', |
670 | 664 | 'nuke-pattern' => 'Patrón del título de la página:', |
671 | 665 | 'nuke-nopages-global' => 'No hay nuevas páginas en los [[Special:RecentChanges|cambios recientes]].', |
672 | | - 'nuke-viewchanges' => 'Mostrar cambios', |
673 | 666 | ); |
674 | 667 | |
675 | 668 | /** Estonian (Eesti) |
— | — | @@ -741,7 +734,6 @@ |
742 | 735 | 'nuke-delete-more' => '[[Special:Nuke|حذف صفحههای بیشتر]]', |
743 | 736 | 'nuke-pattern' => 'الگو برای نام صفحه:', |
744 | 737 | 'nuke-nopages-global' => 'هیچ صفحهٔ جدیدی در [[Special:RecentChanges|فهرست تغییرات اخیر]] نیست.', |
745 | | - 'nuke-viewchanges' => 'نمایش تغییرات', |
746 | 738 | ); |
747 | 739 | |
748 | 740 | /** Finnish (Suomi) |
— | — | @@ -813,7 +805,6 @@ |
814 | 806 | 'nuke-delete-more' => '[[Special:Nuke|Supprimer plus de pages]]', |
815 | 807 | 'nuke-pattern' => 'Modèle pour le nom de page:', |
816 | 808 | 'nuke-nopages-global' => "Il n'y a pas de nouvelle page dans [[Special:RecentChanges|changements récents]].", |
817 | | - 'nuke-viewchanges' => 'voir les modifications', |
818 | 809 | ); |
819 | 810 | |
820 | 811 | /** Franco-Provençal (Arpetan) |
— | — | @@ -883,7 +874,6 @@ |
884 | 875 | 'nuke-delete-more' => '[[Special:Nuke|Borrar máis páxinas]]', |
885 | 876 | 'nuke-pattern' => 'Patrón para o nome de páxina:', |
886 | 877 | 'nuke-nopages-global' => 'Non hai páxinas novas nos [[Special:RecentChanges|cambios recentes]].', |
887 | | - 'nuke-viewchanges' => 'ollar os cambios', |
888 | 878 | ); |
889 | 879 | |
890 | 880 | /** Ancient Greek (Ἀρχαία ἑλληνικὴ) |
— | — | @@ -967,7 +957,6 @@ |
968 | 958 | 'nuke-delete-more' => '[[Special:Nuke|למחוק עוד דפים]]', |
969 | 959 | 'nuke-pattern' => 'תבנית עבור שם הדף:', |
970 | 960 | 'nuke-nopages-global' => 'אין דפים חדשים ב[[Special:RecentChanges|שינויים אחרונים]].', |
971 | | - 'nuke-viewchanges' => 'הצגת שינויים', |
972 | 961 | ); |
973 | 962 | |
974 | 963 | /** Hindi (हिन्दी) |
— | — | @@ -1043,7 +1032,6 @@ |
1044 | 1033 | 'nuke-delete-more' => '[[Special:Nuke|Dalše strony wušmórnyć]]', |
1045 | 1034 | 'nuke-pattern' => 'Přikład za mjeno strony:', |
1046 | 1035 | 'nuke-nopages-global' => 'Njejsu žane nowe strony w [[Special:RecentChanges|aktualnych změnach]].', |
1047 | | - 'nuke-viewchanges' => 'změny pokazać', |
1048 | 1036 | ); |
1049 | 1037 | |
1050 | 1038 | /** Hungarian (Magyar) |
— | — | @@ -1099,7 +1087,6 @@ |
1100 | 1088 | 'nuke-delete-more' => '[[Special:Nuke|Deler plus paginas]]', |
1101 | 1089 | 'nuke-pattern' => 'Patrono pro le nomine de pagina:', |
1102 | 1090 | 'nuke-nopages-global' => 'Il non ha nove paginas in le [[Special:RecentChanges|modificationes recente]].', |
1103 | | - 'nuke-viewchanges' => 'vider modificationes', |
1104 | 1091 | ); |
1105 | 1092 | |
1106 | 1093 | /** Indonesian (Bahasa Indonesia) |
— | — | @@ -1234,7 +1221,6 @@ |
1235 | 1222 | 'nuke-delete-more' => '[[Special:Nuke|Cancella più pagine]]', |
1236 | 1223 | 'nuke-pattern' => 'Modello per il titolo della pagina:', |
1237 | 1224 | 'nuke-nopages-global' => 'Non ci sono nuove pagine negli [[Special:RecentChanges|ultimi cambiamenti]].', |
1238 | | - 'nuke-viewchanges' => 'vedi modifiche', |
1239 | 1225 | ); |
1240 | 1226 | |
1241 | 1227 | /** Japanese (日本語) |
— | — | @@ -1457,7 +1443,6 @@ |
1458 | 1444 | 'nuke-delete-more' => '[[Special:Nuke|Méi Säite läschen]]', |
1459 | 1445 | 'nuke-pattern' => 'Muster fir de Säitennumm:', |
1460 | 1446 | 'nuke-nopages-global' => 'Et si keng nei Säiten an de [[Special:RecentChanges|rezenten Ännerungen]].', |
1461 | | - 'nuke-viewchanges' => 'Ännerunge weisen', |
1462 | 1447 | ); |
1463 | 1448 | |
1464 | 1449 | /** Limburgish (Limburgs) |
— | — | @@ -1550,7 +1535,6 @@ |
1551 | 1536 | 'nuke-delete-more' => '[[Special:Nuke|Избриши уште страници]]', |
1552 | 1537 | 'nuke-pattern' => 'Мостра за име на страница:', |
1553 | 1538 | 'nuke-nopages-global' => 'Нема нови страници во [[Special:RecentChanges|скорешните промени]].', |
1554 | | - 'nuke-viewchanges' => 'прикажи промени', |
1555 | 1539 | ); |
1556 | 1540 | |
1557 | 1541 | /** Malayalam (മലയാളം) |
— | — | @@ -1626,7 +1610,6 @@ |
1627 | 1611 | 'nuke-delete-more' => '[[Special:Nuke|Hapuskan lebih banyak laman]]', |
1628 | 1612 | 'nuke-pattern' => 'Pola nama laman:', |
1629 | 1613 | 'nuke-nopages-global' => 'Tiada laman baru dalam [[Special:RecentChanges|perubahan terkini]].', |
1630 | | - 'nuke-viewchanges' => 'lihat perubahan', |
1631 | 1614 | ); |
1632 | 1615 | |
1633 | 1616 | /** Maltese (Malti) |
— | — | @@ -1763,7 +1746,6 @@ |
1764 | 1747 | 'nuke-delete-more' => "[[Special:Nuke|Meer pagina's verwijderen]]", |
1765 | 1748 | 'nuke-pattern' => 'Patroon voor de paginanaam:', |
1766 | 1749 | 'nuke-nopages-global' => "Er zijn geen nieuwe pagina's in de [[Special:RecentChanges|recente wijzigingen]].", |
1767 | | - 'nuke-viewchanges' => 'wijzigingen bekijken', |
1768 | 1750 | ); |
1769 | 1751 | |
1770 | 1752 | /** Norwegian Nynorsk (Norsk (nynorsk)) |
— | — | @@ -1886,7 +1868,6 @@ |
1887 | 1869 | 'nuke-delete-more' => '[[Special:Nuke|Usuń więcej stron]]', |
1888 | 1870 | 'nuke-pattern' => 'Wzór nazwy strony:', |
1889 | 1871 | 'nuke-nopages-global' => 'Brak nowych stron w [[Special:RecentChanges|ostatnich zmianach]].', |
1890 | | - 'nuke-viewchanges' => 'widok zmian', |
1891 | 1872 | ); |
1892 | 1873 | |
1893 | 1874 | /** Piedmontese (Piemontèis) |
— | — | @@ -1917,7 +1898,6 @@ |
1918 | 1899 | 'nuke-delete-more' => "[[Special:Nuke|Scancelé pì 'd pàgine]]", |
1919 | 1900 | 'nuke-pattern' => 'Model për ël nòm ëd pàgina:', |
1920 | 1901 | 'nuke-nopages-global' => "A-i é pa 'd pàgine neuve an [[Special:RecentChanges|ùltime modìfiche]].", |
1921 | | - 'nuke-viewchanges' => 'varda modìfiche', |
1922 | 1902 | ); |
1923 | 1903 | |
1924 | 1904 | /** Pashto (پښتو) |
— | — | @@ -2110,7 +2090,6 @@ |
2111 | 2091 | 'nuke-delete-more' => '[[Special:Nuke|Множественное удаление страниц]]', |
2112 | 2092 | 'nuke-pattern' => 'Шаблон для имени страницы:', |
2113 | 2093 | 'nuke-nopages-global' => 'В [[Special:RecentChanges|недавних изменениях]] нет новых страниц.', |
2114 | | - 'nuke-viewchanges' => 'Внесённые изменения', |
2115 | 2094 | ); |
2116 | 2095 | |
2117 | 2096 | /** Rusyn (Русиньскый) |
— | — | @@ -2251,7 +2230,6 @@ |
2252 | 2231 | 'nuke-delete-more' => '[[Special:Nuke|Izbriši več strani]]', |
2253 | 2232 | 'nuke-pattern' => 'Vzorec imena strani:', |
2254 | 2233 | 'nuke-nopages-global' => 'V [[Special:RecentChanges|zadnjih spremembah]] ni novih strani.', |
2255 | | - 'nuke-viewchanges' => 'ogled sprememb', |
2256 | 2234 | ); |
2257 | 2235 | |
2258 | 2236 | /** Serbian (Cyrillic script) (Српски (ћирилица)) |
— | — | @@ -2580,7 +2558,6 @@ |
2581 | 2559 | 'nuke-delete-more' => '[[Special:Nuke|Xóa thêm trang]]', |
2582 | 2560 | 'nuke-pattern' => 'Mẫu tên trang:', |
2583 | 2561 | 'nuke-nopages-global' => 'Không có trang mới trong các [[Special:RecentChanges|thay đổi gần đây]].', |
2584 | | - 'nuke-viewchanges' => 'xem thay đổi', |
2585 | 2562 | ); |
2586 | 2563 | |
2587 | 2564 | /** Volapük (Volapük) |
Index: trunk/extensions/Nuke/Nuke.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | die( 'Not an entry point.' ); |
6 | 6 | } |
7 | 7 | |
8 | | -define( 'Nuke_VERSION', '1.1.4' ); |
| 8 | +define( 'Nuke_VERSION', '1.1.5' ); |
9 | 9 | |
10 | 10 | $dir = dirname(__FILE__) . '/'; |
11 | 11 | |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | 'path' => __FILE__, |
17 | 17 | 'name' => 'Nuke', |
18 | 18 | 'descriptionmsg' => 'nuke-desc', |
19 | | - 'author' => array( 'Brion Vibber', 'Jeroen De Dauw' ), |
| 19 | + 'author' => array( 'Brion Vibber', 'Jeroen De Dauw', 'Marcin Cieślak' ), |
20 | 20 | 'url' => 'https://www.mediawiki.org/wiki/Extension:Nuke', |
21 | 21 | 'version' => Nuke_VERSION, |
22 | 22 | ); |