r107960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107959‎ | r107960 | r107961 >
Date:23:35, 3 January 2012
Author:bsitu
Status:resolved (Comments)
Tags:
Comment:
Format feedback dashbaord time display to have only the largest time block, fix the response query with possible unbounded result set, fix code style, spacing
Modified paths:
  • /trunk/extensions/MoodBar/MoodBar.hooks.php (modified) (history)
  • /trunk/extensions/MoodBar/MoodBar.i18n.php (modified) (history)
  • /trunk/extensions/MoodBar/MoodBar.php (modified) (history)
  • /trunk/extensions/MoodBar/SpecialFeedbackDashboard.php (modified) (history)
  • /trunk/extensions/MoodBar/include/MoodBarUtil.php (added) (history)
  • /trunk/extensions/MoodBar/sql/mbfr_mbf_mbfr_id_index.sql (added) (history)
  • /trunk/extensions/MoodBar/sql/mbfr_timestamp_id_index.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/include/MoodBarUtil.php
@@ -0,0 +1,70 @@
 2+<?php
 3+
 4+/**
 5+ * Utility class for MoodBar
 6+ */
 7+class MoodBarUtil {
 8+
 9+ /**
 10+ * Calculate the time diff between $time and now, format the time diff to have the largest time block
 11+ * or 'less than 1 minute' if the time diff is less than 1 minute
 12+ * @param $time string - the UNIX time stamp
 13+ * @return string - formatted time string
 14+ */
 15+ public static function formatTimeSince( $time ) {
 16+
 17+ $blocks = array( array( 'total' => 60 * 60 * 24 * 365, 'name' => 'years' ),
 18+ array( 'total' => 60 * 60 * 24 * 30, 'name' => 'months'),
 19+ array( 'total' => 60 * 60 * 24 * 7, 'name' => 'weeks'),
 20+ array( 'total' => 60 * 60 * 24, 'name' => 'days'),
 21+ array( 'total' => 60 * 60, 'name' => 'hours'),
 22+ array( 'total' => 60, 'name' => 'minutes') );
 23+
 24+ $since = wfTimestamp( TS_UNIX ) - $time;
 25+ $displayTime = 0;
 26+ $displayBlock = '';
 27+
 28+ // get the largest time block, 1 minute 35 seconds -> 2 minutes
 29+ for ( $i = 0, $count = count( $blocks ); $i < $count; $i++ ) {
 30+ $seconds = $blocks[$i]['total'];
 31+ $displayTime = floor( $since / $seconds );
 32+
 33+ if ( $displayTime > 0 ) {
 34+ $displayBlock = $blocks[$i]['name'];
 35+ // round up if the remaining time is greater than
 36+ // half of the time unit
 37+ if ( ( $since % $seconds ) >= ( $seconds / 2 ) ) {
 38+ $displayTime++;
 39+
 40+ //advance to upper unit if possible, eg, 24 hours to 1 day
 41+ if ( isset( $blocks[$i-1] ) && $displayTime * $seconds == $blocks[$i-1]['total'] ) {
 42+ $displayTime = 1;
 43+ $displayBlock = $blocks[$i-1]['name'];
 44+ }
 45+
 46+ }
 47+ break;
 48+ }
 49+ }
 50+
 51+ if ( $displayTime > 0 ) {
 52+ global $wgLang;
 53+
 54+ // message key defined in moodbar only
 55+ if ( in_array( $displayBlock, array( 'years', 'months', 'weeks' ) ) ) {
 56+ $messageKey = 'moodbar-' . $displayBlock;
 57+ }
 58+ else {
 59+ $messageKey = $displayBlock;
 60+ }
 61+
 62+ return wfMessage( $messageKey )->inLanguage( $wgLang )
 63+ ->params( $wgLang->formatNum( $displayTime ) )->escaped();
 64+
 65+ } else {
 66+ return wfMessage( 'moodbar-seconds' )->escaped();
 67+ }
 68+
 69+ }
 70+
 71+}
