r22575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22574‎ | r22575 | r22576 >
Date:17:18, 30 May 2007
Author:hashar
Status:old
Tags:
Comment:
* Format date in footer according to content language ($wgContLang)
* Format list of archive months using UI language ($wgLang)
Implements two year 10000 bugs.
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -246,12 +246,14 @@
247247 $p = new Parser(); $sig = $p->getUserSig( $thread->rootPost()->originalAuthor() );
248248 $this->output->addWikitext( $sig, false );
249249 $this->output->addHTML( wfCloseElement( 'li' ) );
 250+
 251+ global $wgContLang;
 252+ $this->output->addHTML(
 253+ wfOpenElement( 'li' ) .
 254+ $wgContLang->timeanddate( $thread->touched() ) .
 255+ wfCloseElement( 'li' )
 256+ );
250257
251 - $this->output->addHTML( wfOpenElement( 'li' ) );
252 - $d = new Date($thread->touched());
253 - $this->output->addHTML( $d->lastMonth()->text() );
254 - $this->output->addHTML( wfCloseElement( 'li' ) );
255 -
256258 $commands = array( 'Edit' => $this->lqtTalkpageUrl( $this->title, 'lqt_edit_post', $thread ),
257259 'Reply' => $this->lqtTalkpageUrl( $this->title, 'lqt_reply_to', $thread ),
258260 'Permalink' => $this->permalinkUrl( $thread ) );
@@ -376,7 +378,7 @@
377379 $this->openDiv('lqt_archive_widget');
378380 $this->output->addHTML('<form><select>');
379381 foreach( $options as $o ) {
380 - $this->output->addHTML("<option>$o");
 382+ $this->output->addHTML("<option>$o</option>");
381383 }
382384 $this->output->addHTML('</select></form>');
383385 $this->closeDiv();
Property changes on: branches/liquidthreads/extensions/LqtExtension.php
___________________________________________________________________
Name: svn:eol-style
384386 + native
Index: branches/liquidthreads/extensions/LqtModel.php
@@ -195,11 +195,18 @@
196196
197197 /** List of months in which there are >0 threads, suitable for threadsOfArticleInMonth. */
198198 static function monthsWhereArticleHasThreads( $article ) {
 199+
 200+ global $wgLang;
 201+
199202 $threads = Thread::allThreadsOfArticle( $article );
200203 $months = array();
201204 foreach( $threads as $t ) {
202205 $m = substr( $t->touched(), 0, 6 );
203 - if (!in_array( $m, $months )) $months[] = $m;
 206+ if ( !array_key_exists( $m, $months ) ) {
 207+ $year = substr($m, 0, 4);
 208+ $month_num = substr($m, 4, 2);
 209+ $months[$m] = $wgLang->getMonthName( $month_num ) . ' ' . $year;
 210+ }
204211 }
205212 return $months;
206213 }
@@ -264,4 +271,4 @@
265272
266273 }
267274
268 -?>
\ No newline at end of file
 275+?>
Property changes on: branches/liquidthreads/extensions/LqtModel.php
___________________________________________________________________
Name: svn:eol-style
269276 + native