r79748 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79747‎ | r79748 | r79749 >
Date:19:31, 6 January 2011
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: revert r77339 because Database::unixTimestamp was removed in r79345 and calling it results in fatals, as reported by Enterprise user on Extension talk:SocialProfile on MediaWiki.org
Modified paths:
  • /trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserGifts/UserGiftsClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php
@@ -320,8 +320,7 @@
321321 array(
322322 'sg_id', 'sg_user_id', 'sg_user_name', 'sg_gift_id', 'sg_date',
323323 'sg_status', 'gift_name', 'gift_description',
324 - 'gift_given_count',
325 - "{$dbr->unixTimestamp( 'sg_date' )} AS unix_time"
 324+ 'gift_given_count', 'UNIX_TIMESTAMP(sg_date) AS unix_time'
326325 ),
327326 array( "sg_user_id = {$this->user_id}" ),
328327 __METHOD__,
Index: trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php
@@ -282,7 +282,7 @@
283283 }
284284
285285 $sql = "SELECT ub_id, ub_user_id_from, ub_user_name_from, ub_user_id, ub_user_name,
286 - ub_message,{$dbr->unixTimestamp( 'ub_date' )} AS unix_time,ub_type
 286+ ub_message,UNIX_TIMESTAMP(ub_date) AS unix_time,ub_type
287287 FROM {$dbr->tableName( 'user_board' )}
288288 WHERE {$user_sql}
289289 ORDER BY ub_id DESC
Index: trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php
@@ -75,7 +75,7 @@
7676 $user_sql = " WHERE rc_user = {$this->user_id}";
7777 }
7878
79 - $sql = "SELECT {$dbr->unixTimestamp( 'rc_timestamp' )} AS item_date, rc_title,
 79+ $sql = "SELECT UNIX_TIMESTAMP(rc_timestamp) AS item_date, rc_title,
8080 rc_user, rc_user_text, rc_comment, rc_id, rc_minor, rc_new,
8181 rc_namespace, rc_cur_id, rc_this_oldid, rc_last_oldid,
8282 rc_log_action
@@ -140,7 +140,7 @@
141141 $user_sql = " AND vote_user_id = {$this->user_id}";
142142 }
143143
144 - $sql = "SELECT {$dbr->unixTimestamp( 'vote_date' )} AS item_date, username,
 144+ $sql = "SELECT UNIX_TIMESTAMP(vote_date) AS item_date, username,
145145 page_title, vote_count, comment_count, vote_ip,
146146 vote_user_id
147147 FROM {$dbr->tableName( 'Vote' )} v, {$dbr->tableName( 'page' )} p
@@ -184,7 +184,7 @@
185185 $user_sql = "AND Comment_user_id = {$this->user_id}";
186186 }
187187
188 - $sql = "SELECT {$dbr->unixTimestamp( 'comment_date' )} AS item_date,
 188+ $sql = "SELECT UNIX_TIMESTAMP(comment_date) AS item_date,
189189 Comment_Username, Comment_IP, page_title, Comment_Text,
190190 Comment_user_id, page_namespace, CommentID
191191 FROM {$dbr->tableName( 'Comments' )} c, {$dbr->tableName( 'page' )} p
@@ -252,7 +252,7 @@
253253
254254 $sql = "SELECT ug_id, ug_user_id_from, ug_user_name_from,
255255 ug_user_id_to, ug_user_name_to,
256 - {$dbr->unixTimestamp( 'ug_date' )} AS item_date, gift_name, gift_id
 256+ UNIX_TIMESTAMP(ug_date) AS item_date, gift_name, gift_id
257257 FROM {$dbr->tableName( 'user_gift' )}
258258 INNER JOIN {$dbr->tableName( 'gift' )} ON gift_id = ug_gift_id
259259 {$rel_sql} {$user_sql}
@@ -289,7 +289,7 @@
290290
291291 $sql = "SELECT ug_id, ug_user_id_from, ug_user_name_from,
292292 ug_user_id_to, ug_user_name_to,
293 - {$dbr->unixTimestamp( 'ug_date' )} AS item_date, gift_name, gift_id
 293+ UNIX_TIMESTAMP(ug_date) AS item_date, gift_name, gift_id
