r73899 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73898‎ | r73899 | r73900 >
Date:15:22, 28 September 2010
Author:jimbojw
Status:deferred
Tags:
Comment:
Import of ArticleComments v0.2.4 by Jim R. Wilson from http://jimbojw.com/wiki/index.php?title=ArticleComments&oldid=1814
Modified paths:
  • /trunk/extensions/ArticleComments/ArticleComments.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleComments/ArticleComments.php
@@ -130,8 +130,9 @@
131131 */
132132 function wfArticleCommentForm( $title = null, $params = array() ) {
133133
134 - global $wgScript, $wgContLang, $wgArticleCommentDefaults;
135 -
 134+ global $wgScript, $wgArticleCommentDefaults, $wgContentLang, $wgContLang;
 135+ $wcl = ($wgContentLang ? $wgContentLang : $wgContLang);
 136+
136137 # Merge in global defaults if specified
137138 if (is_array($wgArticleCommentDefaults) &&
138139 !empty($wgArticleCommentDefaults)) {
@@ -149,7 +150,7 @@
150151 }
151152
152153 $ac = 'article-comments-';
153 - $formAction = $wgScript.'?title='.$wgContLang->getNsText(NS_SPECIAL).':ProcessComment';
 154+ $formAction = $wgScript.'?title='.$wcl->getNsText(NS_SPECIAL).':ProcessComment';
154155
155156 # Build out the comment form.
156157 $content =
@@ -163,7 +164,7 @@
164165 '<input type="text" id="commenterName" name="commenterName" /></p>'.
165166 ($params['showurlfield']=='false' || $params['showurlfield']===false?'':
166167 '<p>'.wfMsgForContent($ac.'url-field').'<br />'.
167 - '<input type="text" id="commenterURL" name="commenterURL" /></p>'
 168+ '<input type="text" id="commenterURL" name="commenterURL" value="http://" /></p>'
168169 ).
169170 '<p>'.wfMsgForContent($ac.'comment-field').'<br />'.
170171 '<textarea id="comment" name="comment" style="width:30em" rows="5">'.
@@ -290,7 +291,8 @@
291292 */
292293 function specialProcessComment() {
293294
294 - global $wgOut, $wgContLang, $wgParser, $wgUser;
 295+ global $wgOut, $wgParser, $wgUser, $wgContentLang, $wgContLang;
 296+ $wcl = ($wgContentLang ? $wgContentLang : $wgContLang);
295297
296298 # Retrieve submitted values
297299 $titleKey = $_POST['titleKey'];
@@ -381,8 +383,8 @@
382384 }
383385
384386 # Determine signature components
385 - $d = $wgContLang->timeanddate( date( 'YmdHis' ), false, false) . ' (' . date( 'T' ) . ')';
386 - if ($commenterURL) $sigText = "[$commenterURL $commenterName]";
 387+ $d = $wcl->timeanddate( date( 'YmdHis' ), false, false) . ' (' . date( 'T' ) . ')';
 388+ if ($commenterURL && $commenterURL!='http://') $sigText = "[$commenterURL $commenterName]";
387389 else if ($wgUser->isLoggedIn()) $sigText = $wgParser->getUserSig( $wgUser );
388390 else $sigText = $commenterName;
389391

Status & tagging log