Last modified: 2011-03-13 18:05:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5181, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3181 - Addition of "Link to" link list to upload warning page
Addition of "Link to" link list to upload warning page
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.4.x
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-17 20:10 UTC by Andy Somerville
Modified: 2011-03-13 18:05 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Andy Somerville 2005-08-17 20:10:49 UTC
I added the list of pages which link to the image/file that a person is
attempting to overwrite/revise to provide context that might keep users from
accidentally revising the incorrect file.
Comment 1 Andy Somerville 2005-08-17 20:20:17 UTC
requires that the page title be made as a class member... done here as the
variable "nt" (used because I found it already used in another function... I
just made it a class member.

Didnt include diff because of this file was changed from the 1.4.7 original
which itself is different from the 1.5 version


function uploadWarning( $warning ) {
                ...
                // other code
                ...
                $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) .
"</h2>\n" );

                $dbr =& wfGetDB( DB_SLAVE );
                $page = $dbr->tableName( 'page' );
                $imagelinks = $dbr->tableName( 'imagelinks' );

                $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page
WHERE il_to=" .
                $dbr->addQuotes( $this->nt->getDBkey() ) . " AND il_from=page_id"
                . " LIMIT 500"; # quickie emergency brake
                $res = $dbr->query( $sql, "ImagePage::imageLinks" );

                if ( 0 == $dbr->numRows( $res ) ) {
                        $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) .
"</p>\n" );
                        return;
                }
                $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) .  "</p>\n<ul>" );

                $sk = $wgUser->getSkin();
                while ( $s = $dbr->fetchObject( $res ) ) {
                       $name = Title::MakeTitle( $s->page_namespace,
$s->page_title );
                       $link = $sk->makeKnownLinkObj( $name, "" );
                       $wgOut->addHTML( "<li>{$link}</li>\n<br>\n" );
                }
                $wgOut->addHTML( "</ul>\n" );
                ...
                // other code
Comment 2 Brion Vibber 2006-02-03 06:31:32 UTC
Not sure what this is trying to accomplish.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links