\ No newline at end of file
Property changes on: trunk/extensions/MoodBar/include/MoodBarUtil.php
___________________________________________________________________
Added: svn:eol-style
172 + native
Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php
@@ -71,33 +71,33 @@
7272 public function getMoodBarTypeStats( ) {
7373
7474 global $wgMemc;
75 -
76 - $timestamp = time() - 24 * 60 * 60; // 24 hours ago
 75+
 76+ $timestamp = wfTimestamp( TS_UNIX ) - 24 * 60 * 60; // 24 hours ago
7777
7878 // Try cache first
7979 $key = wfMemcKey( 'moodbar_feedback', 'type_stats', 'last_day' );
8080 $moodbarStat = $wgMemc->get( $key );
81 -
82 - if ( $moodbarStat === false ) {
83 - $dbr = wfGetDB( DB_SLAVE );
84 - $res = $dbr->select( array( 'moodbar_feedback' ),
85 - array( 'mbf_type', 'COUNT(*) AS number' ),
86 - array( 'mbf_hidden_state' => 0, 'mbf_timestamp > ' . $dbr->addQuotes( wfTimestamp( TS_MW, $timestamp ) ) ),
87 - __METHOD__,
88 - array( 'GROUP BY' => 'mbf_type' )
89 - );
90 -
91 - $moodbarStat = array('happy' => 0, 'sad' => 0, 'confused' => 0);
92 -
93 - foreach ( $res as $row ) {
94 - $moodbarStat[$row->mbf_type] = $row->number;
95 - }
96 -
97 - // Cache the results in cache for 1 hour
98 - $wgMemc->set( $key, $moodbarStat, 60 * 60 );
99 - }
100 -
101 - return $moodbarStat;
 81+
 82+ if ( $moodbarStat === false ) {
 83+ $dbr = wfGetDB( DB_SLAVE );
 84+ $res = $dbr->select( array( 'moodbar_feedback' ),
 85+ array( 'mbf_type', 'COUNT(*) AS number' ),
 86+ array( 'mbf_hidden_state' => 0, 'mbf_timestamp > ' . $dbr->addQuotes( wfTimestamp( TS_MW, $timestamp ) ) ),
 87+ __METHOD__,
 88+ array( 'GROUP BY' => 'mbf_type' )
 89+ );
 90+
 91+ $moodbarStat = array( 'happy' => 0, 'sad' => 0, 'confused' => 0 );
 92+
 93+ foreach ( $res as $row ) {
 94+ $moodbarStat[$row->mbf_type] = $row->number;
 95+ }
 96+
 97+ // Cache the results in cache for 1 hour
 98+ $wgMemc->set( $key, $moodbarStat, 60 * 60 );
 99+ }
 100+
 101+ return $moodbarStat;
102102
103103 }
104104
@@ -222,12 +222,8 @@
223223 $typeMsg = wfMessage( "moodbar-type-$type" )->params( $feedbackItem->getProperty('user') )->escaped();
224224
225225 // Timestamp
226 - $now = wfTimestamp( TS_UNIX );
227226 $timestamp = wfTimestamp( TS_UNIX, $feedbackItem->getProperty('timestamp') );
228 - $time = $wgLang->formatTimePeriod( $now - $timestamp,
229 - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true )
230 - );
231 - $timeMsg = wfMessage( 'ago' )->params( $time )->escaped();
 227+ $timeMsg = wfMessage( 'ago' )->params( MoodBarUtil::formatTimeSince( $timestamp ) )->escaped();
