r45424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45423‎ | r45424 | r45425 >
Date:18:35, 5 January 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* fix i18n issue with message 'dplforum-by'
* improve (but not completely fixed) some lego constructions for localisation
* fix some notices
* stylize.php for code / some readability changes
* bump version
Modified paths:
  • /trunk/extensions/DPLforum/DPLforum.i18n.php (modified) (history)
  • /trunk/extensions/DPLforum/DPLforum.php (modified) (history)
  • /trunk/extensions/DPLforum/DPLforum_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DPLforum/DPLforum_body.php
@@ -1,6 +1,5 @@
22 <?php
33 /*
4 -
54 DPLforum v3.2 -- DynamicPageList-based forum extension
65
76 Author: Ross McClure
@@ -28,9 +27,9 @@
2928 * @addtogroup Extensions
3029 */
3130
32 -if(!defined('MEDIAWIKI')) {
33 - echo("This file is an extension to the MediaWiki software and is not a valid access point");
34 - die(1);
 31+if ( !defined( 'MEDIAWIKI' ) ) {
 32+ echo( "This file is an extension to the MediaWiki software and is not a valid access point" );
 33+ die( 1 );
3534 }
3635
3736 class DPLForum {
@@ -61,90 +60,92 @@
6261 var $sOmit;
6362 var $vMarkNew;
6463
65 - function cat(&$parser, $name) {
 64+ function cat( &$parser, $name ) {
6665 $cats = array();
67 - if(preg_match_all("/^\s*$name\s*=\s*(.*)/mi",$this->sInput,$matches)) {
68 - foreach($matches[1] as $cat) {
69 - $title = Title::newFromText($parser->replaceVariables(trim($cat)));
70 - if( !is_null( $title ) )
 66+ if ( preg_match_all( "/^\s*$name\s*=\s*(.*)/mi", $this->sInput, $matches ) ) {
 67+ foreach ( $matches[1] as $cat ) {
 68+ $title = Title::newFromText( $parser->replaceVariables( trim( $cat ) ) );
 69+ if ( !is_null( $title ) )
7170 $cats[] = $title;
7271 }
7372 }
7473 return $cats;
7574 }
7675
77 - function get($name, $value=NULL, $parser=NULL) {
78 - if(preg_match("/^\s*$name\s*=\s*(.*)/mi",$this->sInput,$matches)) {
79 - $arg = trim($matches[1]);
80 - if(is_int($value)) return intval($arg);
81 - else if(is_null($parser)) return htmlspecialchars($arg);
82 - else return $parser->replaceVariables($arg);
 76+ function get( $name, $value = NULL, $parser = NULL ) {
 77+ if ( preg_match( "/^\s*$name\s*=\s*(.*)/mi", $this->sInput, $matches ) ) {
 78+ $arg = trim( $matches[1] );
 79+ if ( is_int( $value ) ) return intval( $arg );
 80+ else if ( is_null( $parser ) ) return htmlspecialchars( $arg );
 81+ else return $parser->replaceVariables( $arg );
8382 }
8483 return $value;
8584 }
8685
87 - function link(&$parser, $count, $page='', $text='') {
88 - $count = intval($count);
89 - if($count<1) return '';
 86+ function link( &$parser, $count, $page = '', $text = '' ) {
 87+ $count = intval( $count );
 88+ if ( $count < 1 ) return '';
9089
91 - if($this->requireCache) $offset = 0;
 90+ if ( $this->requireCache ) $offset = 0;
9291 else {
9392 global $wgRequest;
9493 $parser->disableCache();
95 - $offset = intval($wgRequest->getVal('offset',''));
 94+ $offset = intval( $wgRequest->getVal( 'offset', '' ) );
9695 }
9796
98 - $i = intval($page);
99 - if(($i!=0) && ctype_digit($page[0])) $i -= 1;
100 - else $i += intval($offset / $count);
101 - if($this->link_test($i,$page)) return '';
 97+ $i = intval( $page );
 98+ if ( ( $i != 0 ) && ctype_digit( $page[0] ) ) $i -= 1;
 99+ else $i += intval( $offset / $count );
 100+ if ( $this->link_test( $i, $page ) ) return '';
102101
103 - if($text==='') $text = ($i + 1);
104 - $page = ($count * $i);
105 - if($page == $offset) return $text;
 102+ if ( $text === '' ) $text = ( $i + 1 );
 103+ $page = ( $count * $i );
 104+ if ( $page == $offset ) return $text;
106105
107 - return '[{{fullurl:{{FULLPAGENAME}}|offset='.$page.'}} '.$text.']';
 106+ return '[{{fullurl:{{FULLPAGENAME}}|offset=' . $page . '}} ' . $text . ']';
108107 }
109108
110 - function link_test($page, $cond) {
111 - if(preg_match("/\\d+(\\D+)(\\d+)/",$cond,$m)) {
112 - $m[1] = strtr($m[1], array(('&l'.'t;')=>'<', ('&g'.'t;')=>'>'));
113 - $m[2] = intval($m[2])-1;
114 - switch($m[1]) {
115 - case '<': return ($page >= $m[2]);
116 - case '>': return ($page <= $m[2]);
117 - case '<=': return ($page > $m[2]);
118 - case '>=': return ($page < $m[2]);
 109+ function link_test( $page, $cond ) {
 110+ if ( preg_match( "/\\d+(\\D+)(\\d+)/", $cond, $m ) ) {
 111+ $m[1] = strtr( $m[1], array( ( '&l' . 't;' ) => '<', ( '&g' . 't;' ) => '>' ) );
 112+ $m[2] = intval( $m[2] ) - 1;
 113+ switch( $m[1] ) {
 114+ case '<': return ( $page >= $m[2] );
 115+ case '>': return ( $page <= $m[2] );
 116+ case '<=': return ( $page > $m[2] );
 117+ case '>=': return ( $page < $m[2] );
119118 }
120119 }
121 - return ($page < 0);
 120+ return ( $page < 0 );
122121 }
123122
124 - function msg($type, $error=NULL) {
125 - if($error && ($this->get('suppresserrors')=='true')) return '';
126 - return htmlspecialchars(wfMsg($type));
 123+ function msg( $type, $error = NULL ) {
 124+ if ( $error && ( $this->get( 'suppresserrors' ) == 'true' ) )
 125+ return '';
 126+
 127+ return htmlspecialchars( wfMsg( $type ) );
127128 }
128129
129 - function parse(&$input, &$parser) {
 130+ function parse( &$input, &$parser ) {
130131 global $wgContLang;
131132
132133 $this->sInput =& $input;
133 - $sPrefix = $this->get('prefix','',$parser);
134 - $this->sOmit = $this->get('omit',$sPrefix,$parser);
135 - $this->bAddAuthor = ($this->get('addauthor')=='true');
136 - $this->bTimestamp = ($this->get('timestamp')!='false');
137 - $this->bAddLastEdit = ($this->get('addlastedit')!='false');
138 - $this->bAddLastEditor = ($this->get('addlasteditor')=='true');
139 - $this->bAddCreationDate = ($this->get('addcreationdate')=='true');
 134+ $sPrefix = $this->get( 'prefix', '', $parser );
 135+ $this->sOmit = $this->get( 'omit', $sPrefix, $parser );
 136+ $this->bAddAuthor = ( $this->get( 'addauthor' ) == 'true' );
 137+ $this->bTimestamp = ( $this->get( 'timestamp' ) != 'false' );
 138+ $this->bAddLastEdit = ( $this->get( 'addlastedit' ) != 'false' );
 139+ $this->bAddLastEditor = ( $this->get( 'addlasteditor' ) == 'true' );
 140+ $this->bAddCreationDate = ( $this->get( 'addcreationdate' ) == 'true' );
140141
141 - switch($this->get('historylink')) {
 142+ switch( $this->get( 'historylink' ) ) {
142143 case 'embed':
143144 case 'true': $this->bEmbedHistory = true;
144145 case 'append':
145146 case 'show': $this->bLinkHistory = true;
146147 }
147148 $sOrder = 'rev_timestamp';
148 - switch($this->get('ordermethod')) {
 149+ switch( $this->get( 'ordermethod' ) ) {
149150 case 'categoryadd':
150151 case 'created':
151152 $sOrder = 'first_time';
@@ -153,26 +154,26 @@
154155 $sOrder = 'page_id';
155156 }
156157
157 - $arg = $this->get('compact');
158 - if($arg=='all' || strpos($arg,'edit')===0)
 158+ $arg = $this->get( 'compact' );
 159+ if ( $arg == 'all' || strpos( $arg, 'edit' ) === 0 )
159160 $this->bCompactEdit = $this->bAddLastEdit;
160 - $this->bCompactAuthor = ($arg=='author' || $arg=='all');
 161+ $this->bCompactAuthor = ( $arg == 'author' || $arg == 'all' );
161162
162 - $arg = $this->get('namespace','',$parser);
163 - $iNamespace = $wgContLang->getNsIndex($arg);
164 - if(!$iNamespace) {
165 - if(($arg) || ($arg==='0')) $iNamespace = intval($arg);
166 - else $iNamespace = -1;
 163+ $arg = $this->get( 'namespace', '', $parser );
 164+ $iNamespace = $wgContLang->getNsIndex( $arg );
 165+ if ( !$iNamespace ) {
 166+ if ( ( $arg ) || ( $arg === '0' ) ) $iNamespace = intval( $arg );
 167+ else $iNamespace = - 1;
167168 }
168 - if($iNamespace<0)
169 - $this->bShowNamespace = ($this->get('shownamespace')!='false');
170 - else $this->bShowNamespace = ($this->get('shownamespace')=='true');
 169+ if ( $iNamespace < 0 )
 170+ $this->bShowNamespace = ( $this->get( 'shownamespace' ) != 'false' );
 171+ else $this->bShowNamespace = ( $this->get( 'shownamespace' ) == 'true' );
171172
172173 $this->bTableMode = false;
173174 $sStartItem = $sEndItem = '';
174175 $bCountMode = false;
175 - $arg = $this->get('mode');
176 - switch($arg) {
 176+ $arg = $this->get( 'mode' );
 177+ switch( $arg ) {
177178 case 'none':
178179 $sEndItem = '<br />';
179180 break;
@@ -191,45 +192,45 @@
192193 $sStartItem = '<tr>';
193194 $sEndItem = '</tr>';
194195 }
195 - $aCategories = $this->cat($parser,'category');
196 - $aExcludeCategories = $this->cat($parser,'notcategory');
197 - $cats = count($aCategories);
198 - $nocats = count($aExcludeCategories);
 196+ $aCategories = $this->cat( $parser, 'category' );
 197+ $aExcludeCategories = $this->cat( $parser, 'notcategory' );
 198+ $cats = count( $aCategories );
 199+ $nocats = count( $aExcludeCategories );
199200 $total = $cats + $nocats;
200201 $output = '';
201202
202 - if($sPrefix==='' && (($cats < 1 && $iNamespace < 0) ||
203 - ($total < $this->minCategories))) return $this->msg('dplforum-toofew',1);
204 - if(($total > $this->maxCategories) && (!$this->unlimitedCategories))
205 - return $this->msg('dplforum-toomany',1);
 203+ if ( $sPrefix === '' && ( ( $cats < 1 && $iNamespace < 0 ) ||
 204+ ( $total < $this->minCategories ) ) ) return $this->msg( 'dplforum-toofew', 1 );
 205+ if ( ( $total > $this->maxCategories ) && ( !$this->unlimitedCategories ) )
 206+ return $this->msg( 'dplforum-toomany', 1 );
206207
207208 $count = 1;
208 - $start = $this->get('start',0);
209 - $title = Title::newFromText($parser->replaceVariables(
210 - trim($this->get('title'))));
211 - if(!($bCountMode || $this->requireCache || $this->get('cache')=='true')) {
 209+ $start = $this->get( 'start', 0 );
 210+ $title = Title::newFromText( $parser->replaceVariables(
 211+ trim( $this->get( 'title' ) ) ) );
 212+ if ( !( $bCountMode || $this->requireCache || $this->get( 'cache' ) == 'true' ) ) {
212213 $parser->disableCache();
213214
214 - if(is_null($title)) {
 215+ if ( is_null( $title ) ) {
215216 global $wgRequest;
216 - $start += intval($wgRequest->getVal('offset'));
 217+ $start += intval( $wgRequest->getVal( 'offset' ) );
217218 }
218219 }
219 - if($start < 0) $start = 0;
 220+ if ( $start < 0 ) $start = 0;
220221
221 - if(is_null($title)) {
222 - $count = $this->get('count',0);
223 - if($count > 0) {
224 - if($count > $this->maxResultCount)
 222+ if ( is_null( $title ) ) {
 223+ $count = $this->get( 'count', 0 );
 224+ if ( $count > 0 ) {
 225+ if ( $count > $this->maxResultCount )
225226 $count = $this->maxResultCount;
226227 }
227 - else if($this->unlimitedResults)
 228+ else if ( $this->unlimitedResults )
228229 $count = 0x7FFFFFFF; // maximum integer value
229230 else
230231 $count = $this->maxResultCount;
231232 }
232233
233 - //build the SQL query
 234+ // build the SQL query
234235 $dbr =& wfGetDB( DB_SLAVE );
235236 $sPageTable = $dbr->tableName( 'page' );
236237 $sRevTable = $dbr->tableName( 'revision' );
@@ -239,33 +240,33 @@
240241 $arg = " FROM $sPageTable INNER JOIN $sRevTable"
241242 . " AS r ON page_latest = r.rev_id";
242243
243 - if($bCountMode) {
 244+ if ( $bCountMode ) {
244245 $sSqlSelectFrom = "SELECT COUNT(*) AS num_rows FROM $sPageTable";
245246 }
246 - else if(($this->bAddAuthor || $this->bAddCreationDate ||
247 - ($sOrder=='first_time')) && ((!$this->restrictNamespace) ||
248 - ($iNamespace>=0 && !in_array($iNamespace,$this->restrictNamespace)))) {
 247+ else if ( ( $this->bAddAuthor || $this->bAddCreationDate ||
 248+ ( $sOrder == 'first_time' ) ) && ( ( !$this->restrictNamespace ) ||
 249+ ( $iNamespace >= 0 && !in_array( $iNamespace, $this->restrictNamespace ) ) ) ) {
249250 $sSqlSelectFrom .= ", o.rev_user_text AS first_user, o.rev_timestamp AS"
250251 . " first_time" . $arg . " INNER JOIN $sRevTable AS o"
251252 . " ON o.rev_id =( SELECT MIN(q.rev_id) FROM $sRevTable"
252253 . " AS q WHERE q.rev_page = page_id )";
253254 } else {
254 - if($sOrder=='first_time') $sOrder = 'page_id';
 255+ if ( $sOrder == 'first_time' ) $sOrder = 'page_id';
255256 $sSqlSelectFrom .= $arg;
256257 }
257258
258259 $sSqlWhere = ' WHERE 1=1';
259 - if($iNamespace >= 0)
260 - $sSqlWhere = ' WHERE page_namespace='.$iNamespace;
 260+ if ( $iNamespace >= 0 )
 261+ $sSqlWhere = ' WHERE page_namespace=' . $iNamespace;
261262
262 - if($sPrefix!=='') {
 263+ if ( $sPrefix !== '' ) {
263264 // Escape SQL special characters
264 - $sPrefix = strtr($sPrefix, array('\\'=>'\\\\\\\\',
265 - ' '=>'\\_', '_'=>'\\_', '%'=>'\\%', '\''=>'\\\''));
266 - $sSqlWhere .= " AND page_title LIKE BINARY '".$sPrefix."%'";
 265+ $sPrefix = strtr( $sPrefix, array( '\\' => '\\\\\\\\',
 266+ ' ' => '\\_', '_' => '\\_', '%' => '\\%', '\'' => '\\\'' ) );
 267+ $sSqlWhere .= " AND page_title LIKE BINARY '" . $sPrefix . "%'";
267268 }
268269
269 - switch($this->get('redirects')) {
 270+ switch( $this->get( 'redirects' ) ) {
270271 case 'only':
271272 $sSqlWhere .= ' AND page_is_redirect = 1';
272273 case 'include':
@@ -277,13 +278,13 @@
278279 }
279280
280281 $n = 1;
281 - for($i = 0; $i < $cats; $i++) {
 282+ for ( $i = 0; $i < $cats; $i++ ) {
282283 $sSqlSelectFrom .= " INNER JOIN $categorylinks AS" .
283284 " c{$n} ON page_id = c{$n}.cl_from AND c{$n}.cl_to=" .
284285 $dbr->addQuotes( $aCategories[$i]->getDBKey() );
285286 $n++;
286287 }
287 - for($i = 0; $i < $nocats; $i++) {
 288+ for ( $i = 0; $i < $nocats; $i++ ) {
288289 $sSqlSelectFrom .= " LEFT OUTER JOIN $categorylinks AS" .
289290 " c{$n} ON page_id = c{$n}.cl_from AND c{$n}.cl_to=" .
290291 $dbr->addQuotes( $aExcludeCategories[$i]->getDBKey() );
@@ -291,41 +292,60 @@
292293 $n++;
293294 }
294295
295 - if(!$bCountMode) {
 296+ if ( !$bCountMode ) {
296297 $sSqlWhere .= " ORDER BY $sOrder ";
297 - if($this->get('order')=='ascending') $sSqlWhere .= 'ASC';
298 - else $sSqlWhere .= 'DESC';
 298+
 299+ if ( $this->get( 'order' ) == 'ascending' ) {
 300+ $sSqlWhere .= 'ASC';
 301+ } else {
 302+ $sSqlWhere .= 'DESC';
 303+ }
299304 }
300305 $sSqlWhere .= " LIMIT $start, $count";
301306
302 - //DEBUG: output SQL query
303 - //$output .= 'QUERY: [' . $sSqlSelectFrom . $sSqlWhere . "]<br />";
 307+ // DEBUG: output SQL query
 308+ // $output .= 'QUERY: [' . $sSqlSelectFrom . $sSqlWhere . "]<br />";
304309
305310 // process the query
306 - $res = $dbr->query($sSqlSelectFrom . $sSqlWhere);
 311+ $res = $dbr->query( $sSqlSelectFrom . $sSqlWhere );
307312
308 - $this->vMarkNew = $dbr->timestamp(time() -
309 - intval($this->get('newdays',7) * 86400));
 313+ $this->vMarkNew = $dbr->timestamp( time() -
 314+ intval( $this->get( 'newdays', 7 ) * 86400 ) );
310315
311 - if($bCountMode) {
312 - if($row = $dbr->fetchObject( $res )) $output .= $row->num_rows;
313 - else $output .= '0';
 316+ if ( $bCountMode ) {
 317+ if ( $row = $dbr->fetchObject( $res ) ) {
 318+ $output .= $row->num_rows;
 319+ } else {
 320+ $output .= '0';
 321+ }
314322 }
315 - else if(is_null($title)) {
316 - while($row = $dbr->fetchObject( $res )) {
317 - $title = Title::makeTitle($row->page_namespace, $row->page_title);
 323+ else if ( is_null( $title ) ) {
 324+ while ( $row = $dbr->fetchObject( $res ) ) {
 325+ if( isset( $row->first_time ) ) {
 326+ $first_time = $row->first_time;
 327+ } else {
 328+ $first_time = '';
 329+ }
 330+
 331+ if( isset( $row->first_user ) ) {
 332+ $first_user = $row->first_user;
 333+ } else {
 334+ $first_user = '';
 335+ }
 336+
 337+ $title = Title::makeTitle( $row->page_namespace, $row->page_title );
318338 $output .= $sStartItem;
319 - $output .= $this->buildOutput($title, $title, $row->rev_timestamp,
320 - $row->rev_user_text, $row->first_user, $row->first_time);
 339+ $output .= $this->buildOutput( $title, $title, $row->rev_timestamp,
 340+ $row->rev_user_text, $first_user, $first_time );
321341 $output .= $sEndItem . "\n";
322342 }
323343 } else {
324344 $output .= $sStartItem;
325 - if($row = $dbr->fetchObject( $res )) {
326 - $output .= $this->buildOutput(Title::makeTitle($row->page_namespace,
327 - $row->page_title), $title, $row->rev_timestamp, $row->rev_user_text);
 345+ if ( $row = $dbr->fetchObject( $res ) ) {
 346+ $output .= $this->buildOutput( Title::makeTitle( $row->page_namespace,
 347+ $row->page_title ), $title, $row->rev_timestamp, $row->rev_user_text );
328348 } else {
329 - $output .= $this->buildOutput(NULL, $title, $this->msg('dplforum-never'));
 349+ $output .= $this->buildOutput( NULL, $title, $this->msg( 'dplforum-never' ) );
330350 }
331351 $output .= $sEndItem . "\n";
332352 }
@@ -333,81 +353,139 @@
334354 }
335355
336356 // Generates a single line of output.
337 - function buildOutput($page, $title, $time, $user='', $author='', $made='') {
 357+ function buildOutput( $page, $title, $time, $user = '', $author = '', $made = '' ) {
338358 global $wgLang, $wgUser;
 359+
339360 $sk =& $wgUser->getSkin();
340361 $tm =& $this->bTableMode;
341 - $by = $this->msg('dplforum-by');
342362 $output = '';
343363
344 - if($this->bAddCreationDate) {
345 - if(is_numeric($made)) $made = $wgLang->date($made, true);
346 - if($page && $this->bLinkHistory && !$this->bAddLastEdit) {
347 - if($this->bEmbedHistory)
348 - $made = $sk->makeKnownLinkObj($page, $made, 'action=history');
349 - else
350 - $made .= ' (' . $sk->makeKnownLinkObj($page,
351 - wfMsg('hist'), 'action=history') . ')';
 364+ if ( $this->bAddCreationDate ) {
 365+ if ( is_numeric( $made ) ) {
 366+ $made = $wgLang->date( $made, true );
352367 }
353 - if($tm) $output .= "<td class='forum_created'>$made</td>";
354 - else if($made) $output = "{$made}: ";
 368+
 369+ if ( $page && $this->bLinkHistory && !$this->bAddLastEdit ) {
 370+ if ( $this->bEmbedHistory ) {
 371+ $made = $sk->makeKnownLinkObj( $page, $made, 'action=history' );
 372+ } else {
 373+ $made .= ' (' . $sk->makeKnownLinkObj( $page,
 374+ wfMsg( 'hist' ), 'action=history' ) . ')';
 375+ }
 376+ }
 377+
 378+ if ( $tm ) {
 379+ $output .= "<td class='forum_created'>$made</td>";
 380+ } else if ( $made ) {
 381+ $output = "{$made}: ";
 382+ }
355383 }
356 - if($tm) $output .= "<td class='forum_title'>";
357384
 385+ if ( $tm ) {
 386+ $output .= "<td class='forum_title'>";
 387+ }
 388+
358389 $text = $query = $props = '';
359 - if($this->bShowNamespace == true) $text = $title->getEscapedText();
360 - else $text = htmlspecialchars($title->getText());
361 - if(($this->sOmit) && strpos($text, $this->sOmit)===0)
362 - $text = substr($text, strlen($this->sOmit));
363 - if(is_numeric($time)) {
364 - if($this->bTimestamp) $query = 't=' . $time;
365 - if($time > $this->vMarkNew) $props = " class='forum_new'";
 390+
 391+ if ( $this->bShowNamespace == true ) {
 392+ $text = $title->getEscapedText();
 393+ } else {
 394+ $text = htmlspecialchars( $title->getText() );
366395 }
367 - $output .= $sk->makeKnownLinkObj($title, $text, $query, '', '', $props);
 396+
 397+ if ( ( $this->sOmit ) && strpos( $text, $this->sOmit ) === 0 ) {
 398+ $text = substr( $text, strlen( $this->sOmit ) );
 399+ }
 400+
 401+ if ( is_numeric( $time ) ) {
 402+ if ( $this->bTimestamp ) {
 403+ $query = 't=' . $time;
 404+ }
 405+
 406+ if ( $time > $this->vMarkNew ) {
 407+ $props = " class='forum_new'";
 408+ }
 409+ }
 410+
 411+ $output .= $sk->makeKnownLinkObj( $title, $text, $query, '', '', $props );
368412 $text = '';
369413
370 - if($this->bAddAuthor) {
 414+ if ( $this->bAddAuthor ) {
371415 $author = Title::newFromText( $author, NS_USER );
372 - if($author) $author = $sk->makeKnownLinkObj($author,$author->getText());
373 - if($tm) {
374 - if($this->bCompactAuthor) {
375 - if($author)
376 - $output .= " <span class='forum_author'>$by {$author}</span>";
377 - else $output .= " <span class='forum_author'>&nb"."sp;</span>";
 416+
 417+ if ( $author ) {
 418+ $author = $sk->makeKnownLinkObj( $author, $author->getText() );
 419+ }
 420+
 421+ if ( $tm ) {
 422+ if ( $this->bCompactAuthor ) {
 423+ if ( $author ) {
 424+ $byAuthor = wfMsg( 'word-separator') . wfMsgHTML( 'dplforum-by', $author );
 425+ $output .= " <span class='forum_author'>$byAuthor</span>";
 426+ } else {
 427+ $output .= " <span class='forum_author'>&nb" . "sp;</span>";
 428+ }
 429+ } else {
 430+ $output .= "</td><td class='forum_author'>$author";
378431 }
379 - else $output .= "</td><td class='forum_author'>$author";
 432+ } else if ( $author ) {
 433+ $byAuthor = wfMsg( 'word-separator') . wfMsgHTML( 'dplforum-by', $author );
 434+ $output .= $byAuthor;
380435 }
381 - else if($author) $output .= " $by $author";
382436 }
383437
384 - if($this->bAddLastEdit) {
385 - if(is_numeric($time)) $time = $wgLang->timeanddate($time, true);
386 - if($page && $this->bLinkHistory) {
387 - if($this->bEmbedHistory)
388 - $time = $sk->makeKnownLinkObj($page, $time, 'action=history');
389 - else
390 - $time .= ' (' . $sk->makeKnownLinkObj($page,
391 - wfMsg('hist'), 'action=history') . ')';
 438+ if ( $this->bAddLastEdit ) {
 439+ if ( is_numeric( $time ) ) {
 440+ $time = $wgLang->timeanddate( $time, true );
392441 }
393 - if($tm) $output .= "</td><td class='forum_edited'>$time";
394 - else $text .= "$time ";
 442+
 443+ if ( $page && $this->bLinkHistory ) {
 444+ if ( $this->bEmbedHistory ) {
 445+ $time = $sk->makeKnownLinkObj( $page, $time, 'action=history' );
 446+ } else {
 447+ $time .= ' (' . $sk->makeKnownLinkObj( $page,
 448+ wfMsg( 'hist' ), 'action=history' ) . ')';
 449+ }
 450+ }
 451+
 452+ if ( $tm ) {
 453+ $output .= "</td><td class='forum_edited'>$time";
 454+ } else {
 455+ $text .= "$time ";
 456+ }
395457 }
396458
397 - if($this->bAddLastEditor) {
 459+ if ( $this->bAddLastEditor ) {
398460 $user = Title::newFromText( $user, NS_USER );
399 - if($user) $user = $sk->makeKnownLinkObj($user, $user->getText());
400 - if($tm) {
401 - if($this->bCompactEdit) {
402 - if($user)
403 - $output .= " <span class='forum_editor'>$by {$user}</span>";
404 - else $output .= " <span class='forum_editor'>&nb"."sp;</span>";
 461+
 462+ if ( $user ) {
 463+ $user = $sk->makeKnownLinkObj( $user, $user->getText() );
 464+ }
 465+
 466+ if ( $tm ) {
 467+ if ( $this->bCompactEdit ) {
 468+ if ( $user ) {
 469+ $byUser = wfMsgHTML( 'dplforum-by', $user );
 470+ $output .= " <span class='forum_editor'>$byUser</span>";
 471+ } else {
 472+ $output .= " <span class='forum_editor'>&nb" . "sp;</span>";
 473+ }
 474+ } else {
 475+ $output .= "</td><td class='forum_editor'>$user";
405476 }
406 - else $output .= "</td><td class='forum_editor'>$user";
407477 }
408 - else if($user) $text .= "$by $user";
 478+ else if ( $user ) {
 479+ $byUser = wfMsgHTML( 'dplforum-by', $user );
 480+ $text .= $byUser;
 481+ }
409482 }
410 - if($tm) $output .= "</td>";
411 - else if($text) $output .= $this->msg('dplforum-edited') . " $text";
 483+
 484+ if ( $tm ) {
 485+ $output .= "</td>";
 486+ } else if ( $text ) {
 487+ $output .= wfMsg( 'word-separator' ) . $this->msg( 'dplforum-edited' ) . " $text";
 488+ }
 489+
412490 return $output;
413491 }
414492 }
Index: trunk/extensions/DPLforum/DPLforum.i18n.php
@@ -12,8 +12,8 @@
1313 */
1414 $messages['en'] = array(
1515 'dplforum-desc' => 'DPL-based forum extension',
16 - 'dplforum-by' => 'by',
17 - 'dplforum-edited' => ' - Last edited',
 16+ 'dplforum-by' => 'by $1',
 17+ 'dplforum-edited' => '- Last edited',
1818 'dplforum-never' => 'Never',
1919 'dplforum-toofew' => 'DPL Forum: Too few categories!',
2020 'dplforum-toomany' => 'DPL Forum: Too many categories!'
@@ -35,8 +35,8 @@
3636 */
3737 $messages['ar'] = array(
3838 'dplforum-desc' => 'امتداد منتدى معتمد على DPL',
39 - 'dplforum-by' => 'بواسطة',
40 - 'dplforum-edited' => ' - آخر تعديل',
 39+ 'dplforum-by' => 'بواسطة $1',
 40+ 'dplforum-edited' => '- آخر تعديل',
4141 'dplforum-never' => 'أبدا',
4242 'dplforum-toofew' => 'منتدى DPL: تصنيفات قليلة جدا!',
4343 'dplforum-toomany' => 'منتدى DPL: تصنيفات كثيرة جدا!',
@@ -47,8 +47,8 @@
4848 */
4949 $messages['arz'] = array(
5050 'dplforum-desc' => 'امتداد منتدى معتمد على DPL',
51 - 'dplforum-by' => 'بواسطة',
52 - 'dplforum-edited' => ' - آخر تعديل',
 51+ 'dplforum-by' => 'بواسطة $1',
 52+ 'dplforum-edited' => '- آخر تعديل',
5353 'dplforum-never' => 'أبدا',
5454 'dplforum-toofew' => 'منتدى DPL: تصنيفات قليلة جدا!',
5555 'dplforum-toomany' => 'منتدى DPL: تصنيفات كثيرة جدا!',
@@ -59,7 +59,7 @@
6060 */
6161 $messages['bg'] = array(
6262 'dplforum-desc' => 'DPL-базирано форумно разширение',
63 - 'dplforum-by' => 'от',
 63+ 'dplforum-by' => 'от $1',
6464 'dplforum-never' => 'Никога',
6565 'dplforum-toofew' => 'DPL Форум: Твърде малко категории!',
6666 'dplforum-toomany' => 'DPL Форум: Твърде много категории!',
@@ -77,8 +77,8 @@
7878 */
7979 $messages['cs'] = array(
8080 'dplforum-desc' => 'Rozšíření DPL fórum',
81 - 'dplforum-by' => ',',
82 - 'dplforum-edited' => ' - poslední úprava',
 81+ 'dplforum-by' => ', $1',
 82+ 'dplforum-edited' => '- poslední úprava',
8383 'dplforum-never' => 'Nikdy',
8484 'dplforum-toofew' => 'DPL fórum: Příliš málo kategorií!',
8585 'dplforum-toomany' => 'DPL fórum: Příliš mnoho kategorií!',
@@ -91,8 +91,8 @@
9292 */
9393 $messages['de'] = array(
9494 'dplforum-desc' => 'DPL-basierte Forumserweiterung',
95 - 'dplforum-by' => 'durch',
96 - 'dplforum-edited' => ' - Zuletzt bearbeitet',
 95+ 'dplforum-by' => 'durch $1',
 96+ 'dplforum-edited' => '- Zuletzt bearbeitet',
9797 'dplforum-never' => 'Nie',
9898 'dplforum-toofew' => 'DPL Forum: Zu wenig Kategorien!',
9999 'dplforum-toomany' => 'DPL Forum: Zu viele Kategorien!',
@@ -103,7 +103,7 @@
104104 */
105105 $messages['dsb'] = array(
106106 'dplforum-desc' => 'Forumowe rozšyrjenje na zakłaźe DPL',
107 - 'dplforum-by' => 'wót',
 107+ 'dplforum-by' => 'wót $1',
108108 'dplforum-edited' => '- Slědna změna',
109109 'dplforum-never' => 'Žednje',
110110 'dplforum-toofew' => 'DPL-forum: Pśemało kategorijow!',
@@ -122,8 +122,8 @@
123123 */
124124 $messages['eo'] = array(
125125 'dplforum-desc' => 'DPL-bazita foruma etendilo',
126 - 'dplforum-by' => 'de',
127 - 'dplforum-edited' => ' - Laste redaktita',
 126+ 'dplforum-by' => 'de $1',
 127+ 'dplforum-edited' => '- Laste redaktita',
128128 'dplforum-never' => 'Neniam',
129129 'dplforum-toofew' => 'DPL-Forumo: Tro malmultaj kategorioj!',
130130 'dplforum-toomany' => 'DPL-Forumo: Tro multaj da kategorioj!',
@@ -134,8 +134,8 @@
135135 */
136136 $messages['fa'] = array(
137137 'dplforum-desc' => 'افزونهٔ تالار گفتگو مبتنی بر DPL',
138 - 'dplforum-by' => 'توسط',
139 - 'dplforum-edited' => ' - آخرین ویرایش',
 138+ 'dplforum-by' => 'توسط $1',
 139+ 'dplforum-edited' => '- آخرین ویرایش',
140140 'dplforum-never' => 'هرگز',
141141 'dplforum-toofew' => 'تالار گفتگوی DPL: تعداد ناکافی رده‌ها!',
142142 'dplforum-toomany' => 'تالار گفتگوی DPL: تعداد بیش از حد رده‌ها!',
@@ -147,8 +147,8 @@
148148 */
149149 $messages['fi'] = array(
150150 'dplforum-desc' => 'DPL-pohjainen foorumilaajennus',
151 - 'dplforum-by' => 'tehnyt',
152 - 'dplforum-edited' => ' - Viimeksi muokattu',
 151+ 'dplforum-by' => 'tehnyt $1',
 152+ 'dplforum-edited' => '- Viimeksi muokattu',
153153 'dplforum-never' => 'Ei koskaan',
154154 'dplforum-toofew' => 'DPL-forum: Liian vähän luokkia!',
155155 'dplforum-toomany' => 'DPL-forum: Liian paljon luokkia!',
@@ -162,8 +162,8 @@
163163 */
164164 $messages['fr'] = array(
165165 'dplforum-desc' => 'Extension forum basée sur DPL',
166 - 'dplforum-by' => 'par',
167 - 'dplforum-edited' => ' - Dernière modification',
 166+ 'dplforum-by' => 'par $1',
 167+ 'dplforum-edited' => '- Dernière modification',
168168 'dplforum-never' => 'Jamais',
169169 'dplforum-toofew' => 'DPL Forum : pas assez de catégories !',
170170 'dplforum-toomany' => 'DPL Forum : trop de catégories !',
@@ -174,8 +174,8 @@
175175 */
176176 $messages['gl'] = array(
177177 'dplforum-desc' => 'Extensión DPL baseada no foro',
178 - 'dplforum-by' => 'por',
179 - 'dplforum-edited' => ' - Última edición',
 178+ 'dplforum-by' => 'por $1',
 179+ 'dplforum-edited' => '- Última edición',
180180 'dplforum-never' => 'Nunca',
181181 'dplforum-toofew' => 'Foro DPL: moi poucas categorías!',
182182 'dplforum-toomany' => 'Foro DPL: demasiadas categorías!',
@@ -186,8 +186,8 @@
187187 */
188188 $messages['grc'] = array(
189189 'dplforum-desc' => 'Ἐπέκτασις τῆς ἀγορὰς βεβασισμένη εἰς τὴν DPL',
190 - 'dplforum-by' => 'ὑπὸ',
191 - 'dplforum-edited' => ' - Ἐσχάτως μεταγεγραμμένη',
 190+ 'dplforum-by' => 'ὑπὸ $1',
 191+ 'dplforum-edited' => '- Ἐσχάτως μεταγεγραμμένη',
192192 'dplforum-never' => 'Οὔποτε',
193193 'dplforum-toofew' => 'Ἀγορὰ DPL: Τὰ μάλα ὀλίγαι κατηγορίαι!',
194194 'dplforum-toomany' => 'Ἀγορὰ DPL: Τὰ μάλα πολλαὶ κατηγορίαι!',
@@ -199,8 +199,8 @@
200200 */
201201 $messages['he'] = array(
202202 'dplforum-desc' => 'הרחבת פורום מבוסס DPL',
203 - 'dplforum-by' => 'על ידי',
204 - 'dplforum-edited' => ' - נערכה לאחרונה',
 203+ 'dplforum-by' => 'על ידי $1',
 204+ 'dplforum-edited' => '- נערכה לאחרונה',
205205 'dplforum-never' => 'מעולם לא',
206206 'dplforum-toofew' => 'פורום DPL: מעט מדי קטגוריות!',
207207 'dplforum-toomany' => 'פורום DPL: יותר מדי קטגוריות!',
@@ -211,7 +211,7 @@
212212 */
213213 $messages['hsb'] = array(
214214 'dplforum-desc' => 'Forumowe rozšěrjenje na zakładźe DPL',
215 - 'dplforum-by' => 'wot',
 215+ 'dplforum-by' => 'wot $1',
216216 'dplforum-edited' => '- Posledni raz wobdźěłany',
217217 'dplforum-never' => 'Ženje',
218218 'dplforum-toofew' => 'Forum DPL: Přemało kategorijow!',
@@ -223,7 +223,7 @@
224224 */
225225 $messages['hu'] = array(
226226 'dplforum-desc' => 'DPL-alapú fórumkiterjesztés',
227 - 'dplforum-edited' => ' - Utolsó szerkesztés',
 227+ 'dplforum-edited' => '- Utolsó szerkesztés',
228228 'dplforum-never' => 'soha',
229229 'dplforum-toofew' => 'DPL fórum: túl kevés kategória!',
230230 'dplforum-toomany' => 'DPL fórum: túl sok kategória!',
@@ -234,8 +234,8 @@
235235 */
236236 $messages['ia'] = array(
237237 'dplforum-desc' => 'Extension pro foros basate in DPL',
238 - 'dplforum-by' => 'per',
239 - 'dplforum-edited' => ' - Ultime modification',
 238+ 'dplforum-by' => 'per $1',
 239+ 'dplforum-edited' => '- Ultime modification',
240240 'dplforum-never' => 'Nunquam',
241241 'dplforum-toofew' => 'Foro DPL: Non bastante categorias!',
242242 'dplforum-toomany' => 'Foro DPL: Troppo de categorias!',
@@ -246,8 +246,8 @@
247247 */
248248 $messages['id'] = array(
249249 'dplforum-desc' => 'Ekstensi forum berbasis-DPL',
250 - 'dplforum-by' => 'oleh',
251 - 'dplforum-edited' => ' - Terakhir disunting',
 250+ 'dplforum-by' => 'oleh $1',
 251+ 'dplforum-edited' => '- Terakhir disunting',
252252 'dplforum-never' => 'Tidak pernah',
253253 'dplforum-toofew' => 'Forum DPL: Terlalu sedikit kategori!',
254254 'dplforum-toomany' => 'Forum DPL: Terlalu banyak kategori!',
@@ -258,8 +258,8 @@
259259 */
260260 $messages['it'] = array(
261261 'dplforum-desc' => 'Estensione forum basata su DPL',
262 - 'dplforum-by' => 'da',
263 - 'dplforum-edited' => ' - Modificato ultima volta',
 262+ 'dplforum-by' => 'da $1',
 263+ 'dplforum-edited' => '- Modificato ultima volta',
264264 'dplforum-never' => 'Mai',
265265 'dplforum-toofew' => 'DPL Forum: Troppo poche categorie!',
266266 'dplforum-toomany' => 'DPL Forum: Troppe categorie!',
@@ -270,7 +270,7 @@
271271 */
272272 $messages['ja'] = array(
273273 'dplforum-desc' => 'DynamicPageList ベースのフォーラムを実現する拡張機能',
274 - 'dplforum-edited' => ' - 最終編集',
 274+ 'dplforum-edited' => '- 最終編集',
275275 'dplforum-toofew' => 'DPL Forum: カテゴリが少なすぎます!',
276276 'dplforum-toomany' => 'DPL Forum: カテゴリが多すぎます!',
277277 );
@@ -280,7 +280,7 @@
281281 * @author Thearith
282282 */
283283 $messages['km'] = array(
284 - 'dplforum-by' => 'ដោយ',
 284+ 'dplforum-by' => 'ដោយ$1',
285285 'dplforum-edited' => 'កែប្រែជាចុងក្រោយ',
286286 'dplforum-never' => 'មិនដែល',
287287 'dplforum-toofew' => 'ចំណាត់ថ្នាក់ក្រុមតិចតួចណាស់!',
@@ -292,8 +292,8 @@
293293 */
294294 $messages['ksh'] = array(
295295 'dplforum-desc' => 'Ene Forum-Zosatz op dä Basis fum DPL.',
296 - 'dplforum-by' => 'fum',
297 - 'dplforum-edited' => ' - zoläz beärbeidt',
 296+ 'dplforum-by' => 'fum $1',
 297+ 'dplforum-edited' => '- zoläz beärbeidt',
298298 'dplforum-never' => 'Nimohls',
299299 'dplforum-toofew' => 'DPL Forum: Nit jenooch Saachjruppe!',
300300 'dplforum-toomany' => 'DPL Forum: Zofill Saachjruppe!',
@@ -304,7 +304,7 @@
305305 */
306306 $messages['lb'] = array(
307307 'dplforum-desc' => 'DPL-baséiert Forumerweiderungen',
308 - 'dplforum-by' => 'vum',
 308+ 'dplforum-by' => 'vum $1',
309309 'dplforum-edited' => "- Vir d'läscht geännert",
310310 'dplforum-never' => 'Ni',
311311 'dplforum-toofew' => 'DPL Forum: Ze wéineg Kategorien!',
@@ -333,7 +333,7 @@
334334 */
335335 $messages['mr'] = array(
336336 'dplforum-desc' => 'DPL-आधारित चर्चासत्र विस्तार',
337 - 'dplforum-by' => 'कडून',
 337+ 'dplforum-by' => 'कडून $1',
338338 'dplforum-edited' => '- शेवटी बदललेली',
339339 'dplforum-never' => 'कधीच नाही',
340340 'dplforum-toofew' => 'डीपीएल चर्चासत्र: खूपच कमी वर्ग!',
@@ -345,8 +345,8 @@
346346 */
347347 $messages['ms'] = array(
348348 'dplforum-desc' => 'penyambung forum berdasarkan DPL',
349 - 'dplforum-by' => 'oleh',
350 - 'dplforum-edited' => ' - Suntingan terakhir',
 349+ 'dplforum-by' => 'oleh $1',
 350+ 'dplforum-edited' => '- Suntingan terakhir',
351351 'dplforum-never' => 'Tiada',
352352 'dplforum-toofew' => 'Forum DPL: Kategori terlalu sedikit!',
353353 'dplforum-toomany' => 'Forum DPL: Kategori terlalu banyak!',
@@ -370,7 +370,7 @@
371371 * @author Slomox
372372 */
373373 $messages['nds'] = array(
374 - 'dplforum-by' => 'vun',
 374+ 'dplforum-by' => 'vun $1',
375375 'dplforum-never' => 'Nie',
376376 );
377377
@@ -380,8 +380,8 @@
381381 */
382382 $messages['nl'] = array(
383383 'dplforum-desc' => 'Forumuitbreiding gebaseerd op DPL',
384 - 'dplforum-by' => 'door',
385 - 'dplforum-edited' => ' - Laatste bewerking',
 384+ 'dplforum-by' => 'door $1',
 385+ 'dplforum-edited' => '- Laatste bewerking',
386386 'dplforum-never' => 'Nooit',
387387 'dplforum-toofew' => 'DPL Forum: te weinig categorieën!',
388388 'dplforum-toomany' => 'DPL Forum: te veel categorieën!',
@@ -392,8 +392,8 @@
393393 */
394394 $messages['nn'] = array(
395395 'dplforum-desc' => 'DPL-basert forumtillegg',
396 - 'dplforum-by' => 'av',
397 - 'dplforum-edited' => ' - sist endra',
 396+ 'dplforum-by' => 'av $1',
 397+ 'dplforum-edited' => '- sist endra',
398398 'dplforum-never' => 'Aldri',
399399 'dplforum-toofew' => 'DPL-forum: For få kategoriar!',
400400 'dplforum-toomany' => 'DPL-forum: For mange kategoriar!',
@@ -404,8 +404,8 @@
405405 */
406406 $messages['no'] = array(
407407 'dplforum-desc' => 'DPL-basert forumutvidelse',
408 - 'dplforum-by' => 'av',
409 - 'dplforum-edited' => ' - sist endret',
 408+ 'dplforum-by' => 'av $1',
 409+ 'dplforum-edited' => '- sist endret',
410410 'dplforum-never' => 'Aldri',
411411 'dplforum-toofew' => 'DPL-forum: For få kategorier.',
412412 'dplforum-toomany' => 'DPL-forum: For mange kategorier.',
@@ -416,8 +416,8 @@
417417 */
418418 $messages['oc'] = array(
419419 'dplforum-desc' => 'DPL basada sus l’extension fòrum',
420 - 'dplforum-by' => 'per',
421 - 'dplforum-edited' => ' - Darrièr cambiament',
 420+ 'dplforum-by' => 'per $1',
 421+ 'dplforum-edited' => '- Darrièr cambiament',
422422 'dplforum-never' => 'Pas jamai',
423423 'dplforum-toofew' => 'DPL Forum : Pas pro de categorias !',
424424 'dplforum-toomany' => 'DPL Forum : Tròp de categorias !',
@@ -430,8 +430,8 @@
431431 */
432432 $messages['pl'] = array(
433433 'dplforum-desc' => 'Forum oparte na DPL',
434 - 'dplforum-by' => 'przez',
435 - 'dplforum-edited' => ' - ostatnia edycja',
 434+ 'dplforum-by' => 'przez $1',
 435+ 'dplforum-edited' => '- ostatnia edycja',
436436 'dplforum-never' => 'Nigdy',
437437 'dplforum-toofew' => 'Forum DPL: Zbyt mało kategorii!',
438438 'dplforum-toomany' => 'Forum DPL: Zbyt wiele kategorii!',
@@ -451,8 +451,8 @@
452452 */
453453 $messages['pt'] = array(
454454 'dplforum-desc' => 'Extensão de fórum baseada em DPL',
455 - 'dplforum-by' => 'por',
456 - 'dplforum-edited' => ' - Última edição',
 455+ 'dplforum-by' => 'por $1',
 456+ 'dplforum-edited' => '- Última edição',
457457 'dplforum-never' => 'Nunca',
458458 'dplforum-toofew' => 'DPL Forum: Categorias em número insuficiente!',
459459 'dplforum-toomany' => 'DPL Forum: Demasiadas categorias!',
@@ -470,8 +470,8 @@
471471 */
472472 $messages['ru'] = array(
473473 'dplforum-desc' => 'Форумное расширение, основанное на DPL',
474 - 'dplforum-by' => 'от',
475 - 'dplforum-edited' => ' - последняя правка',
 474+ 'dplforum-by' => 'отv $1',
 475+ 'dplforum-edited' => '- последняя правка',
476476 'dplforum-never' => 'Никогда',
477477 'dplforum-toofew' => 'Форум DPL: Слишком мало категорий!',
478478 'dplforum-toomany' => 'Форум DPL: Слишком много категорий!',
@@ -482,7 +482,7 @@
483483 */
484484 $messages['scn'] = array(
485485 'dplforum-desc' => 'Estenzioni forum basata sù DPL',
486 - 'dplforum-by' => 'di',
 486+ 'dplforum-by' => 'di $1',
487487 'dplforum-edited' => '- Mudificatu ùrtima vota',
488488 'dplforum-never' => 'Mai',
489489 'dplforum-toofew' => 'DPL Forum: Troppi picca catigurìi!',
@@ -494,8 +494,8 @@
495495 */
496496 $messages['sk'] = array(
497497 'dplforum-desc' => 'Rozšírenie DPL fórum',
498 - 'dplforum-by' => ',',
499 - 'dplforum-edited' => ' - posledná úprava',
 498+ 'dplforum-by' => ', $1',
 499+ 'dplforum-edited' => '- posledná úprava',
500500 'dplforum-never' => 'Nikdy',
501501 'dplforum-toofew' => 'DPL fórum: Príliš málo kategórií!',
502502 'dplforum-toomany' => 'DPL fórum: Príliš mnoho kategórií!',
@@ -506,8 +506,8 @@
507507 */
508508 $messages['sv'] = array(
509509 'dplforum-desc' => 'Forumtillägg baserat på DPL',
510 - 'dplforum-by' => 'av',
511 - 'dplforum-edited' => ' - senast ändrad',
 510+ 'dplforum-by' => 'av $1',
 511+ 'dplforum-edited' => '- senast ändrad',
512512 'dplforum-never' => 'Aldrig',
513513 'dplforum-toofew' => 'DPL-forum: För få kategorier!',
514514 'dplforum-toomany' => 'DPL-forum: För många kategorier!',
@@ -525,8 +525,8 @@
526526 */
527527 $messages['tl'] = array(
528528 'dplforum-desc' => 'Karugtong na nakabatay sa talakayang DPL',
529 - 'dplforum-by' => 'ni',
530 - 'dplforum-edited' => ' - Huling nabago',
 529+ 'dplforum-by' => 'ni $1',
 530+ 'dplforum-edited' => '- Huling nabago',
531531 'dplforum-never' => 'Hindi kailanman',
532532 'dplforum-toofew' => 'Talakayang DPL: Napakakaunting mga kaurian!',
533533 'dplforum-toomany' => 'Talakayang DPL: Napakaraming mga kaurian!',
@@ -544,7 +544,7 @@
545545 */
546546 $messages['uk'] = array(
547547 'dplforum-desc' => 'Форумне розширення, засноване на DPL',
548 - 'dplforum-by' => 'від',
 548+ 'dplforum-by' => 'від $1',
549549 'dplforum-edited' => '- Остання правка',
550550 'dplforum-never' => 'Ніколи',
551551 'dplforum-toofew' => 'Форум DPL: Занадто мало категорій!',
@@ -556,7 +556,7 @@
557557 */
558558 $messages['vec'] = array(
559559 'dplforum-desc' => 'Estension forum basà su DPL',
560 - 'dplforum-by' => 'da',
 560+ 'dplforum-by' => 'da $1',
561561 'dplforum-edited' => " - Modifegà l'ultima òlta",
562562 'dplforum-never' => 'Mai',
563563 'dplforum-toofew' => 'DPL Forum: Massa poche categorie!',
@@ -568,8 +568,8 @@
569569 */
570570 $messages['vi'] = array(
571571 'dplforum-desc' => 'Gói mở rộng diễn đàn dựa trên DPL',
572 - 'dplforum-by' => 'bởi',
573 - 'dplforum-edited' => ' - Lần sửa đổi cuối',
 572+ 'dplforum-by' => 'bởi $1',
 573+ 'dplforum-edited' => '- Lần sửa đổi cuối',
574574 'dplforum-never' => 'Chưa bao giờ',
575575 'dplforum-toofew' => 'Diễn đàn DPL: Quá ít thể loại!',
576576 'dplforum-toomany' => 'Diễn đàn DPL: Quá nhiều thể loại!',
Index: trunk/extensions/DPLforum/DPLforum.php
@@ -30,9 +30,9 @@
3131
3232 */
3333
34 -if(!defined('MEDIAWIKI')) {
35 - echo("This file is an extension to the MediaWiki software and is not a valid access point");
36 - die(1);
 34+if ( !defined( 'MEDIAWIKI' ) ) {
 35+ echo( "This file is an extension to the MediaWiki software and is not a valid access point" );
 36+ die( 1 );
3737 }
3838
3939 $wgExtensionFunctions[] = 'wfDPLforum';
@@ -43,29 +43,29 @@
4444 'description' => 'DPL-based forum extension',
4545 'descriptionmsg' => 'dplforum-desc',
4646 'author' => 'Ross McClure',
47 - 'version' => '3.2'
 47+ 'version' => '3.3'
4848 );
4949
50 -$dir = dirname(__FILE__) . '/';
 50+$dir = dirname( __FILE__ ) . '/';
5151 $wgExtensionMessagesFiles['DPLforum'] = $dir . 'DPLforum.i18n.php';
5252 $wgAutoloadClasses['DPLForum'] = $dir . 'DPLforum_body.php';
5353
5454 function wfDPLforum() {
5555 global $wgParser;
5656
57 - wfLoadExtensionMessages('DPLforum');
58 - $wgParser->setHook('forum', 'parseForum');
59 - $wgParser->setFunctionHook('forumlink', array(new DPLForum(),'link'));
 57+ wfLoadExtensionMessages( 'DPLforum' );
 58+ $wgParser->setHook( 'forum', 'parseForum' );
 59+ $wgParser->setFunctionHook( 'forumlink', array( new DPLForum(), 'link' ) );
6060 }
6161
62 -function wfDPLmagic(&$magicWords, $langCode="en") {
63 - switch($langCode) {
64 - default: $magicWords['forumlink'] = array (0,'forumlink');
 62+function wfDPLmagic( &$magicWords, $langCode = "en" ) {
 63+ switch( $langCode ) {
 64+ default: $magicWords['forumlink'] = array ( 0, 'forumlink' );
6565 }
6666 return true;
6767 }
6868
69 -function parseForum($input, $argv, &$parser) {
 69+function parseForum( $input, $argv, &$parser ) {
7070 $f = new DPLForum();
71 - return $f->parse($input, $parser);
 71+ return $f->parse( $input, $parser );
7272 }

Status & tagging log