User "Jack Phoenix" posted a comment on MediaWiki.r92147.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92147#c19680
Commit summary:

*small fix in sql;
*changed date/time format in history;
*check for Blocked users and wfReadOnly

Comment:

<pre><nowiki>
-  -- Name of the person who wrote the status update
-  `us_user_text` varchar(255) NOT NULL default '',
</nowiki></pre>
Took me a quick grep to make sure that this wasn't used anywhere. I don't think 
that many core MediaWiki tables have the author's ID number but not a field for 
their username (i.e [[Manual:revision table|the <tt>revision</tt> table]] has 
[[Manual:revision table#rev_user|<tt>rev_user</tt>]] field for storing the 
user's ID number and [[Manual:revision 
table#rev_user_text|<tt>rev_user_text</tt>]] for storing the user's username).

<pre><nowiki>
+                       $time = DateTime::createFromFormat('Y-m-d 
H:i:s',$row['ush_timestamp']);
+               
+            $output .= '<tr><td id="status-history-time">'.date_format($time, 
'j M G:i').' </td>';
</nowiki></pre>
This feels rather icky to me. Would it be possible to use wfTimestamp() and/or 
the related Language stuff ($wgLang->dateandttime(), $wgLang->date(), 
$wgLang->time() and whatnot) here? Most, if not all parts of SocialProfile use 
stuff like <tt>date( 'Y-m-d H:i:s' )</tt> instead of the proper MediaWiki 
functions, such as <tt>wfTimestampNow()</tt>, but this is due to historical 
reasons &mdash; SocialProfile wasn't written with non-English sites and 
non-MySQL backends in mind when it was created. One of these days I'll need to 
look into migrating all that old stuff to use the proper MediaWiki functions, 
but that day isn't going to be anytime soon.<br />
That being said, I'd love if new code wouldn't repeat old mistakes. :)

<pre><nowiki>
+#user-status-history a
+{
</nowiki></pre>
The opening brace should be place on the same line as the selector, i.e. 
<tt>#user-status-history a {</tt> as per [[Manual:Coding conventions#CSS|our 
coding standards]].

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to