232228
233229 // Comment
234230 $comment = htmlspecialchars( $feedbackItem->getProperty('comment') );
@@ -296,40 +292,29 @@
297293 $showResponseBox = true;
298294
299295 //Do not show response box if there is a response already
300 - if ( isset( $response[$id] ) ) {
301 - //for now we only display the latest response
302 - foreach ( $response[$id] AS $response_detail ) {
 296+ if ( isset( $response[$id] ) ) {
 297+ $response_detail = $response[$id];
 298+
 299+ $responder = User::newFromId( $response_detail->mbfr_user_id );
 300+
 301+ if ( $responder && !$responder->isAnon() ) {
 302+ $responsetime = MoodBarUtil::formatTimeSince( wfTimestamp( TS_UNIX, $response_detail->mbfr_timestamp ) );
303303
304 - $responder = User::newFromId( $response_detail->mbfr_user_id );
 304+ $permalinkTitle = $feedbackItem->getProperty('user')->getTalkPage()->getFullText();
305305
306 - if ( !$responder->isAnon() ) {
307 -
308 - $now = wfTimestamp( TS_UNIX );
309 - $responsetimestamp = wfTimestamp( TS_UNIX, $response_detail->mbfr_timestamp );
310 -
311 - $responsetime = $wgLang->formatTimePeriod( $now - $responsetimestamp,
312 - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true )
313 - );
314 -
315 - $permalinkTitle = $feedbackItem->getProperty('user')->getTalkPage()->getFullText();
316 -
317 - $individual_response = wfMsgExt('moodbar-feedback-response-summary', array('parse'),
318 - $responder->getUserPage()->getFullText(),
319 - $responder->getName(),
320 - $permalinkTitle . '#feedback-dashboard-response-' . $response_detail->mbfr_id,
321 - $responsetime);
322 - $showResponseBox = false;
323 -
324 - $responseElements = <<<HTML
325 - <div class="fbd-item-response">
326 - $individual_response
327 - </div>
 306+ $individual_response = wfMsgExt('moodbar-feedback-response-summary', array('parse'),
 307+ $responder->getUserPage()->getFullText(),
 308+ $responder->getName(),
 309+ $permalinkTitle . '#feedback-dashboard-response-' . $response_detail->mbfr_id,
 310+ $responsetime);
 311+ $showResponseBox = false;
 312+
 313+ $responseElements = <<<HTML
 314+ <div class="fbd-item-response">
 315+ $individual_response
 316+ </div>
328317 HTML;
329 - break;
330 -
331 - }
332 - }
333 -
 318+ }
334319 }
335320 //only show response elements if feedback is not hidden, and user is logged in
336321 else if ( $showResponseBox && $feedbackItem->getProperty('hidden-state') == false
@@ -410,15 +395,15 @@
411396
412397 if($feedback_hidden_detail === false) {
413398 $footer = wfMessage('moodbar-hidden-footer-without-log')->
414 - rawParams( $link )->escaped();
 399+ rawParams( $link )->escaped();
415400 }
416401 else {
417402 $footer = wfMessage('moodbar-hidden-footer')->
418 - rawParams( htmlspecialchars( $feedback_hidden_detail->log_user_text ),
419 - $wgLang->date($feedback_hidden_detail->log_timestamp),
420 - $wgLang->time($feedback_hidden_detail->log_timestamp),
421 - htmlspecialchars( $feedback_hidden_detail->log_comment ),
422 - $link )->escaped();
 403+ rawParams( htmlspecialchars( $feedback_hidden_detail->log_user_text ),
 404+ $wgLang->date($feedback_hidden_detail->log_timestamp),
 405+ $wgLang->time($feedback_hidden_detail->log_timestamp),
 406+ htmlspecialchars( $feedback_hidden_detail->log_comment ),
 407+ $link )->escaped();
423408 }
424409
425410 return Xml::tags( 'div', array( 'class' => 'error' ), $footer );
@@ -673,49 +658,64 @@
674659 */
675660 protected static function getFeedbackHiddenDetail( $mbf_id ) {
676661 $dbr = wfGetDB( DB_SLAVE );
677 -
678 - return $dbr->selectRow( array( 'logging' ),
679 - array( 'log_user_text', 'log_timestamp', 'log_comment' ),
680 - array( 'log_namespace' => NS_SPECIAL,
681 - 'log_title' => 'FeedbackDashboard/' . intval( $mbf_id ),
682 - 'log_action' => 'hide',
683 - 'log_type' => 'moodbar' ),
684 - __METHOD__,
685 - array( 'LIMIT' => 1, 'ORDER BY' => "log_timestamp DESC" )
 662+
 663+ return $dbr->selectRow( array( 'logging' ),
 664+ array( 'log_user_text', 'log_timestamp', 'log_comment' ),
 665+ array( 'log_namespace' => NS_SPECIAL,
 666+ 'log_title' => 'FeedbackDashboard/' . intval( $mbf_id ),
 667+ 'log_action' => 'hide',
 668+ 'log_type' => 'moodbar' ),
 669+ __METHOD__,
 670+ array( 'LIMIT' => 1, 'ORDER BY' => "log_timestamp DESC" )
686671 );
687672 }
688673
689674 /**
690 - * Get the response summary for a set of feedback
 675+ * Get the latest response summary for a set of feedback,
691676 * @param $res Iterator of Db row with index mbf_id for feedback
692677 * @return array
693678 */
694679 public static function getResponseSummary( $res ) {
695680 $dbr = wfGetDB( DB_SLAVE );
696 -
 681+
697682 $feedback = array();
698 -
 683+
699684 foreach ( $res as $row ) {
700 - $feedback[] = $row->mbf_id;
 685+ $feedback[] = $row->mbf_id;
701686 }
702 -
 687+
703688 $response = array();
704 -
 689+
705690 if ( count( $feedback ) > 0 ) {
 691+ // query to get the latest mbfr_id for each mbfr_mbf_id
706692 $res = $dbr->select( array( 'moodbar_feedback_response' ),
707 - array( 'mbfr_id', 'mbfr_mbf_id', 'mbfr_user_id', 'mbfr_timestamp' ),
708 - array( 'mbfr_mbf_id' => $feedback, 'mbfr_user_id != 0' ),
709 - __METHOD__,
710 - array( 'ORDER BY' => "mbfr_mbf_id DESC, mbfr_timestamp DESC, mbfr_id DESC" )
711 - );
712 -
713 - foreach ( $res AS $row ) {
714 - $response[$row->mbfr_mbf_id][] = $row;
715 - }
 693+ array( 'MAX(mbfr_id) AS latest_mbfr_id' ),
 694+ array( 'mbfr_mbf_id' => $feedback, 'mbfr_user_id != 0' ),
 695+ __METHOD__,
 696+ array( 'GROUP BY' => "mbfr_mbf_id" )
 697+ );
 698+
 699+ $mbfrId = array();
 700+
 701+ foreach ( $res as $row ) {
 702+ $mbfrId[] = $row->latest_mbfr_id;
 703+ }
 704+
 705+ // get the detail for each mbfr_id
 706+ if ( count( $mbfrId ) > 0 ) {
 707+ $res = $dbr->select( array( 'moodbar_feedback_response' ),
 708+ array( 'mbfr_id', 'mbfr_mbf_id', 'mbfr_user_id', 'mbfr_timestamp' ),
 709+ array( 'mbfr_id' => $mbfrId ),
 710+ __METHOD__
 711+ );
 712+
 713+ foreach ( $res as $row ) {
 714+ $response[$row->mbfr_mbf_id] = $row;
 715+ }
 716+ }
716717 }
717 -
718 -
 718+
719719 return $response;
720720 }
721721
722 -}
 722+}
