r22583 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22582‎ | r22583 | r22584 >
Date:23:54, 30 May 2007
Author:david
Status:old
Tags:
Comment:
Hashar\! Do not modify code of which you have no understanding\!
Modified paths:
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtModel.php
@@ -195,22 +195,17 @@
196196
197197 /** List of months in which there are >0 threads, suitable for threadsOfArticleInMonth. */
198198 static function monthsWhereArticleHasThreads( $article ) {
199 -
200 - global $wgLang;
201 -
202199 $threads = Thread::allThreadsOfArticle( $article );
203200 $months = array();
204201 foreach( $threads as $t ) {
205202 $m = substr( $t->touched(), 0, 6 );
206203 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;
 204+ if (!in_array( $m, $months )) $months[] = $m;
210205 }
211206 }
212207 return $months;
213208 }
214 -
 209+
215210 static function latestNThreadsOfArticle( $article, $n ) {
216211 return Thread::threadsWhere( array('thread_article' => $article->getID(),
217212 'thread_subthread_of is null'),