If local language's magicwords list is incomplete, try fetching it from the English one
[lhc/web/wiklou.git] / includes / SpecialUnusedimages.php
index 284394c..09075f5 100644 (file)
@@ -1,9 +1,7 @@
-<?
+<?php
 
-function wfSpecialUnusedimages()
-{
+function wfSpecialUnusedimages() {
        global $wgUser, $wgOut, $wgLang, $wgTitle;
-       global $limit, $offset; # From query string
        $fname = "wfSpecialUnusedimages";
 
        list( $limit, $offset ) = wfCheckLimits();
@@ -11,7 +9,7 @@ function wfSpecialUnusedimages()
        $sql = "SELECT img_name,img_user,img_user_text,img_timestamp,img_description " .
          "FROM image LEFT JOIN imagelinks ON img_name=il_to WHERE il_to IS NULL " .
          "ORDER BY img_timestamp LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();
 
@@ -21,14 +19,14 @@ function wfSpecialUnusedimages()
 
        $sl = wfViewPrevNext( $offset, $limit,
          $wgLang->specialPage( "Unusedimages" ) );
-       $wgOut->addHTML( "<br>{$sl}\n" );
+       $wgOut->addHTML( "<br />{$sl}</p>\n" );
 
        $ins = $wgLang->getNsText ( 6 ) ;
-       $s = "<ol start=" . ( $offset + 1 ) . ">";
+       $s = "<ol start='" . ( $offset + 1 ) . "'>";
        while ( $obj = wfFetchObject( $res ) ) {
                $name = $obj->img_name;
                $dlink = $sk->makeKnownLink( "{$ins}:{$name}", wfMsg( "imgdesc" ) );
-               $ilink = "<a href=\"" . wfImageUrl( $name ) . "\">{$name}</a>";
+               $ilink = "<a href=\"" . Image::wfImageUrl( $name ) . "\">{$name}</a>";
 
                $d = $wgLang->timeanddate( $obj->img_timestamp, true );
                $u = $obj->img_user;
@@ -44,9 +42,9 @@ function wfSpecialUnusedimages()
                $s .= "</li>\n";
        }
        wfFreeResult( $res );
-       $s .= "</ol>";
+       $s .= "</ol>\n\n";
        $wgOut->addHTML( $s );
-       $wgOut->addHTML( "<p>{$sl}\n" );
+       $wgOut->addHTML( "<p>{$sl}</p>\n" );
 }
 
 ?>