Index: branches/REL1_5/phase3/includes/SpecialMostlinked.php |
— | — | @@ -0,0 +1,69 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * |
| 5 | + * @package MediaWiki |
| 6 | + * @subpackage SpecialPage |
| 7 | + */ |
| 8 | + |
| 9 | +require_once ( 'QueryPage.php' ) ; |
| 10 | + |
| 11 | +/** |
| 12 | + * |
| 13 | + * @package MediaWiki |
| 14 | + * @subpackage SpecialPage |
| 15 | + */ |
| 16 | +class MostlinkedPage extends QueryPage { |
| 17 | + |
| 18 | + function getName() { |
| 19 | + return 'Mostlinked'; |
| 20 | + } |
| 21 | + |
| 22 | + function isExpensive() { |
| 23 | + return true; |
| 24 | + } |
| 25 | + function isSyndicated() { return false; } |
| 26 | + |
| 27 | + function getSQL() { |
| 28 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 29 | + extract( $dbr->tableNames( 'pagelinks', 'page' ) ); |
| 30 | + return |
| 31 | + "SELECT 'Mostlinked' AS type, |
| 32 | + pl_namespace AS namespace, |
| 33 | + pl_title AS title, |
| 34 | + COUNT(*) AS value, |
| 35 | + page_namespace |
| 36 | + FROM $pagelinks |
| 37 | + LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title |
| 38 | + GROUP BY pl_namespace,pl_title |
| 39 | + HAVING COUNT(*) > 1"; |
| 40 | + } |
| 41 | + |
| 42 | + function formatResult( $skin, $result ) { |
| 43 | + global $wgContLang; |
| 44 | + |
| 45 | + $nt = Title::makeTitle( $result->namespace, $result->title ); |
| 46 | + $text = $wgContLang->convert( $nt->getPrefixedText() ); |
| 47 | + if ( is_null( $result->page_namespace ) ) |
| 48 | + $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), $text ); |
| 49 | + else |
| 50 | + $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text ); |
| 51 | + |
| 52 | + $nl = wfMsg( "nlinks", $result->value ); |
| 53 | + $nlink = $skin->makeKnownLink( $wgContLang->specialPage( "Whatlinkshere" ), $nl, "target=" . $nt->getPrefixedURL() ); |
| 54 | + |
| 55 | + return "{$plink} ({$nlink})"; |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +/** |
| 60 | + * constructor |
| 61 | + */ |
| 62 | +function wfSpecialMostlinked() { |
| 63 | + list( $limit, $offset ) = wfCheckLimits(); |
| 64 | + |
| 65 | + $wpp = new MostlinkedPage(); |
| 66 | + |
| 67 | + $wpp->doQuery( $offset, $limit ); |
| 68 | +} |
| 69 | + |
| 70 | +?> |
Property changes on: branches/REL1_5/phase3/includes/SpecialMostlinked.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 71 | + native |
Added: svn:keywords |
2 | 72 | + Author Date Id Revision |
Index: branches/REL1_5/phase3/includes/QueryPage.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | array( 'UncategorizedPagesPage', 'Uncategorizedpages'), |
31 | 31 | array( 'UnusedimagesPage', 'Unusedimages' ), |
32 | 32 | array( 'WantedPagesPage', 'Wantedpages' ), |
| 33 | + array( 'MostlinkedPage', 'Mostlinked' ), |
33 | 34 | ); |
34 | 35 | |
35 | 36 | global $wgDisableCounters; |
Index: branches/REL1_5/phase3/RELEASE-NOTES |
— | — | @@ -649,6 +649,7 @@ |
650 | 650 | * (bug 3092) Wrong numerical separator for big numbers in Serbian. |
651 | 651 | * (bug 2855) Credit for a uniq author showed its realname even with |
652 | 652 | $wgAllowRealName=false. |
| 653 | +* New special page: SpecialMostlinked |
653 | 654 | |
654 | 655 | === Caveats === |
655 | 656 | |
Index: branches/REL1_5/phase3/languages/Language.php |
— | — | @@ -1123,6 +1123,7 @@ |
1124 | 1124 | 'popularpages' => 'Popular pages', |
1125 | 1125 | 'nviews' => '$1 views', |
1126 | 1126 | 'wantedpages' => 'Wanted pages', |
| 1127 | +'mostlinked' => 'Most linked to pages', |
1127 | 1128 | 'nlinks' => '$1 links', |
1128 | 1129 | 'allpages' => 'All pages', |
1129 | 1130 | 'randompage' => 'Random page', |