1) omit "N Image:Bla.jpg" entry from Recent Changes for file uploads
authorErik Moeller <erik@users.mediawiki.org>
Thu, 24 Mar 2005 13:13:08 +0000 (13:13 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Thu, 24 Mar 2005 13:13:08 +0000 (13:13 +0000)
2) wikify page titles in log entries which appear in RC

includes/Image.php
includes/LogPage.php
includes/SpecialLog.php

index 4269464..57d31db 100644 (file)
@@ -41,7 +41,8 @@ class Image
         */
        function Image( $name, $recache = false ) {
 
-               global $wgUseSharedUploads, $wgUseLatin1, $wgSharedLatin1, $wgLang, $wgMemc, $wgDBname;
+               global $wgUseSharedUploads, $wgUseLatin1, $wgSharedLatin1, $wgLang, $wgMemc, $wgDBname,
+                      $wgSharedUploadDBname;
 
                $this->name      = $name;
                $this->title     = Title::makeTitleSafe( NS_IMAGE, $this->name );
@@ -811,7 +812,7 @@ function wfRecordUpload( $name, $oldver, $size, $desc, $copyStatus = '', $source
 
                if ( $id == 0 ) {
                        $article = new Article( $descTitle );
-                       $article->insertNewArticle( $textdesc, $desc, false, false );
+                       $article->insertNewArticle( $textdesc, $desc, false, false, true );
                }
        } else {
                # Collision, this is an update of an image
index 0684f84..eeec52f 100644 (file)
@@ -141,7 +141,7 @@ class LogPage {
        /**
         * @static
         */
-       function actionText( $type, $action, $titleLink = NULL, $params = array() ) {
+       function actionText( $type, $action, $titleLink = NULL, $params = array(), $filterWikilinks=false ) {
                static $actions = array(
                        'block/block' => 'blocklogentry',
                        'block/unblock' => 'unblocklogentry',
@@ -158,17 +158,22 @@ class LogPage {
                $key = "$type/$action";
                if( isset( $actions[$key] ) ) {
                        if( is_null( $titleLink ) ) {
-                               return wfMsgForContent( $actions[$key] );
+                               $rv=wfMsgForContent( $actions[$key] );
                        } elseif ( count( $params ) == 0 ) {
-                               return wfMsgForContent( $actions[$key], $titleLink );
+                               $rv=wfMsgForContent( $actions[$key], $titleLink );
                        } else {
                                array_unshift( $params, $titleLink );
-                               return wfMsgReal( $actions[$key], $params, true, true );
+                               $rv=wfMsgReal( $actions[$key], $params, true, true );
                        }
                } else {
                        wfDebug( "LogPage::actionText - unknown action $key\n" );
-                       return "$action $titleLink";
+                       $rv="$action $titleLink";
                }
+               if($filterWikilinks) {
+                       $rv=str_replace("[[","",$rv);
+                       $rv=str_replace("]]","",$rv);
+               }
+               return $rv;
        }
 
        /**
index a7c01e5..f7df7c5 100644 (file)
@@ -260,7 +260,7 @@ class LogViewer {
                $comment = $this->skin->commentBlock( $s->log_comment );
                $paramArray = LogPage::extractParams( $s->log_params );
                
-               $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray );
+               $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray, true );
                $out = "<li>$time $userLink $action $comment</li>\n";
                return $out;
        }