Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1199,10 +1199,20 @@ |
1200 | 1200 | ), |
1201 | 1201 | 'statistics' => array( |
1202 | 1202 | 'statistics', |
1203 | | - 'sitestats', |
1204 | | - 'userstats', |
1205 | | - 'sitestatstext', |
1206 | | - 'userstatstext', |
| 1203 | + 'statistics-header-pages', |
| 1204 | + 'statistics-header-edits', |
| 1205 | + 'statistics-header-views', |
| 1206 | + 'statistics-header-users', |
| 1207 | + 'statistics-articles', |
| 1208 | + 'statistics-pages', |
| 1209 | + 'statistics-files', |
| 1210 | + 'statistics-edits', |
| 1211 | + 'statistics-edits-average', |
| 1212 | + 'statistics-views-total', |
| 1213 | + 'statistics-views-peredit', |
| 1214 | + 'statistics-jobqueue', |
| 1215 | + 'statistics-users', |
| 1216 | + 'statistics-users-active', |
1207 | 1217 | 'statistics-mostpopular', |
1208 | 1218 | 'statistics-footer', |
1209 | 1219 | ), |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -237,7 +237,13 @@ |
238 | 238 | border: 1px dashed #aaa; |
239 | 239 | } |
240 | 240 | |
241 | | -table.mw-listgrouprights-table { |
| 241 | +/* |
| 242 | + * Special:ListGroupRights styling |
| 243 | + * Special:Statistics styling |
| 244 | +*/ |
| 245 | + |
| 246 | +table.mw-listgrouprights-table, |
| 247 | +table.mw-statistics-table { |
242 | 248 | border: 1px solid #ccc; |
243 | 249 | border-collapse: collapse; |
244 | 250 | } |
— | — | @@ -246,11 +252,16 @@ |
247 | 253 | vertical-align: top; |
248 | 254 | } |
249 | 255 | |
250 | | -table.mw-listgrouprights-table td, table.mw-listgrouprights-table th { |
| 256 | +table.mw-listgrouprights-table td, table.mw-listgrouprights-table th, |
| 257 | +table.mw-statistics-table td, table.mw-statistics-table th { |
251 | 258 | padding: 0.5em 0.2em 0.5em 0.2em; |
252 | 259 | border: 1px solid #ccc; |
253 | 260 | } |
254 | 261 | |
| 262 | +td.mw-statistics-numbers { |
| 263 | + text-align: right; |
| 264 | +} |
| 265 | + |
255 | 266 | /* Special:SpecialPages styling */ |
256 | 267 | h4.mw-specialpagesgroup { |
257 | 268 | background-color: #dcdcdc; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1383,7 +1383,7 @@ |
1384 | 1384 | * to ensure that client-side caches don't keep obsolete copies of global |
1385 | 1385 | * styles. |
1386 | 1386 | */ |
1387 | | -$wgStyleVersion = '173'; |
| 1387 | +$wgStyleVersion = '174'; |
1388 | 1388 | |
1389 | 1389 | |
1390 | 1390 | # Server-side caching: |
Index: trunk/phase3/includes/specials/SpecialStatistics.php |
— | — | @@ -14,7 +14,9 @@ |
15 | 15 | * @param mixed $par (not used) |
16 | 16 | */ |
17 | 17 | function wfSpecialStatistics( $par = '' ) { |
18 | | - global $wgOut, $wgLang, $wgRequest; |
| 18 | + global $wgOut, $wgLang, $wgRequest, $wgUser, $wgContLang; |
| 19 | + global $wgDisableCounters, $wgMiserMode, $wgImplicitGroups, $wgGroupPermissions; |
| 20 | + $sk = $wgUser->getSkin(); |
19 | 21 | $dbr = wfGetDB( DB_SLAVE ); |
20 | 22 | |
21 | 23 | $views = SiteStats::views(); |
— | — | @@ -27,70 +29,140 @@ |
28 | 30 | $admins = SiteStats::numberingroup('sysop'); |
29 | 31 | $numJobs = SiteStats::jobs(); |
30 | 32 | |
| 33 | + # Staticic - views |
| 34 | + $viewsStats = ''; |
| 35 | + if( !$wgDisableCounters ) { |
| 36 | + $viewsStats = Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-views' ) ) . |
| 37 | + formatRow( wfMsgExt( 'statistics-views-total', array( 'parseinline' ) ), |
| 38 | + $wgLang->formatNum( $views ) ) . |
| 39 | + formatRow( wfMsgExt( 'statistics-views-peredit', array( 'parseinline' ) ), |
| 40 | + $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ) ); |
| 41 | + } |
| 42 | + |
31 | 43 | if( $wgRequest->getVal( 'action' ) == 'raw' ) { |
| 44 | + # Depreciated, kept for backwards compatibility |
| 45 | + # http://lists.wikimedia.org/pipermail/wikitech-l/2008-August/039202.html |
32 | 46 | $wgOut->disable(); |
33 | 47 | header( 'Pragma: nocache' ); |
34 | 48 | echo "total=$total;good=$good;views=$views;edits=$edits;users=$users;"; |
35 | 49 | echo "activeusers=$activeUsers;admins=$admins;images=$images;jobs=$numJobs\n"; |
36 | 50 | return; |
37 | 51 | } else { |
38 | | - $text = "__NOTOC__\n"; |
39 | | - $text .= '==' . wfMsgNoTrans( 'sitestats' ) . "==\n"; |
40 | | - $text .= wfMsgExt( 'sitestatstext', array( 'parsemag' ), |
41 | | - $wgLang->formatNum( $total ), |
42 | | - $wgLang->formatNum( $good ), |
43 | | - $wgLang->formatNum( $views ), |
44 | | - $wgLang->formatNum( $edits ), |
45 | | - $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ), |
46 | | - $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ), |
47 | | - $wgLang->formatNum( $numJobs ), |
48 | | - $wgLang->formatNum( $images ) |
49 | | - )."\n"; |
| 52 | + $text = Xml::openElement( 'table', array( 'class' => 'mw-statistics-table' ) ) . |
| 53 | + # Statistic - pages |
| 54 | + Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-pages' ) ) . |
| 55 | + formatRow( wfMsgExt( 'statistics-articles', array( 'parseinline' ) ), |
| 56 | + $wgLang->formatNum( $good ) ) . |
| 57 | + formatRow( wfMsgExt( 'statistics-pages', array( 'parseinline' ) ), |
| 58 | + $wgLang->formatNum( $total ) ) . |
| 59 | + formatRow( wfMsgExt( 'statistics-files', array( 'parseinline' ) ), |
| 60 | + $wgLang->formatNum( $images ) ) . |
50 | 61 | |
51 | | - $text .= "==" . wfMsgNoTrans( 'userstats' ) . "==\n"; |
52 | | - $text .= wfMsgExt( 'userstatstext', array ( 'parsemag' ), |
53 | | - $wgLang->formatNum( $users ), |
54 | | - $wgLang->formatNum( $admins ), |
55 | | - '[[' . wfMsgForContent( 'grouppage-sysop' ) . ']]', # TODO somehow remove, kept for backwards compatibility |
56 | | - $wgLang->formatNum( @sprintf( '%.2f', $admins / $users * 100 ) ), |
57 | | - User::makeGroupLinkWiki( 'sysop' ), |
58 | | - $wgLang->formatNum( $activeUsers ) |
59 | | - )."\n"; |
| 62 | + # Statistic - edits |
| 63 | + Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-edits' ) ) . |
| 64 | + formatRow( wfMsgExt( 'statistics-edits', array( 'parseinline' ) ), |
| 65 | + $wgLang->formatNum( $edits ) ) . |
| 66 | + formatRow( wfMsgExt( 'statistics-edits-average', array( 'parseinline' ) ), |
| 67 | + $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ) ) . |
| 68 | + formatRow( wfMsgExt( 'statistics-jobqueue', array( 'parseinline' ) ), |
| 69 | + $wgLang->formatNum( $numJobs ) ) . |
60 | 70 | |
61 | | - global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang; |
62 | | - if( !$wgDisableCounters && !$wgMiserMode ) { |
63 | | - $res = $dbr->select( |
64 | | - 'page', |
65 | | - array( |
66 | | - 'page_namespace', |
67 | | - 'page_title', |
68 | | - 'page_counter', |
69 | | - ), |
70 | | - array( |
71 | | - 'page_is_redirect' => 0, |
72 | | - 'page_counter > 0', |
73 | | - ), |
74 | | - __METHOD__, |
75 | | - array( |
76 | | - 'ORDER BY' => 'page_counter DESC', |
77 | | - 'LIMIT' => 10, |
78 | | - ) |
79 | | - ); |
80 | | - if( $res->numRows() > 0 ) { |
81 | | - $text .= "==" . wfMsgNoTrans( 'statistics-mostpopular' ) . "==\n"; |
82 | | - while( $row = $res->fetchObject() ) { |
83 | | - $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
84 | | - if( $title instanceof Title ) |
85 | | - $text .= '* [[:' . $title->getPrefixedText() . ']] (' . $wgLang->formatNum( $row->page_counter ) . ")\n"; |
| 71 | + # Statistic - users |
| 72 | + Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-users' ) ) . |
| 73 | + formatRow( wfMsgExt( 'statistics-users', array( 'parseinline' ) ), |
| 74 | + $wgLang->formatNum( $users ) ) . |
| 75 | + formatRow( wfMsgExt( 'statistics-users-active', array( 'parseinline' ) ), |
| 76 | + $wgLang->formatNum( $activeUsers ) ); |
| 77 | + |
| 78 | + # Statistic - usergroups |
| 79 | + foreach( $wgGroupPermissions as $group => $permissions ) { |
| 80 | + # Skip generic * and implicit groups |
| 81 | + if ( in_array( $group, $wgImplicitGroups ) || $group == '*' ) { |
| 82 | + continue; |
| 83 | + } |
| 84 | + $groupname = htmlspecialchars( $group ); |
| 85 | + $msg = wfMsg( 'group-' . $groupname ); |
| 86 | + if ( wfEmptyMsg( 'group-' . $groupname, $msg ) || $msg == '' ) { |
| 87 | + $groupnameLocalized = $groupname; |
| 88 | + } else { |
| 89 | + $groupnameLocalized = $msg; |
| 90 | + } |
| 91 | + $msg = wfMsgForContent( 'grouppage-' . $groupname ); |
| 92 | + if ( wfEmptyMsg( 'grouppage-' . $groupname, $msg ) || $msg == '' ) { |
| 93 | + $grouppageLocalized = MWNamespace::getCanonicalName( NS_PROJECT ) . ':' . $groupname; |
| 94 | + } else { |
| 95 | + $grouppageLocalized = $msg; |
| 96 | + } |
| 97 | + $grouppage = $sk->makeLink( $grouppageLocalized, $groupnameLocalized ); |
| 98 | + $grouplink = $sk->link( SpecialPage::getTitleFor( 'Listusers' ), |
| 99 | + wfMsgHtml( 'listgrouprights-members' ), |
| 100 | + array(), |
| 101 | + array( 'group' => $group ), |
| 102 | + 'known' ); |
| 103 | + $text .= formatRow( $grouppage . ' ' . $grouplink, |
| 104 | + $wgLang->formatNum( SiteStats::numberingroup( $groupname ) ) ); |
| 105 | + } |
| 106 | + } |
| 107 | + $text .= $viewsStats; |
| 108 | + |
| 109 | + # Statistic - popular pages |
| 110 | + if( !$wgDisableCounters && !$wgMiserMode ) { |
| 111 | + $res = $dbr->select( |
| 112 | + 'page', |
| 113 | + array( |
| 114 | + 'page_namespace', |
| 115 | + 'page_title', |
| 116 | + 'page_counter', |
| 117 | + ), |
| 118 | + array( |
| 119 | + 'page_is_redirect' => 0, |
| 120 | + 'page_counter > 0', |
| 121 | + ), |
| 122 | + __METHOD__, |
| 123 | + array( |
| 124 | + 'ORDER BY' => 'page_counter DESC', |
| 125 | + 'LIMIT' => 10, |
| 126 | + ) |
| 127 | + ); |
| 128 | + if( $res->numRows() > 0 ) { |
| 129 | + $text .= Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-mostpopular' ) ); |
| 130 | + while( $row = $res->fetchObject() ) { |
| 131 | + $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
| 132 | + if( $title instanceof Title ) { |
| 133 | + $text .= formatRow( $sk->link( $title ), |
| 134 | + $wgLang->formatNum( $row->page_counter ) ); |
| 135 | + |
86 | 136 | } |
87 | | - $res->free(); |
88 | 137 | } |
| 138 | + $res->free(); |
89 | 139 | } |
| 140 | + } |
90 | 141 | |
91 | | - $footer = wfMsgNoTrans( 'statistics-footer' ); |
92 | | - if( !wfEmptyMsg( 'statistics-footer', $footer ) && $footer != '' ) |
93 | | - $text .= "\n" . $footer; |
| 142 | + $text .= Xml::closeElement( 'table' ); |
94 | 143 | |
95 | | - $wgOut->addWikiText( $text ); |
| 144 | + # Customizable footer |
| 145 | + $footer = wfMsgNoTrans( 'statistics-footer' ); |
| 146 | + if( !wfEmptyMsg( 'statistics-footer', $footer ) && $footer != '' ) { |
| 147 | + $text .= "\n" . $footer; |
96 | 148 | } |
| 149 | + |
| 150 | + $wgOut->addHtml( $text ); |
97 | 151 | } |
| 152 | + |
| 153 | +/** |
| 154 | + * Format a row |
| 155 | + * |
| 156 | + * @param string $text description of the row |
| 157 | + * @param float $number a number |
| 158 | + * @return string table row in HTML format |
| 159 | + */ |
| 160 | +function formatRow( $text, $number ) { |
| 161 | + return '<tr> |
| 162 | + <td>' . |
| 163 | + $text . |
| 164 | + '</td> |
| 165 | + <td class="mw-statistics-numbers">' . |
| 166 | + $number . |
| 167 | + '</td> |
| 168 | + </tr>'; |
| 169 | +} |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1918,24 +1918,24 @@ |
1919 | 1919 | 'randomredirect-nopages' => 'There are no redirects in this namespace.', |
1920 | 1920 | |
1921 | 1921 | # Statistics |
1922 | | -'statistics' => 'Statistics', |
1923 | | -'sitestats' => '{{SITENAME}} statistics', |
1924 | | -'userstats' => 'User statistics', |
1925 | | -'sitestatstext' => "There {{PLURAL:\$1|is '''1''' page|are '''\$1''' total pages}} in the database. |
1926 | | -This includes \"talk\" pages, pages about {{SITENAME}}, minimal \"stub\" pages, redirects, and others that probably do not qualify as content pages. |
1927 | | -Excluding those, there {{PLURAL:\$2|is '''1''' page that is a|are '''\$2''' pages that are}} probably legitimate content {{PLURAL:\$2|page|pages}}. |
| 1922 | +'statistics' => 'Statistics', |
| 1923 | +'statistics-header-pages' => 'Page statistics', |
| 1924 | +'statistics-header-edits' => 'Edit statistics', |
| 1925 | +'statistics-header-views' => 'View statistics', |
| 1926 | +'statistics-header-users' => 'User statistics', |
| 1927 | +'statistics-articles' => 'Articles', |
| 1928 | +'statistics-pages' => 'Pages <small>(this includes "talk" pages, pages about {{SITENAME}}, minimal "stub" pages, redirects, and others)</small>', |
| 1929 | +'statistics-files' => 'Uploaded files', |
| 1930 | +'statistics-edits' => 'Page edits since {{SITENAME}} was setup', |
| 1931 | +'statistics-edits-average' => 'Average edits per page', |
| 1932 | +'statistics-views-total' => 'Views total', |
| 1933 | +'statistics-views-peredit' => 'Views per edit', |
| 1934 | +'statistics-jobqueue' => '[http://www.mediawiki.org/wiki/Manual:Job_queue Job queue] length', |
| 1935 | +'statistics-users' => 'Registered [[Special:ListUsers|users]]', |
| 1936 | +'statistics-users-active' => 'Active users', |
| 1937 | +'statistics-mostpopular' => 'Most viewed pages', |
| 1938 | +'statistics-footer' => '', # do not translate or duplicate this message to other languages |
1928 | 1939 | |
1929 | | -'''\$8''' {{PLURAL:\$8|file has|files have}} been uploaded. |
1930 | | - |
1931 | | -There have been a total of '''\$3''' {{PLURAL:\$3|page view|page views}}, and '''\$4''' {{PLURAL:\$4|page edit|page edits}} since {{SITENAME}} was setup. |
1932 | | -That comes to '''\$5''' average edits per page, and '''\$6''' views per edit. |
1933 | | - |
1934 | | -The [http://www.mediawiki.org/wiki/Manual:Job_queue job queue] length is '''\$7'''.", |
1935 | | -'userstatstext' => "There {{PLURAL:$1|is '''1''' registered [[Special:ListUsers|user]]|are '''$1''' registered [[Special:ListUsers|users]]}}, of which '''$2''' (or '''$4%''') {{PLURAL:$2|has|have}} $5 rights. |
1936 | | -There {{PLURAL:$6|is|are}} currently about '''$6''' active registered user {{PLURAL:$6|account|accounts}}.", |
1937 | | -'statistics-mostpopular' => 'Most viewed pages', |
1938 | | -'statistics-footer' => '', # do not translate or duplicate this message to other languages |
1939 | | - |
1940 | 1940 | 'disambiguations' => 'Disambiguation pages', |
1941 | 1941 | 'disambiguations-summary' => '', # do not translate or duplicate this message to other languages |
1942 | 1942 | 'disambiguationspage' => 'Template:disambig', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -116,6 +116,9 @@ |
117 | 117 | * Category counts (e.g. from {{PAGESINCATEGORY:}}) should be more accurate for |
118 | 118 | small categories |
119 | 119 | * After logging in, automatically redirect to wherever you logged in from |
| 120 | +* (bug 5619) Break messages used in Special:Statistics down further |
| 121 | +* (bug 11029) Add link to Special:Listusers?group=sysop etc at |
| 122 | + Special:Statistics |
120 | 123 | |
121 | 124 | === Bug fixes in 1.14 === |
122 | 125 | |