API: Requesting a token you aren't allowed to request no longer dies with an error...
[lhc/web/wiklou.git] / includes / SpecialNewimages.php
index 72b169b..6f59ecb 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- *
- * @addtogroup SpecialPage
+ * @file
+ * @ingroup SpecialPage
  */
 
 /**
@@ -135,10 +135,9 @@ function wfSpecialNewimages( $par, $specialPage ) {
                $ut = $s->img_user_text;
 
                $nt = Title::newFromText( $name, NS_IMAGE );
-               $img = new Image( $nt );
                $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
 
-               $gallery->add( $img, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );
+               $gallery->add( $nt, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );
 
                $timestamp = wfTimestamp( TS_MW, $s->img_timestamp );
                if( empty( $firstTimestamp ) ) {
@@ -176,8 +175,9 @@ function wfSpecialNewimages( $par, $specialPage ) {
                $botpar='';
        }
        $now = wfTimestampNow();
-       $date = $wgLang->timeanddate( $now, true );
-       $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar );
+       $d = $wgLang->date( $now, true );
+       $t = $wgLang->time( $now, true );
+       $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'sp-newimages-showfrom', $d, $t ), 'from='.$now.$botpar.$searchpar );
 
        $botLink = $sk->makeKnownLinkObj($titleObj, wfMsgHtml( 'showhidebots', ($hidebots ? wfMsgHtml('show') : wfMsgHtml('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar);
 
@@ -201,8 +201,6 @@ function wfSpecialNewimages( $par, $specialPage ) {
                if ($shownav)
                        $wgOut->addHTML( $prevnext );
        } else {
-               $wgOut->addWikiText( wfMsg( 'noimages' ) );
+               $wgOut->addWikiMsg( 'noimages' );
        }
 }
-
-?>