\ No newline at end of file
Index: trunk/extensions/MoodBar/MoodBar.i18n.php
@@ -20,6 +20,11 @@
2121 'tooltip-p-moodbar-trigger-feedback' => '',
2222 'tooltip-p-moodbar-trigger-share' => '',
2323 'tooltip-p-moodbar-trigger-editing' => '',
 24+ // Time format
 25+ 'moodbar-weeks' => '{{PLURAL:$1|$1 week|$1 weeks}}',
 26+ 'moodbar-months' => '{{PLURAL:$1|$1 month|$1 months}}',
 27+ 'moodbar-years' => '{{PLURAL:$1|$1 year|$1 years}}',
 28+ 'moodbar-seconds' => 'less than 1 minute',
2429 // Overlay
2530 'moodbar-close' => '(close)',
2631 'moodbar-intro-feedback' => 'Editing $1 made me...',
Index: trunk/extensions/MoodBar/MoodBar.hooks.php
@@ -137,8 +137,14 @@
138138 $updater->addExtensionIndex( 'moodbar_feedback', 'mbf_timestamp_id', "$dir/mbf_timestamp_id.sql" );
139139 $updater->addExtensionField( 'moodbar_feedback', 'mbf_hidden_state', "$dir/mbf_hidden_state.sql" );
140140 $updater->addExtensionTable( 'moodbar_feedback_response', "$dir/moodbar_feedback_response.sql" );
141 - $updater->addExtensionIndex( 'moodbar_feedback_response', 'mbfr_timestamp_id', "$dir/mbfr_timestamp_id_index.sql" );
142 -
 141+ $updater->addExtensionUpdate( array(
 142+ 'dropIndex',
 143+ 'moodbar_feedback_response',
 144+ 'mbfr_timestamp_id',
 145+ "$dir/mbfr_timestamp_id_index.sql", true
 146+ ) );
 147+ $updater->addExtensionIndex( 'moodbar_feedback_response', 'mbfr_mbf_mbfr_id', "$dir/mbfr_mbf_mbfr_id_index.sql" );
 148+
