errorpage( "notargettitle", "notargettext" ); return; } $nt = Title::newFromURL( $target ); $wgOut->setPagetitle( $nt->getPrefixedText() ); $wgOut->setSubtitle( wfMsg( "linklistsub" ) ); $id = $nt->getArticleID(); $sk = $wgUser->getSkin(); $isredir = " (" . wfMsg( "isredirect" ) . ")\n"; if ( 0 == $id ) { $sql = "SELECT DISTINCT bl_from FROM brokenlinks WHERE bl_to='" . wfStrencode( $nt->getPrefixedDBkey() ) . "' LIMIT 500"; $res = wfQuery( $sql, $fname ); if ( 0 == wfNumRows( $res ) ) { $wgOut->addHTML( wfMsg( "nolinkshere" ) ); } else { $wgOut->addHTML( wfMsg( "linkshere" ) ); $wgOut->addHTML( "\n\n" ); wfFreeResult( $res ); } } else { wfShowIndirectLinks( 0, $id ); } } function wfShowIndirectLinks( $level, $lid ) { global $wgOut, $wgUser; $fname = "wfShowIndirectLinks"; $sql = "SELECT DISTINCT l_from FROM links WHERE l_to={$lid} LIMIT 500"; $res = wfQuery( $sql, $fname ); if ( 0 == wfNumRows( $res ) ) { if ( 0 == $level ) { $wgOut->addHTML( wfMsg( "nolinkshere" ) ); } return; } if ( 0 == $level ) { $wgOut->addHTML( wfMsg( "linkshere" ) ); } $sk = $wgUser->getSkin(); $isredir = " (" . wfMsg( "isredirect" ) . ")\n"; $wgOut->addHTML( "\n" ); } ?>