plaintext copyright notice. Patch by Juliano F. Ravasi.
* (bug 15551) Deletion log excerpt is now shown whenever a user vists a
deleted page, even if they are unable to edit it.
+* Added Wantedfiles special pages, allowing users to find image links with no image.
=== Bug fixes in 1.14 ===
'UserrightsPage' => 'includes/specials/SpecialUserrights.php',
'UsersPager' => 'includes/specials/SpecialListusers.php',
'WantedCategoriesPage' => 'includes/specials/SpecialWantedcategories.php',
+ 'WantedFilesPage' => 'includes/specials/SpecialWantedfiles.php',
'WantedPagesPage' => 'includes/specials/SpecialWantedpages.php',
'WhatLinksHerePage' => 'includes/specials/SpecialWhatlinkshere.php',
'WikiImporter' => 'includes/specials/SpecialImport.php',
'Deadendpages' => 'maintenance',
'Wantedpages' => 'maintenance',
'Wantedcategories' => 'maintenance',
+ 'Wantedfiles' => 'maintenance',
'Unwatchedpages' => 'maintenance',
'Fewestrevisions' => 'maintenance',
array( 'UnusedCategoriesPage', 'Unusedcategories' ),
array( 'UnusedimagesPage', 'Unusedimages' ),
array( 'WantedCategoriesPage', 'Wantedcategories' ),
+ array( 'WantedFilesPage', 'Wantedfiles' ),
array( 'WantedPagesPage', 'Wantedpages' ),
array( 'UnwatchedPagesPage', 'Unwatchedpages' ),
array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
'Statistics' => array( 'SpecialPage', 'Statistics' ),
'Randompage' => 'Randompage',
'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ),
- 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
+ 'Un7izedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),
'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ),
'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ),
'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ),
'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ),
+ 'Wantedfiles' => array( 'SpecialPage', 'Wantedfiles' ),
'Mostlinked' => array( 'SpecialPage', 'Mostlinked' ),
'Mostlinkedcategories' => array( 'SpecialPage', 'Mostlinkedcategories' ),
'Mostlinkedtemplates' => array( 'SpecialPage', 'Mostlinkedtemplates' ),
--- /dev/null
+<?php
+/*
+ * @file
+ * @ingroup SpecialPage
+ */
+
+/**
+ * Querypage that lists the most wanted files - implements Special:Wantedfiles
+ *
+ * @ingroup SpecialPage
+ *
+ * @author Soxred93 <soxred93@gmail.com>
+ * @copyright Copyright © 2008, Soxred93
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
+ */
+class WantedFilesPage extends QueryPage {
+
+ function getName() {
+ return 'Wantedfiles';
+ }
+
+ function isExpensive() {
+ return true;
+ }
+
+ function isSyndicated() {
+ return false;
+ }
+
+ function getSQL() {
+ $dbr = wfGetDB( DB_SLAVE );
+ list( $imagelinks, $page ) = $dbr->tableNamesN( 'imagelinks', 'page' );
+ $name = $dbr->addQuotes( $this->getName() );
+ return
+ "
+ SELECT
+ $name as type,
+ " . NS_IMAGE . " as namespace,
+ il_to as title,
+ COUNT(*) as value
+ FROM $imagelinks
+ LEFT JOIN $page ON il_to = page_title AND page_namespace = ". NS_IMAGE ."
+ WHERE page_title IS NULL
+ GROUP BY il_to
+ ";
+ }
+
+ function sortDescending() { return true; }
+
+ /**
+ * Fetch user page links and cache their existence
+ */
+ function preprocessResults( $db, $res ) {
+ $batch = new LinkBatch;
+ while ( $row = $db->fetchObject( $res ) )
+ $batch->add( $row->namespace, $row->title );
+ $batch->execute();
+
+ // Back to start for display
+ if ( $db->numRows( $res ) > 0 )
+ // If there are no rows we get an error seeking.
+ $db->dataSeek( $res, 0 );
+ }
+
+ function formatResult( $skin, $result ) {
+ global $wgLang, $wgContLang;
+
+ $nt = Title::makeTitle( $result->namespace, $result->title );
+ $text = $wgContLang->convert( $nt->getText() );
+
+ $plink = $this->isCached() ?
+ $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
+ $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
+
+ $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
+ $wgLang->formatNum( $result->value ) );
+ return wfSpecialList($plink, $nlinks);
+ }
+}
+
+/**
+ * constructor
+ */
+function wfSpecialWantedFiles() {
+ list( $limit, $offset ) = wfCheckLimits();
+
+ $wpp = new WantedFilesPage();
+
+ $wpp->doQuery( $offset, $limit );
+}
'Unusedimages' => array( 'UnusedImages' ),
'Wantedpages' => array( 'WantedPages', 'BrokenLinks' ),
'Wantedcategories' => array( 'WantedCategories' ),
+ 'Wantedfiles' => array( 'WantedFiles' ),
'Missingfiles' => array( 'MissingFiles', 'MissingImages' ),
'Mostlinked' => array( 'MostLinked' ),
'Mostlinkedcategories' => array( 'MostLinkedCategories', 'MostUsedCategories' ),
'popularpages-summary' => '', # do not translate or duplicate this message to other languages
'wantedcategories' => 'Wanted categories',
'wantedcategories-summary' => '', # do not translate or duplicate this message to other languages
+'wantedfiles' => 'Wanted files',
+'wantedfiles-summary' => '', # do not translate or duplicate this message to other languages
'wantedpages' => 'Wanted pages',
'wantedpages-summary' => '', # do not translate or duplicate this message to other languages
'missingfiles' => 'Missing files',
'uncategorizedtemplates-summary',
'popularpages-summary',
'wantedcategories-summary',
+ 'wantedfiles-summary',
'wantedpages-summary',
'mostlinked-summary',
'mostlinkedcategories-summary',
'wantedcategories-summary',
'wantedpages',
'wantedpages-summary',
+ 'wantedfiles',
+ 'wantedfiles-summary',
'missingfiles',
'missingfiles-summary',
'mostlinked',