143149 return true;
144150 }
145151
Index: trunk/extensions/MoodBar/sql/mbfr_mbf_mbfr_id_index.sql
@@ -0,0 +1 @@
 2+CREATE INDEX /*i*/mbfr_mbf_mbfr_id ON /*_*/moodbar_feedback_response (mbfr_mbf_id, mbfr_id);
Property changes on: trunk/extensions/MoodBar/sql/mbfr_mbf_mbfr_id_index.sql
___________________________________________________________________
Added: svn:eol-style
13 + native
Index: trunk/extensions/MoodBar/sql/mbfr_timestamp_id_index.sql
@@ -1,2 +1 @@
2 -
3 -CREATE INDEX /*i*/mbfr_timestamp_id ON /*_*/moodbar_feedback_response (mbfr_mbf_id, mbfr_timestamp, mbfr_id);
 2+DROP INDEX /*i*/mbfr_timestamp_id ON /*_*/moodbar_feedback_response;
Index: trunk/extensions/MoodBar/MoodBar.php
@@ -13,29 +13,32 @@
1414 'path' => __FILE__,
1515 );
1616
 17+$moodBarDir = dirname(__FILE__) . '/';
 18+
1719 // Object model
18 -$wgAutoloadClasses['MBFeedbackItem'] = dirname(__FILE__).'/FeedbackItem.php';
19 -$wgAutoloadClasses['MBFeedbackResponseItem'] = dirname(__FILE__).'/FeedbackResponseItem.php';
20 -$wgAutoloadClasses['MWFeedbackResponseItemPropertyException'] = dirname(__FILE__).'/FeedbackResponseItem.php';
21 -$wgAutoloadClasses['MoodBarFormatter'] = dirname(__FILE__).'/Formatter.php';
22 -$wgAutoloadClasses['MoodBarHTMLEmailNotification'] = dirname(__FILE__).'/include/MoodBarHTMLEmailNotification.php';
23 -$wgAutoloadClasses['MoodBarHTMLMailerJob'] = dirname( __FILE__ ) . '/include/MoodBarHTMLMailerJob.php';
 20+$wgAutoloadClasses['MBFeedbackItem'] = $moodBarDir . 'FeedbackItem.php';
 21+$wgAutoloadClasses['MBFeedbackResponseItem'] = $moodBarDir . 'FeedbackResponseItem.php';
 22+$wgAutoloadClasses['MWFeedbackResponseItemPropertyException'] = $moodBarDir . 'FeedbackResponseItem.php';
 23+$wgAutoloadClasses['MoodBarFormatter'] = $moodBarDir . 'Formatter.php';
 24+$wgAutoloadClasses['MoodBarHTMLEmailNotification'] = $moodBarDir . 'include/MoodBarHTMLEmailNotification.php';
 25+$wgAutoloadClasses['MoodBarHTMLMailerJob'] = $moodBarDir . 'include/MoodBarHTMLMailerJob.php';
 26+$wgAutoloadClasses['MoodBarUtil'] = $moodBarDir . 'include/MoodBarUtil.php';
