Last modified: 2011-03-13 18:05:57 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.
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
Not sure what this is trying to accomplish.