Index: trunk/extensions/CategoryStepper/CategoryStepper.php |
— | — | @@ -57,7 +57,8 @@ |
58 | 58 | function efCategoryStepper( $out, $text ) { |
59 | 59 | |
60 | 60 | // Get various variables needed for this extension. |
61 | | - global $wgCategoryStepper, $wgTitle, $wgArticlePath, $wgRequest, $IP, $wgOut; |
| 61 | + global $wgCategoryStepper, $wgTitle, $wgArticlePath, $wgRequest, $IP, |
| 62 | + $wgUser, $wgOut; |
62 | 63 | |
63 | 64 | // Only render on the actual view page; not edit, delete etc. |
64 | 65 | if( $wgRequest->getBool( 'action' ) ) return true; |
— | — | @@ -105,16 +106,16 @@ |
106 | 107 | |
107 | 108 | // Get the title of the element before this. |
108 | 109 | if( $prevI ) { |
109 | | - $row = $dbr->fetchRow( $dbr->select( "page", "page_title", array( "page_id" => $prevI ) ) ); |
110 | | - $previous = Xml::element( "a", array( "href" => str_replace( "$1", $row[ 'page_title' ], $wgArticlePath ) ), str_replace( "_", ' ', $row[ 'page_title' ] ) ); |
| 110 | + $prevtitle = Title::newFromId( $prevI ); |
| 111 | + $previous = $wgUser->getSkin()->makeKnownLinkObj( $prevtitle ); |
111 | 112 | } else { |
112 | 113 | $previous = Xml::element( "span", array( "style" => "font-style:italic;" ), wfMsg( "categorystepper-start" ) ); |
113 | 114 | } |
114 | 115 | |
115 | 116 | // Get the title of the element after this. |
116 | 117 | if( $nextI ) { |
117 | | - $row = $dbr->fetchRow( $dbr->select( "page", "page_title", array( "page_id" => $nextI ) ) ); |
118 | | - $next = Xml::element( "a", array( "href" => str_replace( "$1", $row[ 'page_title' ], $wgArticlePath ) ), str_replace( "_", ' ', $row[ 'page_title' ] ) ); |
| 118 | + $nexttitle = Title::newFromId( $nextI ); |
| 119 | + $next = $wgUser->getSkin()->makeKnownLinkObj( $nexttitle ); |
119 | 120 | } else { |
120 | 121 | $next = Xml::element( "span", array( "style" => "font-style:italic;" ), wfMsg( "categorystepper-end" ) ); |
121 | 122 | } |