2427
2528 // API
26 -$wgAutoloadClasses['ApiMoodBar'] = dirname(__FILE__).'/ApiMoodBar.php';
 29+$wgAutoloadClasses['ApiMoodBar'] = $moodBarDir . 'ApiMoodBar.php';
2730 $wgAPIModules['moodbar'] = 'ApiMoodBar';
28 -$wgAutoloadClasses['ApiQueryMoodBarComments'] = dirname( __FILE__ ). '/ApiQueryMoodBarComments.php';
 31+$wgAutoloadClasses['ApiQueryMoodBarComments'] = $moodBarDir . 'ApiQueryMoodBarComments.php';
2932 $wgAPIListModules['moodbarcomments'] = 'ApiQueryMoodBarComments';
30 -$wgAutoloadClasses['ApiFeedbackDashboard'] = dirname(__FILE__).'/ApiFeedbackDashboard.php';
 33+$wgAutoloadClasses['ApiFeedbackDashboard'] = $moodBarDir . 'ApiFeedbackDashboard.php';
3134 $wgAPIModules['feedbackdashboard'] = 'ApiFeedbackDashboard';
32 -$wgAutoloadClasses['ApiFeedbackDashboardResponse'] = dirname(__FILE__).'/ApiFeedbackDashboardResponse.php';
 35+$wgAutoloadClasses['ApiFeedbackDashboardResponse'] = $moodBarDir . 'ApiFeedbackDashboardResponse.php';
3336 $wgAPIModules['feedbackdashboardresponse'] = 'ApiFeedbackDashboardResponse';
34 -$wgAutoloadClasses['ApiMoodBarSetUserEmail'] = dirname(__FILE__).'/ApiMoodBarSetUserEmail.php';
35 -$wgAutoloadClasses['MWApiMoodBarSetUserEmailInvalidActionException'] = dirname(__FILE__).'/ApiMoodBarSetUserEmail.php';
 37+$wgAutoloadClasses['ApiMoodBarSetUserEmail'] = $moodBarDir . 'ApiMoodBarSetUserEmail.php';
 38+$wgAutoloadClasses['MWApiMoodBarSetUserEmailInvalidActionException'] = $moodBarDir . 'ApiMoodBarSetUserEmail.php';
3639 $wgAPIModules['moodbarsetuseremail'] = 'ApiMoodBarSetUserEmail';
3740
3841 // Hooks
39 -$wgAutoloadClasses['MoodBarHooks'] = dirname(__FILE__).'/MoodBar.hooks.php';
 42+$wgAutoloadClasses['MoodBarHooks'] = $moodBarDir . 'MoodBar.hooks.php';
