r90106 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90105‎ | r90106 | r90107 >
Date:09:48, 15 June 2011
Author:faurethomas
Status:deferred
Tags:
Comment:
Add a key 'inherit' to create dependances between rooms. Add a key 'email' to totally deactivate email sending. Fix a problem with lock-small.png image.
Modified paths:
  • /trunk/extensions/WikiTweet/WikiTweet.api.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.config.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.functions.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiTweet/WikiTweet.i18n.php
@@ -12,7 +12,7 @@
1313 */
1414 $messages['en'] = array(
1515 'wikitweet-desc' => 'Create a Twitter-like feed into MediaWiki',
16 - 'wikitweet-name' => 'MorphoTweets', // Do not translate, used as pagename
 16+ 'wikitweet-name' => 'WikiTweet', // Do not translate, used as pagename
1717 'wikitweet-pleaselogin' => 'Please login to tweet.',
1818 'wikitweet-moretweets' => 'More tweets...',
1919 'wikitweet-infoajax' => 'uses the AJAX technology and refresh itself every 5 seconds without loading the page.',
Index: trunk/extensions/WikiTweet/WikiTweet.config.php
@@ -10,6 +10,7 @@
1111 'refreshTime' => 15000, // Time to refresh in milliseconds
1212
1313 // SMTP configuration :
 14+ 'email'=> True, // True or False
1415 'SMTP' => array(
1516 'host' => "smtphost", //could also be an IP address
1617 'IDHost' => "idhost",
@@ -47,5 +48,8 @@
4849 'margin_left' => '0px',
4950 ),
5051 ),
 52+ 'inherit' => array(
 53+ 'main' => array('room1','room2','room3')
 54+ )
5155 );
5256 ?>
Index: trunk/extensions/WikiTweet/WikiTweet.functions.php
@@ -13,6 +13,7 @@
1414 }
1515 public static function send( $to, $from, $subject, $body, $replyto=null )
1616 {
 17+ if(!$wgWikiTweet['email']){return false;}
1718 $wgOutputEncoding = 'UTF-8';
1819 $wgEnotifImpersonal = false;
1920 $wgErrorString = '';
Index: trunk/extensions/WikiTweet/WikiTweet.api.php
@@ -115,6 +115,18 @@
116116 $type = $row1->type;
117117 $sql_subscriptions .= " OR `$type`='$link'";
118118 }
 119+ $roomssons = array();
 120+ foreach($wgWikiTweet['inherit'] as $roominherit=>$roominheritvalue)
 121+ {
 122+ if($roominherit == $room or in_array($roominherit,$roomssons))
 123+ {
 124+ foreach($wgWikiTweet['inherit'][$roominherit] as $roomson)
 125+ {
 126+ $sql_subscriptions .= " OR `room`='$roomson'";
 127+ $roomssons[] = $roomson;
 128+ }
 129+ }
 130+ }
119131
120132 if($tag!=''){
121133 $res = $dbr->select(
@@ -164,7 +176,7 @@
165177 }
166178 if ( $show == 2 ) {
167179 $background_color = "#C6DEFE";
168 - $private = "<img src='$wgScriptPath/Extensions/WikiTweet/images/lock-small.png' />";
 180+ $private = "<img src='$wgScriptPath/extensions/WikiTweet/images/lock-small.png' />";
169181 }
170182
171183 $dateSrc = $date.' GMT';
@@ -177,7 +189,7 @@
178190
179191 $conversion_tab = array(
180192 "/\>(\S*)/is" => "><a href='$wgScriptPath/index.php/$1'>$1</a>",
181 - "/\@(\S*)/is" => "@<a href='$wgScriptPath/index.php/User:$1'>$1</a>", // TODO en anglais
 193+ "/\@(\S*)/is" => "@<a href='$wgScriptPath/index.php/User:$1'>$1</a>",
182194 "/\#(\S*)/is" => "<a class='handmouse tag' value='$1'>#$1</a>",
183195 "/http(\S*)/is" => "<a href='http$1' target='_blank'>http$1</a>",
184196 "/ www(\S*)/is" => " <a href='http://www$1' target='_blank'>www$1</a>",
@@ -330,8 +342,7 @@
331343 }
332344
333345 mysql_close();
334 - $o__response = new AjaxResponse($text);
335 - return $o__response;
 346+ return $text;
336347 }
337348 public static function fnSubscribeAjax($link, $user, $type){
338349 $o__text = '';

Sign-offs

UserFlagDate
Faure.thomastested09:52, 15 June 2011

Status & tagging log