r49144 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49143‎ | r49144 | r49145 >
Date:20:24, 2 April 2009
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: cleanup & documentation to UserBoard functions
Modified paths:
  • /trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php
@@ -16,51 +16,70 @@
1717 /* private */ function __construct() {
1818 }
1919
 20+ /**
 21+ * Sends a user board message to another user
 22+ *
 23+ * @param $user_id_from Integer: user ID of the sender
 24+ * @param $user_name_from Mixed: user name of the sender
 25+ * @param $user_id_to Integer: user ID of the reciever
 26+ * @param $user_name_to Mixed: user name of the reciever
 27+ * @param $message Mixed: message text
 28+ * @param $message_type Integer: 0 for public message
 29+ * @return Integer: the inserted value of ub_id row
 30+ */
2031 public function sendBoardMessage( $user_id_from, $user_name_from, $user_id_to, $user_name_to, $message, $message_type = 0 ){
2132 $dbw = wfGetDB( DB_MASTER );
2233
23 - $user_name_from = stripslashes($user_name_from);
24 - $user_name_to = stripslashes($user_name_to);
 34+ $user_name_from = stripslashes( $user_name_from );
 35+ $user_name_to = stripslashes( $user_name_to );
2536
2637 $dbw->insert( 'user_board',
27 - array(
28 - 'ub_user_id_from' => $user_id_from,
29 - 'ub_user_name_from' => $user_name_from,
30 - 'ub_user_id' => $user_id_to,
31 - 'ub_user_name' => $user_name_to,
32 - 'ub_message' => $message,
33 - 'ub_type' => $message_type,
34 - 'ub_date' => date("Y-m-d H:i:s"),
35 - ), __METHOD__
 38+ array(
 39+ 'ub_user_id_from' => $user_id_from,
 40+ 'ub_user_name_from' => $user_name_from,
 41+ 'ub_user_id' => $user_id_to,
 42+ 'ub_user_name' => $user_name_to,
 43+ 'ub_message' => $message,
 44+ 'ub_type' => $message_type,
 45+ 'ub_date' => date("Y-m-d H:i:s"),
 46+ ),
 47+ __METHOD__
3648 );
3749
3850 // Send Email (if user is not writing on own board)
3951 if( $user_id_from != $user_id_to ){
40 - $this->sendBoardNotificationEmail($user_id_to, $user_name_from);
41 - $this->incNewMessageCount($user_id_to);
 52+ $this->sendBoardNotificationEmail( $user_id_to, $user_name_from );
 53+ $this->incNewMessageCount( $user_id_to );
4254 }
4355
44 - $stats = new UserStatsTrack($user_id_to, $user_name_to);
 56+ $stats = new UserStatsTrack( $user_id_to, $user_name_to );
4557 if( $message_type == 0 ){
4658 // public message count
47 - $stats->incStatField('user_board_count');
 59+ $stats->incStatField( 'user_board_count' );
4860 } else {
4961 // private message count
50 - $stats->incStatField('user_board_count_priv');
 62+ $stats->incStatField( 'user_board_count_priv' );
5163 }
5264
53 - $stats = new UserStatsTrack($user_id_from, $user_name_from);
54 - $stats->incStatField('user_board_sent');
 65+ $stats = new UserStatsTrack( $user_id_from, $user_name_from );
 66+ $stats->incStatField( 'user_board_sent' );
5567
5668 return $dbw->insertId();
5769 }
5870
 71+ /**
 72+ * Sends an email to a user if someone wrote on their board
 73+ *
 74+ * @param $user_id_to Integer: user ID of the reciever
 75+ * @param $user_from Mixed: the user name of the person who wrote the board message
 76+ */
