X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSpecialWhatlinkshere.php;h=92a4931b45ce961fc0c99319baed3ad08951271e;hb=f597b18c42c488fea7921803358e1f0671190f13;hp=900f9e7db294baefe0edbf5de3ba80bd2d5fe2f1;hpb=cb43ce4e985c83d500c0868d5be4141bfecf2c02;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index 900f9e7db2..92a4931b45 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -27,20 +27,22 @@ function wfSpecialWhatlinkshere($par = NULL) $sk = $wgUser->getSkin(); $isredir = " (" . wfMsg( "isredirect" ) . ")\n"; - $wgOut->addHTML("< ".$sk->makeKnownLinkObj($nt, "", "redirect=no" )."
\n"); - + $wgOut->addHTML("< ".$sk->makeKnownLinkObj($nt, "", "redirect=no" )."
\n"); + $dbr =& wfGetDB( DB_SLAVE ); + extract( $dbr->tableNames( 'cur', 'brokenlinks', 'links' ) ); + if ( 0 == $id ) { - $sql = "SELECT cur_id,cur_namespace,cur_title,cur_is_redirect FROM brokenlinks,cur WHERE bl_to='" . - wfStrencode( $nt->getPrefixedDBkey() ) . "' AND bl_from=cur_id LIMIT $limit"; - $res = wfQuery( $sql, DB_READ, $fname ); + $sql = "SELECT cur_id,cur_namespace,cur_title,cur_is_redirect FROM $brokenlinks,$cur WHERE bl_to='" . + $dbr->strencode( $nt->getPrefixedDBkey() ) . "' AND bl_from=cur_id LIMIT $limit"; + $res = $dbr->query( $sql, $fname ); - if ( 0 == wfNumRows( $res ) ) { + if ( 0 == $dbr->numRows( $res ) ) { $wgOut->addHTML( wfMsg( "nolinkshere" ) ); } else { $wgOut->addHTML( wfMsg( "linkshere" ) ); $wgOut->addHTML( "\n\n" ); - wfFreeResult( $res ); + $dbr->freeResult( $res ); } } else { wfShowIndirectLinks( 0, $id, $limit ); @@ -67,10 +69,13 @@ function wfShowIndirectLinks( $level, $lid, $limit ) global $wgOut, $wgUser; $fname = "wfShowIndirectLinks"; - $sql = "SELECT cur_id,cur_namespace,cur_title,cur_is_redirect FROM links,cur WHERE l_to={$lid} AND l_from=cur_id LIMIT $limit"; - $res = wfQuery( $sql, DB_READ, $fname ); + $dbr =& wfGetDB( DB_READ ); + extract( $dbr->tableNames( 'links','cur' ) ); + + $sql = "SELECT cur_id,cur_namespace,cur_title,cur_is_redirect FROM $links,$cur WHERE l_to={$lid} AND l_from=cur_id LIMIT $limit"; + $res = $dbr->query( $sql, $fname ); - if ( 0 == wfNumRows( $res ) ) { + if ( 0 == $dbr->numRows( $res ) ) { if ( 0 == $level ) { $wgOut->addHTML( wfMsg( "nolinkshere" ) ); } @@ -83,27 +88,27 @@ function wfShowIndirectLinks( $level, $lid, $limit ) $isredir = " (" . wfMsg( "isredirect" ) . ")\n"; $wgOut->addHTML( "