4043 $wgHooks['BeforePageDisplay'][] = 'MoodBarHooks::onPageDisplay';
4144 $wgHooks['ResourceLoaderGetConfigVars'][] = 'MoodBarHooks::resourceLoaderGetConfigVars';
4245 $wgHooks['MakeGlobalVariablesScript'][] = 'MoodBarHooks::makeGlobalVariablesScript';
@@ -43,12 +46,12 @@
4447 $wgHooks['onMarkItemAsHelpful'][] = 'MoodBarHooks::onMarkItemAsHelpful';
4548
4649 // Special pages
47 -$wgAutoloadClasses['SpecialMoodBar'] = dirname(__FILE__).'/SpecialMoodBar.php';
 50+$wgAutoloadClasses['SpecialMoodBar'] = $moodBarDir . 'SpecialMoodBar.php';
4851 $wgSpecialPages['MoodBar'] = 'SpecialMoodBar';
49 -$wgAutoloadClasses['SpecialFeedbackDashboard'] = dirname( __FILE__ ) . '/SpecialFeedbackDashboard.php';
 52+$wgAutoloadClasses['SpecialFeedbackDashboard'] = $moodBarDir . 'SpecialFeedbackDashboard.php';
5053 $wgSpecialPages['FeedbackDashboard'] = 'SpecialFeedbackDashboard';
5154
52 -$dashboardFormsPath = dirname(__FILE__) . '/DashboardForms.php';
 55+$dashboardFormsPath = $moodBarDir . 'DashboardForms.php';
5356 $wgAutoloadClasses['MBDashboardForm'] = $dashboardFormsPath;
5457 $wgAutoloadClasses['MBActionForm'] = $dashboardFormsPath;
5558 $wgAutoloadClasses['MBHideForm'] = $dashboardFormsPath;
@@ -72,12 +75,12 @@
7376 $wgGroupPermissions['sysop']['moodbar-admin'] = true;
7477
7578 // Internationalisation
76 -$wgExtensionMessagesFiles['MoodBar'] = dirname(__FILE__).'/MoodBar.i18n.php';
77 -$wgExtensionMessagesFiles['MoodBarAliases'] = dirname( __FILE__ ) . '/MoodBar.alias.php';
 79+$wgExtensionMessagesFiles['MoodBar'] = $moodBarDir . 'MoodBar.i18n.php';
 80+$wgExtensionMessagesFiles['MoodBarAliases'] = $moodBarDir . 'MoodBar.alias.php';
7881
7982 // Resources
8083 $mbResourceTemplate = array(
81 - 'localBasePath' => dirname(__FILE__) . '/modules',
 84+ 'localBasePath' => $moodBarDir . 'modules',
8285 'remoteExtPath' => 'MoodBar/modules'
8386 );
8487

Follow-up revisions

RevisionCommit summaryAuthorDate
r107961follow up to -107960 - remove the extra space before $moodBarDirbsitu23:40, 3 January 2012
r107984follow up to -r107960 - remove index mbfr_timestamp_id from moodbar_feedback_...bsitu01:35, 4 January 2012
r108058followup to -r107960 - Add documentation to new messagesbsitu17:46, 4 January 2012
r108061followup to -r107960 - remove unnecessary language function call and update t...bsitu18:20, 4 January 2012

Comments

#Comment by Raymond (talk | contribs)   08:17, 4 January 2012

Please add message documentation for the newly added messages. Thanks.

#Comment by Catrope (talk | contribs)   12:53, 4 January 2012
+			return wfMessage( $messageKey )->inLanguage( $wgLang )

Using ->inLanguage( $wgLang ) is completely unnecessary, $wgLang is the default language by definition.

+						array( 'mbf_hidden_state' => 0, 'mbf_timestamp > ' . $dbr->addQuotes( wfTimestamp( TS_MW, $timestamp ) ) ),

Don't use TS_MW for timestamps in SQL, use $db->timestamp( $timestamp ) instead. It so happens these are equivalent for MySQL.

OK otherwise.

#Comment by Catrope (talk | contribs)   18:50, 4 January 2012

Why is this tagged scaptrap?

Marking OK, tagging todo for the message documentation.

Status & tagging log