294294 FROM {$dbr->tableName( 'user_gift' )}
295295 INNER JOIN {$dbr->tableName( 'gift' )} ON gift_id = ug_gift_id
296296 {$rel_sql} {$user_sql}
@@ -349,7 +349,7 @@
350350 }
351351
352352 $sql = "SELECT sg_id, sg_user_id, sg_user_name,
353 - {$dbr->unixTimestamp( 'sg_date' )} AS item_date, gift_name, gift_id
 353+ UNIX_TIMESTAMP(sg_date) AS item_date, gift_name, gift_id
354354 FROM {$dbr->tableName( 'user_system_gift' )}
355355 INNER JOIN {$dbr->tableName( 'system_gift' )} ON gift_id = sg_gift_id
356356 {$rel_sql} {$user_sql}
@@ -404,7 +404,7 @@
405405 }
406406 $sql = "SELECT r_id, r_user_id, r_user_name, r_user_id_relation,
407407 r_user_name_relation, r_type,
408 - {$dbr->unixTimestamp( 'r_date' )} AS item_date
 408+ UNIX_TIMESTAMP(r_date) AS item_date
409409 FROM {$dbr->tableName( 'user_relationship' )}
410410 {$rel_sql} {$user_sql}
411411 ORDER BY r_id DESC LIMIT 0,{$this->item_max}";
@@ -468,7 +468,7 @@
469469
470470 $sql = "SELECT ub_id, ub_user_id, ub_user_name, ub_user_id_from,
471471 ub_user_name_from,
472 - {$dbr->unixTimestamp( 'ub_date' )} AS item_date,
 472+ UNIX_TIMESTAMP(ub_date) AS item_date,
473473 ub_message
474474 FROM {$dbr->tableName( 'user_board' )} WHERE
475475 {$rel_sql} {$user_sql} ub_type=0
@@ -527,7 +527,7 @@
528528 }
529529
530530 $sql = "SELECT um_id, um_user_id, um_user_name, um_type, um_message,
531 - {$dbr->unixTimestamp( 'um_date' )} AS item_date
 531+ UNIX_TIMESTAMP(um_date) AS item_date
532532 FROM {$dbr->tableName( 'user_system_messages' )}
533533 {$rel_sql} {$user_sql}
534534 ORDER BY um_id DESC LIMIT 0,{$this->item_max}";
Index: trunk/extensions/SocialProfile/UserGifts/UserGiftsClass.php
@@ -318,8 +318,7 @@
319319 array(
320320 'ug_id', 'ug_user_id_from', 'ug_user_name_from', 'ug_gift_id',
321321 'ug_date', 'ug_status', 'gift_name', 'gift_description',
322 - 'gift_given_count',
323 - "{$dbr->unixTimestamp( 'ug_date' )} AS unix_time"
 322+ 'gift_given_count', 'UNIX_TIMESTAMP(ug_date) AS unix_time'
324323 ),
325324 array( "ug_user_id_to = {$this->user_id}" ),
326325 __METHOD__,
@@ -364,8 +363,7 @@
365364 array(
366365 'ug_id', 'ug_user_id_from', 'ug_user_name_from', 'ug_gift_id',
367366 'ug_date', 'ug_status', 'gift_name', 'gift_description',
368 - 'gift_given_count',
369 - "{$dbr->unixTimestamp( 'ug_date' )} AS unix_time"
 367+ 'gift_given_count', 'UNIX_TIMESTAMP(ug_date) AS unix_time'
370368 ),
371369 array(),
372370 __METHOD__,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77339SocialProfile: replace UNIX_TIMESTAMP bits with $dbr->unixTimestamp() as per ...ashley18:52, 26 November 2010
r79345Remove now-unused SQL timestamp conversion functions added in r77231. They we...catrope16:29, 31 December 2010

Status & tagging log