From: Andrew Garrett Date: Thu, 23 Nov 2006 09:32:28 +0000 (+0000) Subject: (bug 8013) Add autosummary for new pages with >500 characters. I would merge this... X-Git-Tag: 1.31.0-rc.0~55106 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=a18e46f3344649011fedd3ac1af704c3878bc233;p=lhc%2Fweb%2Fwiklou.git (bug 8013) Add autosummary for new pages with >500 characters. I would merge this with the original short new page autosummary, but this would break current message customisations on other wikis. en.wp comes to mind. --- diff --git a/includes/Article.php b/includes/Article.php index d85a24bee2..515ba40caf 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2712,7 +2712,16 @@ class Article { if ($summary) return $summary; - #New page autosummaries + #Long new page autosummaries + if ($flags & EDIT_NEW && strlen($newtext) > 500) { + #If they're making a new article, give its text, truncated, in the summary. + global $wgContLang; + $truncatedtext = $wgContLang->truncate( $newtext, max( 0, 200 - + strlen( wfMsgForContent( 'autosumm-new') ) ), '...' ); + $summary = wfMsgForContent( 'autosumm-new', $truncatedtext ); + } + + #Short new page autosummaries if ($flags & EDIT_NEW && strlen($newtext) <= 500) { #If they're making a new short article, give its text in the summary. global $wgContLang; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index b3645a735e..a4da4b80a7 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2613,7 +2613,8 @@ Please confirm that really want to recreate this page.', 'autosumm-blank' => 'Removing all content from page', 'autosumm-replace' => 'Replacing page with \'$1\'', 'autoredircomment' => 'Redirecting to [[$1]]', # This should be changed to the new naming convention, but existed beforehand. -'autosumm-shortnew' => 'New page: $1', +'autosumm-shortnew' => 'Short New page: $1', +'autosumm-new' => 'New page: $1', # Autoblock whitelist 'autoblock_whitelist' => '',