5977 public function sendBoardNotificationEmail( $user_id_to, $user_from ){
6078 wfLoadExtensionMessages( 'SocialProfileUserBoard' );
6179
62 - $user = User::newFromId($user_id_to);
 80+ $user = User::newFromId( $user_id_to );
6381 $user->loadFromId();
6482
 83+ // Send email if user's email is confirmed and s/he's opted in to recieving social notifications
6584 if( $user->isEmailConfirmed() && $user->getIntOption( 'notifymessage', 1 ) ){
6685 $board_link = SpecialPage::getTitleFor( 'UserBoard' );
6786 $update_profile_link = SpecialPage::getTitleFor( 'UpdateProfile' );
@@ -86,7 +105,7 @@
87106 static function clearNewMessageCount( $user_id ){
88107 global $wgMemc;
89108 $key = wfMemcKey( 'user', 'newboardmessage', $user_id );
90 - $wgMemc->set($key, 0);
 109+ $wgMemc->set( $key, 0 );
91110 }
92111
93112 static function getNewMessageCountCache( $user_id ){
@@ -109,23 +128,29 @@
110129 //$s = $dbw->selectRow( 'user_board', array( 'count(*) AS count' ), array( 'ug_user_id_to' => $user_id, 'ug_status' => 1 ), __METHOD__ );
111130 //if ( $s !== false )$new_gift_count = $s->count;
112131
113 - $wgMemc->set($key, $new_count);
 132+ $wgMemc->set( $key, $new_count );
114133
115134 return $new_count;
116135 }
117136
118137 static function getNewMessageCount( $user_id ){
119138 global $wgMemc;
120 - $data = self::getNewMessageCountCache($user_id);
 139+ $data = self::getNewMessageCountCache( $user_id );
121140
122141 if( $data != '' ){
123142 $count = $data;
124143 } else {
125 - $count = self::getNewMessageCountDB($user_id);
 144+ $count = self::getNewMessageCountDB( $user_id );
126145 }
127146 return $count;
128147 }
129148
 149+ /**
 150+ * Checks if the user with ID number $user_id owns the board message with the ID number $ub_id
 151+ * @param $user_id Integer: user ID number
 152+ * @param $ub_id Integer: user board message ID number
 153+ * @return Boolean: true if user owns the message, otherwise false
 154+ */
130155 public function doesUserOwnMessage( $user_id, $ub_id ){
131156 $dbw = wfGetDB( DB_MASTER );
132157 $s = $dbw->selectRow( 'user_board', array( 'ub_user_id' ), array( 'ub_id' => $ub_id ), __METHOD__ );
@@ -137,6 +162,10 @@
138163 return false;
139164 }
140165
 166+ /**
 167+ * Deletes a user board message from the database
 168+ * @param $ub_id Integer: ID number of the board message that we want to delete
 169+ */
141170 public function deleteMessage( $ub_id ){
142171 if( $ub_id ){
143172 $dbw = wfGetDB( DB_MASTER );
@@ -145,11 +174,11 @@
146175
147176 $dbw->delete( 'user_board', array( 'ub_id' => $ub_id ), __METHOD__ );
148177
149 - $stats = new UserStatsTrack($s->ub_user_id, $s->ub_user_name);
 178+ $stats = new UserStatsTrack( $s->ub_user_id, $s->ub_user_name );
150179 if( $s->ub_type == 0 ){
151 - $stats->decStatField('user_board_count');
 180+ $stats->decStatField( 'user_board_count' );
152181 } else {
153 - $stats->decStatField('user_board_count_priv');
 182+ $stats->decStatField( 'user_board_count_priv' );
154183 }
155184 }
156185 }
@@ -221,8 +250,7 @@
222251 }
223252 $sql = "SELECT count(*) AS the_count
224253 FROM ".$wgDBprefix."user_board
225 - WHERE {$user_sql}
226 - ";
 254+ WHERE {$user_sql}";
227255
228256 $res = $dbr->query($sql);
229257 $row = $dbr->fetchObject( $res );
@@ -233,14 +261,15 @@
234262 }
235263
236264 public function displayMessages( $user_id, $user_id_2 = 0, $count = 10, $page = 0 ){
237 - global $wgUser, $max_link_text_length, $wgTitle;
 265+ global $wgUser, $wgTitle;
 266+
238267 $output = ''; // Prevent E_NOTICE
239 - $messages = $this->getUserBoardMessages($user_id, $user_id_2, $count, $page);
 268+ $messages = $this->getUserBoardMessages( $user_id, $user_id_2, $count, $page );
240269 wfLoadExtensionMessages( 'SocialProfileUserBoard' );
241270 if( $messages ) {
242271
243272 foreach( $messages as $message ) {
244 - $user = Title::makeTitle( NS_USER, $message['user_name_from'] );
 273+ $user = Title::makeTitle( NS_USER, $message['user_name_from'] );
245274 $avatar = new wAvatar( $message['user_id_from'], 'm' );
246275
247276 $board_to_board = '';
@@ -249,8 +278,8 @@
250279 $delete_link = '';
251280
252281 if( $wgUser->getName() != $message['user_name_from'] ){
253 - $board_to_board = "<a href=\"" . UserBoard::getUserBoardToBoardURL($message['user_name'], $message['user_name_from'])."\">" . wfMsgHtml( 'userboard_board-to-board' ) . "</a>";
254 - $board_link = "<a href=\"" . UserBoard::getUserBoardURL($message['user_name_from'])."\">" . wfMsgHtml( 'userboard_sendmessage', $message["user_name_from"] ) . "</a>";
 282+ $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $message['user_name'], $message['user_name_from'] ) . '">' . wfMsgHtml( 'userboard_board-to-board' ) . '</a>';
 283+ $board_link = '<a href="' . UserBoard::getUserBoardURL( $message['user_name_from'] ) . '">' . wfMsgHtml( 'userboard_sendmessage', $message['user_name_from'] ) . '</a>';
255284 }
256285 if( $wgUser->getName() == $message['user_name'] ){
257286 $delete_link = "<span class=\"user-board-red\">
@@ -261,7 +290,7 @@
262291 $message_type_label = '(' . wfMsgHtml( 'userboard_private' ) . ')';
263292 }
264293
265 - $max_link_text_length = 50;
 294+ #$max_link_text_length = 50;
266295 $message_text = $message['message_text'];
267296 #$message_text = preg_replace_callback( "/(<a[^>]*>)(.*?)(<\/a>)/i",'cut_link_text',$message["message_text"]);
268297
@@ -289,9 +318,9 @@
290319 </div>";
291320 }
292321 } else if( $wgUser->getName() == $wgTitle->getText() ) {
293 - $output .= '<div class="no-info-container">
294 - ' . wfMsgHtml( 'userboard_nomessages' ) . '
295 - </div>';
 322+ $output .= '<div class="no-info-container">'
 323+ . wfMsgHtml( 'userboard_nomessages' ) .
 324+ '</div>';
296325
297326 }
298327 return $output;
@@ -304,21 +333,25 @@
305334
306335 static function getUserBoardURL( $user_name ){
307336 $title = SpecialPage::getTitleFor( 'UserBoard' );
308 - $user_name = str_replace("&", "%26", $user_name);
309 - return $title->escapeFullURL('user='.$user_name);
 337+ $user_name = str_replace( '&', '%26', $user_name );
 338+ return $title->escapeFullURL( 'user=' . $user_name );
310339 }
311340
312341 static function getUserBoardToBoardURL( $user_name_1, $user_name_2 ){
313342 $title = SpecialPage::getTitleFor( 'UserBoard' );
314 - $user_name_1 = str_replace("&", "%26", $user_name_1);
315 - $user_name_2 = str_replace("&", "%26", $user_name_2);
316 - return $title->escapeFullURL('user='.$user_name_1.'&conv='.$user_name_2);
 343+ $user_name_1 = str_replace( '&', '%26', $user_name_1 );
 344+ $user_name_2 = str_replace( '&', '%26', $user_name_2 );
 345+ return $title->escapeFullURL( 'user=' . $user_name_1 . '&conv=' . $user_name_2 );
317346 }
318347
319 - public function dateDiff( $dt1, $dt2 ) {
320 - $date1 = $dt1; //(strtotime($dt1) != -1) ? strtotime($dt1) : $dt1;
321 - $date2 = $dt2; //(strtotime($dt2) != -1) ? strtotime($dt2) : $dt2;
322 -
 348+ /**
 349+ * Gets the difference between two given dates
 350+ *
 351+ * @param $dt1 Mixed: current time, as returned by PHP's time() function
 352+ * @param $dt2 Mixed: date
 353+ * @return Difference between dates
 354+ */
 355+ public function dateDiff( $date1, $date2 ) {
323356 $dtDiff = $date1 - $date2;
324357
325358 $totalDays = intval($dtDiff/(24*60*60));
@@ -333,21 +366,27 @@
334367 }
335368
336369 public function getTimeOffset( $time, $timeabrv, $timename ){
 370+ $timeStr = '';
337371 if( $time[$timeabrv] > 0 ){
338 - $timeStr = $time[$timeabrv] . " " . $timename;
339 - if( $time[$timeabrv] > 1 ) $timeStr .= "s";
 372+ $timeStr = $time[$timeabrv] . ' ' . $timename;
 373+ if( $time[$timeabrv] > 1 ) $timeStr .= 's';
340374 }
341 - if( $timeStr ) $timeStr .= " ";
 375+ if( $timeStr ) $timeStr .= ' ';
342376 return $timeStr;
343377 }
344378
 379+ /**
 380+ * Gets the time how long ago the given board message was posted
 381+ * @param $time
 382+ * @return $timeStr Mixed: time, such as "20 days" or "11 hours"
 383+ */
345384 public function getTimeAgo( $time ){
346385 $timeArray = $this->dateDiff( time(), $time );
347386 $timeStr = '';
348 - $timeStrD = $this->getTimeOffset($timeArray, 'd', 'day');
349 - $timeStrH = $this->getTimeOffset($timeArray, 'h', 'hour');
350 - $timeStrM = $this->getTimeOffset($timeArray, 'm', 'minute');
351 - $timeStrS = $this->getTimeOffset($timeArray, 's', 'second');
 387+ $timeStrD = $this->getTimeOffset( $timeArray, 'd', 'day' );
 388+ $timeStrH = $this->getTimeOffset( $timeArray, 'h', 'hour' );
 389+ $timeStrM = $this->getTimeOffset( $timeArray, 'm', 'minute' );
 390+ $timeStrS = $this->getTimeOffset( $timeArray, 's', 'second' );
352391 $timeStr = $timeStrD;
353392 if( $timeStr < 2 ){
354393 $timeStr.= $timeStrH;
Index: trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php
@@ -36,19 +36,18 @@
3737 $wgOut->addStyle( '../..' . $wgUserBoardScripts . '/UserBoard.css' );
3838
3939 $ub_messages_show = 25;
40 - $output = '';
41 - $user_name = $wgRequest->getVal('user');
42 - $user_name_2 = $wgRequest->getVal('conv');
 40+ $user_name = $wgRequest->getVal( 'user' );
 41+ $user_name_2 = $wgRequest->getVal( 'conv' );
4342 $user_id_2 = ''; // Prevent E_NOTICE
44 - $page = $wgRequest->getVal('page');
 43+ $page = $wgRequest->getVal( 'page' );
4544
4645 /**
4746 * Redirect Non-logged in users to Login Page
4847 * It will automatically return them to the UserBoard page
4948 */
5049 if( $wgUser->getID() == 0 && $user_name == '' ){
51 - $login = SpecialPage::getTitleFor( 'UserLogin' );
52 - $wgOut->redirect( $login->getFullURL() . "&returnto=Special:UserBoard" );
 50+ $login = SpecialPage::getTitleFor( 'Userlogin' );
 51+ $wgOut->redirect( $login->getFullURL() . '&returnto=Special:UserBoard' );
5352 return false;
5453 }
5554
@@ -56,21 +55,21 @@
5756 * If no user is set in the URL, we assume its the current user
5857 */
5958 if( !$user_name ) $user_name = $wgUser->getName();
60 - $user_id = User::idFromName($user_name);
 59+ $user_id = User::idFromName( $user_name );
6160 $user = Title::makeTitle( NS_USER, $user_name );
62 - $user_safe = str_replace("&", "%26", $user_name);
 61+ $user_safe = str_replace( '&', '%26', $user_name );
6362
6463 if( $user_name_2 ){
65 - $user_id_2 = User::idFromName($user_name_2);
 64+ $user_id_2 = User::idFromName( $user_name_2 );
6665 $user_2 = Title::makeTitle( NS_USER, $user_name );
67 - $user_safe_2 = urlencode($user_name_2);
 66+ $user_safe_2 = urlencode( $user_name_2 );
6867 }
6968
7069 /**
7170 * Error message for username that does not exist (from URL)
7271 */
7372 if( $user_id == 0 ){
74 - $wgOut->showErrorPage('error', 'userboard_noexist');
 73+ $wgOut->showErrorPage( 'error', 'userboard_noexist' );
7574 return false;
7675 }
7776
@@ -78,40 +77,40 @@
7978 * Config for the page
8079 */
8180 $per_page = $ub_messages_show;
82 - if( !$page || !is_numeric($page) ) $page = 1;
 81+ if( !$page || !is_numeric( $page ) ) $page = 1;
8382
8483 $b = new UserBoard();
85 - $ub_messages = $b->getUserBoardMessages($user_id, $user_id_2, $ub_messages_show, $page);
 84+ $ub_messages = $b->getUserBoardMessages( $user_id, $user_id_2, $ub_messages_show, $page );
8685
8786 if( !$user_id_2 ){
88 - $stats = new UserStats($user_id, $user_name);
 87+ $stats = new UserStats( $user_id, $user_name );
8988 $stats_data = $stats->getUserStats();
9089 $total = $stats_data['user_board'];
9190 if( $wgUser->getName() == $user_name ) $total = $total+$stats_data['user_board_priv'];
9291 } else {
93 - $total = $b->getUserBoardToBoardCount($user_id, $user_id_2);
 92+ $total = $b->getUserBoardToBoardCount( $user_id, $user_id_2 );
9493 }
9594
9695 if( !$user_id_2 ){
9796 if( !( $wgUser->getName() == $user_name ) ) {
98 - $wgOut->setPagetitle( wfMsg('userboard_owner', $user_name) );
 97+ $wgOut->setPageTitle( wfMsg( 'userboard_owner', $user_name ) );
9998 } else {
10099 $b->clearNewMessageCount( $wgUser->getID() );
101 - $wgOut->setPagetitle( wfMsg('userboard_yourboard') );
 100+ $wgOut->setPageTitle( wfMsg( 'userboard_yourboard' ) );
102101 }
103102 } else {
104103 if ( $wgUser->getName() == $user_name ) {
105 - $wgOut->setPagetitle( wfMsg('userboard_yourboardwith', $user_name_2) );
 104+ $wgOut->setPageTitle( wfMsg( 'userboard_yourboardwith', $user_name_2 ) );
106105 } else {
107 - $wgOut->setPagetitle( wfMsg('userboard_otherboardwith', $user_name, $user_name_2) );
 106+ $wgOut->setPageTitle( wfMsg( 'userboard_otherboardwith', $user_name, $user_name_2 ) );
108107 }
109108 }
110109
111 - $output .= '<div class="user-board-top-links">';
112 - $output .= "<a href=\"{$user->escapeFullURL()}\">&lt; " . wfMsg('userboard_backprofile', $user_name) . "</a>";
113 - $output .= "</div>";
114 - $output .= "<script>/*<![CDATA[*/
115 - var _DELETE_CONFIRM = \"" . wfMsg('userboard_confirmdelete') . "\"
 110+ $output = '<div class="user-board-top-links">';
 111+ $output .= '<a href="' . $user->escapeFullURL() . '">&lt; ' . wfMsg( 'userboard_backprofile', $user_name ) . '</a>';
 112+ $output .= '</div>';
 113+ $output .= "<script type=\"text/javascript\">/*<![CDATA[*/
 114+ var _DELETE_CONFIRM = \"" . wfMsg( 'userboard_confirmdelete' ) . "\"
116115 var posted = 0;
117116 function send_message(){
118117 if(\$(\"message\").value && !posted){
@@ -160,17 +159,17 @@
161160 if( $page == 1 ){
162161 $start = 1;
163162 } else {
164 - $start = ($page-1) * $per_page + 1;
 163+ $start = ( $page - 1 ) * $per_page + 1;
165164 }
166 - $end = $start + ( count($ub_messages) ) - 1;
 165+ $end = $start + ( count( $ub_messages ) ) - 1;
167166
168167 if( $wgUser->getName() != $user_name ){
169 - $board_to_board = "<a href=\"" . UserBoard::getUserBoardToBoardURL( $wgUser->getName(), $user_name )."\">" .wfMsg( 'userboard_boardtoboard' ) . "</a>";
 168+ $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $wgUser->getName(), $user_name ). '">' .wfMsg( 'userboard_boardtoboard' ) . '</a>';
170169 }
171170
172171 if( $total ){
173 - $output .= "<div class=\"user-page-message-top\">
174 - <span class=\"user-page-message-count\" style=\"font-size:11px;color:#666666;\">" . wfMsg( 'userboard_showingmessages', $total, $start, $end, $end - $start + 1 ) . ".</span> {$board_to_board}</span>
 172+ $output .= '<div class="user-page-message-top">
 173+ <span class="user-page-message-count" style="font-size:11px;color:#666666;">' . wfMsg( 'userboard_showingmessages', $total, $start, $end, $end - $start + 1 ) . ".</span> {$board_to_board}</span>
175174 </div>";
176175 }
177176
@@ -183,7 +182,7 @@
184183 if( $numofpages > 1 ){
185184 $output .= '<div class="page-nav">';
186185 if( $page > 1 ){
187 - $output .= "<a href=\"".$wgScriptPath."/index.php?title=Special:UserBoard&user={$user_safe}&page=" . ($page-1) . "{$qs}\">" . wfMsg('userboard_prevpage') . "</a>";
 186+ $output .= "<a href=\"".$wgScriptPath."/index.php?title=Special:UserBoard&user={$user_safe}&page=" . ($page-1) . "{$qs}\">" . wfMsg( 'userboard_prevpage' ) . '</a>';
188187 }
189188
190189 if( ($total % $per_page) != 0 ) $numofpages++;
@@ -194,14 +193,14 @@
195194
196195 for( $i = 1; $i <= $numofpages; $i++ ){
197196 if( $i == $page ){
198 - $output .= ($i." ");
 197+ $output .= ($i." ");
199198 } else {
200 - $output .= "<a href=\"".$wgScriptPath."/index.php?title=Special:UserBoard&user={$user_safe}&page=$i{$qs}\">$i</a> ";
 199+ $output .= '<a href="' . $wgScriptPath . "/index.php?title=Special:UserBoard&user={$user_safe}&page=$i{$qs}\">$i</a> ";
201200 }
202201 }
203202
204203 if( ($total - ($per_page * $page)) > 0 ){
205 - $output .= " <a href=\"".$wgScriptPath."/index.php?title=Special:UserBoard&user={$user_safe}&page=" . ($page+1) . "{$qs}\">" . wfMsg('userboard_nextpage') . "</a>";
 204+ $output .= ' <a href="' . $wgScriptPath . "/index.php?title=Special:UserBoard&user={$user_safe}&page=" . ($page+1) . "{$qs}\">" . wfMsg( 'userboard_nextpage' ) . '</a>';
206205 }
207206 $output .= '</div><p>';
208207 }
@@ -226,7 +225,7 @@
227226 }
228227 if( $wgUser->isBlocked() ){
229228 // only let them post to admins
230 - $user_to = User::newFromId($user_id);
 229+ $user_to = User::newFromId( $user_id );
231230 $user_to->loadFromId();
232231 //if( !$user_to->isAllowed('delete') ){
233232 $can_post = false;
@@ -270,21 +269,21 @@
271270 $ub_message_type_label = '';
272271 $delete_link = '';
273272 if( $wgUser->getName() != $ub_message['user_name_from'] ){
274 - $board_to_board = "<a href=\"" . UserBoard::getUserBoardToBoardURL($user_name, $ub_message['user_name_from'])."\">" . wfMsg('userboard_boardtoboard') . "</a>";
275 - $board_link = "<a href=\"" . UserBoard::getUserBoardURL($ub_message['user_name_from'])."\">" . wfMsg( 'userboard_sendmessage', $ub_message['user_name_from'] ) . "</a>";
 273+ $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $user_name, $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_boardtoboard' ) . '</a>';
 274+ $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_sendmessage', $ub_message['user_name_from'] ) . '</a>';
276275 } else {
277 - $board_link = "<a href=\"" . UserBoard::getUserBoardURL($ub_message['user_name_from'])."\">" . wfMsg('userboard_myboard') . "</a>";
 276+ $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_myboard' ) . '</a>';
278277 }
279278 if( $wgUser->getName() == $ub_message['user_name'] ){
280279 $delete_link = "<span class=\"user-board-red\">
281 - <a href=\"javascript:void(0);\" onclick=\"javascript:delete_message({$ub_message["id"]})\">" . wfMsg('userboard_delete') . "</a>
 280+ <a href=\"javascript:void(0);\" onclick=\"javascript:delete_message({$ub_message["id"]})\">" . wfMsg( 'userboard_delete' ) . "</a>
282281 </span>";
283282 }
284283 if( $ub_message['type'] == 1 ){
285 - $ub_message_type_label = "(" . wfMsg('userboard_private') . ")";
 284+ $ub_message_type_label = '(' . wfMsg( 'userboard_private' ) . ')';
286285 }
287 - global $max_link_text_length;
288 - $max_link_text_length = 75;
 286+ //global $max_link_text_length;
 287+ //$max_link_text_length = 75;
289288
290289 //had global function to cut link text if too long and no breaks
291290 //$ub_message_text = preg_replace_callback( "/(<a[^>]*>)(.*?)(<\/a>)/i",'cut_link_text',$ub_message["message_text"]);
@@ -321,6 +320,6 @@
322321 }
323322 $output .= '</div>';
324323
325 - $wgOut->addHTML($output);
 324+ $wgOut->addHTML( $output );
326325 }
327326 }
\ No newline at end of file

Status & tagging log