From: Erik Moeller Date: Thu, 24 Mar 2005 13:13:08 +0000 (+0000) Subject: 1) omit "N Image:Bla.jpg" entry from Recent Changes for file uploads X-Git-Tag: 1.5.0alpha1~535 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=fc8bdb46f4327656e3c83644bfd7f1efadf6bfe0;p=lhc%2Fweb%2Fwiklou.git 1) omit "N Image:Bla.jpg" entry from Recent Changes for file uploads 2) wikify page titles in log entries which appear in RC --- diff --git a/includes/Image.php b/includes/Image.php index 4269464c0b..57d31dbb98 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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 diff --git a/includes/LogPage.php b/includes/LogPage.php index 0684f8463f..eeec52fc5d 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -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; } /** diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index a7c01e5dce..f7df7c5a50 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -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 = "
  • $time $userLink $action $comment
  • \n"; return $out; }