Index: trunk/extensions/DPLforum/DPLforum_body.php |
— | — | @@ -1,6 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - |
5 | 4 | DPLforum v3.2 -- DynamicPageList-based forum extension |
6 | 5 | |
7 | 6 | Author: Ross McClure |
— | — | @@ -28,9 +27,9 @@ |
29 | 28 | * @addtogroup Extensions |
30 | 29 | */ |
31 | 30 | |
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 ); |
35 | 34 | } |
36 | 35 | |
37 | 36 | class DPLForum { |
— | — | @@ -61,90 +60,92 @@ |
62 | 61 | var $sOmit; |
63 | 62 | var $vMarkNew; |
64 | 63 | |
65 | | - function cat(&$parser, $name) { |
| 64 | + function cat( &$parser, $name ) { |
66 | 65 | $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 ) ) |
71 | 70 | $cats[] = $title; |
72 | 71 | } |
73 | 72 | } |
74 | 73 | return $cats; |
75 | 74 | } |
76 | 75 | |
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 ); |
83 | 82 | } |
84 | 83 | return $value; |
85 | 84 | } |
86 | 85 | |
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 ''; |
90 | 89 | |
91 | | - if($this->requireCache) $offset = 0; |
| 90 | + if ( $this->requireCache ) $offset = 0; |
92 | 91 | else { |
93 | 92 | global $wgRequest; |
94 | 93 | $parser->disableCache(); |
95 | | - $offset = intval($wgRequest->getVal('offset','')); |
| 94 | + $offset = intval( $wgRequest->getVal( 'offset', '' ) ); |
96 | 95 | } |
97 | 96 | |
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 ''; |
102 | 101 | |
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; |
106 | 105 | |
107 | | - return '[{{fullurl:{{FULLPAGENAME}}|offset='.$page.'}} '.$text.']'; |
| 106 | + return '[{{fullurl:{{FULLPAGENAME}}|offset=' . $page . '}} ' . $text . ']'; |
108 | 107 | } |
109 | 108 | |
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] ); |
119 | 118 | } |
120 | 119 | } |
121 | | - return ($page < 0); |
| 120 | + return ( $page < 0 ); |
122 | 121 | } |
123 | 122 | |
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 ) ); |
127 | 128 | } |
128 | 129 | |
129 | | - function parse(&$input, &$parser) { |
| 130 | + function parse( &$input, &$parser ) { |
130 | 131 | global $wgContLang; |
131 | 132 | |
132 | 133 | $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' ); |
140 | 141 | |
141 | | - switch($this->get('historylink')) { |
| 142 | + switch( $this->get( 'historylink' ) ) { |
142 | 143 | case 'embed': |
143 | 144 | case 'true': $this->bEmbedHistory = true; |
144 | 145 | case 'append': |
145 | 146 | case 'show': $this->bLinkHistory = true; |
146 | 147 | } |
147 | 148 | $sOrder = 'rev_timestamp'; |
148 | | - switch($this->get('ordermethod')) { |
| 149 | + switch( $this->get( 'ordermethod' ) ) { |
149 | 150 | case 'categoryadd': |
150 | 151 | case 'created': |
151 | 152 | $sOrder = 'first_time'; |
— | — | @@ -153,26 +154,26 @@ |
154 | 155 | $sOrder = 'page_id'; |
155 | 156 | } |
156 | 157 | |
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 ) |
159 | 160 | $this->bCompactEdit = $this->bAddLastEdit; |
160 | | - $this->bCompactAuthor = ($arg=='author' || $arg=='all'); |
| 161 | + $this->bCompactAuthor = ( $arg == 'author' || $arg == 'all' ); |
161 | 162 | |
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; |
167 | 168 | } |
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' ); |
171 | 172 | |
172 | 173 | $this->bTableMode = false; |
173 | 174 | $sStartItem = $sEndItem = ''; |
174 | 175 | $bCountMode = false; |
175 | | - $arg = $this->get('mode'); |
176 | | - switch($arg) { |
| 176 | + $arg = $this->get( 'mode' ); |
| 177 | + switch( $arg ) { |
177 | 178 | case 'none': |
178 | 179 | $sEndItem = '<br />'; |
179 | 180 | break; |
— | — | @@ -191,45 +192,45 @@ |
192 | 193 | $sStartItem = '<tr>'; |
193 | 194 | $sEndItem = '</tr>'; |
194 | 195 | } |
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 ); |
199 | 200 | $total = $cats + $nocats; |
200 | 201 | $output = ''; |
201 | 202 | |
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 ); |
206 | 207 | |
207 | 208 | $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' ) ) { |
212 | 213 | $parser->disableCache(); |
213 | 214 | |
214 | | - if(is_null($title)) { |
| 215 | + if ( is_null( $title ) ) { |
215 | 216 | global $wgRequest; |
216 | | - $start += intval($wgRequest->getVal('offset')); |
| 217 | + $start += intval( $wgRequest->getVal( 'offset' ) ); |
217 | 218 | } |
218 | 219 | } |
219 | | - if($start < 0) $start = 0; |
| 220 | + if ( $start < 0 ) $start = 0; |
220 | 221 | |
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 ) |
225 | 226 | $count = $this->maxResultCount; |
226 | 227 | } |
227 | | - else if($this->unlimitedResults) |
| 228 | + else if ( $this->unlimitedResults ) |
228 | 229 | $count = 0x7FFFFFFF; // maximum integer value |
229 | 230 | else |
230 | 231 | $count = $this->maxResultCount; |
231 | 232 | } |
232 | 233 | |
233 | | - //build the SQL query |
| 234 | + // build the SQL query |
234 | 235 | $dbr =& wfGetDB( DB_SLAVE ); |
235 | 236 | $sPageTable = $dbr->tableName( 'page' ); |
236 | 237 | $sRevTable = $dbr->tableName( 'revision' ); |
— | — | @@ -239,33 +240,33 @@ |
240 | 241 | $arg = " FROM $sPageTable INNER JOIN $sRevTable" |
241 | 242 | . " AS r ON page_latest = r.rev_id"; |
242 | 243 | |
243 | | - if($bCountMode) { |
| 244 | + if ( $bCountMode ) { |
244 | 245 | $sSqlSelectFrom = "SELECT COUNT(*) AS num_rows FROM $sPageTable"; |
245 | 246 | } |
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 ) ) ) ) { |
249 | 250 | $sSqlSelectFrom .= ", o.rev_user_text AS first_user, o.rev_timestamp AS" |
250 | 251 | . " first_time" . $arg . " INNER JOIN $sRevTable AS o" |
251 | 252 | . " ON o.rev_id =( SELECT MIN(q.rev_id) FROM $sRevTable" |
252 | 253 | . " AS q WHERE q.rev_page = page_id )"; |
253 | 254 | } else { |
254 | | - if($sOrder=='first_time') $sOrder = 'page_id'; |
| 255 | + if ( $sOrder == 'first_time' ) $sOrder = 'page_id'; |
255 | 256 | $sSqlSelectFrom .= $arg; |
256 | 257 | } |
257 | 258 | |
258 | 259 | $sSqlWhere = ' WHERE 1=1'; |
259 | | - if($iNamespace >= 0) |
260 | | - $sSqlWhere = ' WHERE page_namespace='.$iNamespace; |
| 260 | + if ( $iNamespace >= 0 ) |
| 261 | + $sSqlWhere = ' WHERE page_namespace=' . $iNamespace; |
261 | 262 | |
262 | | - if($sPrefix!=='') { |
| 263 | + if ( $sPrefix !== '' ) { |
263 | 264 | // 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 . "%'"; |
267 | 268 | } |
268 | 269 | |
269 | | - switch($this->get('redirects')) { |
| 270 | + switch( $this->get( 'redirects' ) ) { |
270 | 271 | case 'only': |
271 | 272 | $sSqlWhere .= ' AND page_is_redirect = 1'; |
272 | 273 | case 'include': |
— | — | @@ -277,13 +278,13 @@ |
278 | 279 | } |
279 | 280 | |
280 | 281 | $n = 1; |
281 | | - for($i = 0; $i < $cats; $i++) { |
| 282 | + for ( $i = 0; $i < $cats; $i++ ) { |
282 | 283 | $sSqlSelectFrom .= " INNER JOIN $categorylinks AS" . |
283 | 284 | " c{$n} ON page_id = c{$n}.cl_from AND c{$n}.cl_to=" . |
284 | 285 | $dbr->addQuotes( $aCategories[$i]->getDBKey() ); |
285 | 286 | $n++; |
286 | 287 | } |
287 | | - for($i = 0; $i < $nocats; $i++) { |
| 288 | + for ( $i = 0; $i < $nocats; $i++ ) { |
288 | 289 | $sSqlSelectFrom .= " LEFT OUTER JOIN $categorylinks AS" . |
289 | 290 | " c{$n} ON page_id = c{$n}.cl_from AND c{$n}.cl_to=" . |
290 | 291 | $dbr->addQuotes( $aExcludeCategories[$i]->getDBKey() ); |
— | — | @@ -291,41 +292,60 @@ |
292 | 293 | $n++; |
293 | 294 | } |
294 | 295 | |
295 | | - if(!$bCountMode) { |
| 296 | + if ( !$bCountMode ) { |
296 | 297 | $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 | + } |
299 | 304 | } |
300 | 305 | $sSqlWhere .= " LIMIT $start, $count"; |
301 | 306 | |
302 | | - //DEBUG: output SQL query |
303 | | - //$output .= 'QUERY: [' . $sSqlSelectFrom . $sSqlWhere . "]<br />"; |
| 307 | + // DEBUG: output SQL query |
| 308 | + // $output .= 'QUERY: [' . $sSqlSelectFrom . $sSqlWhere . "]<br />"; |
304 | 309 | |
305 | 310 | // process the query |
306 | | - $res = $dbr->query($sSqlSelectFrom . $sSqlWhere); |
| 311 | + $res = $dbr->query( $sSqlSelectFrom . $sSqlWhere ); |
307 | 312 | |
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 ) ); |
310 | 315 | |
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 | + } |
314 | 322 | } |
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 ); |
318 | 338 | $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 ); |
321 | 341 | $output .= $sEndItem . "\n"; |
322 | 342 | } |
323 | 343 | } else { |
324 | 344 | $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 ); |
328 | 348 | } else { |
329 | | - $output .= $this->buildOutput(NULL, $title, $this->msg('dplforum-never')); |
| 349 | + $output .= $this->buildOutput( NULL, $title, $this->msg( 'dplforum-never' ) ); |
330 | 350 | } |
331 | 351 | $output .= $sEndItem . "\n"; |
332 | 352 | } |
— | — | @@ -333,81 +353,139 @@ |
334 | 354 | } |
335 | 355 | |
336 | 356 | // Generates a single line of output. |
337 | | - function buildOutput($page, $title, $time, $user='', $author='', $made='') { |
| 357 | + function buildOutput( $page, $title, $time, $user = '', $author = '', $made = '' ) { |
338 | 358 | global $wgLang, $wgUser; |
| 359 | + |
339 | 360 | $sk =& $wgUser->getSkin(); |
340 | 361 | $tm =& $this->bTableMode; |
341 | | - $by = $this->msg('dplforum-by'); |
342 | 362 | $output = ''; |
343 | 363 | |
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 ); |
352 | 367 | } |
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 | + } |
355 | 383 | } |
356 | | - if($tm) $output .= "<td class='forum_title'>"; |
357 | 384 | |
| 385 | + if ( $tm ) { |
| 386 | + $output .= "<td class='forum_title'>"; |
| 387 | + } |
| 388 | + |
358 | 389 | $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() ); |
366 | 395 | } |
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 ); |
368 | 412 | $text = ''; |
369 | 413 | |
370 | | - if($this->bAddAuthor) { |
| 414 | + if ( $this->bAddAuthor ) { |
371 | 415 | $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"; |
378 | 431 | } |
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; |
380 | 435 | } |
381 | | - else if($author) $output .= " $by $author"; |
382 | 436 | } |
383 | 437 | |
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 ); |
392 | 441 | } |
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 | + } |
395 | 457 | } |
396 | 458 | |
397 | | - if($this->bAddLastEditor) { |
| 459 | + if ( $this->bAddLastEditor ) { |
398 | 460 | $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"; |
405 | 476 | } |
406 | | - else $output .= "</td><td class='forum_editor'>$user"; |
407 | 477 | } |
408 | | - else if($user) $text .= "$by $user"; |
| 478 | + else if ( $user ) { |
| 479 | + $byUser = wfMsgHTML( 'dplforum-by', $user ); |
| 480 | + $text .= $byUser; |
| 481 | + } |
409 | 482 | } |
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 | + |
412 | 490 | return $output; |
413 | 491 | } |
414 | 492 | } |
Index: trunk/extensions/DPLforum/DPLforum.i18n.php |
— | — | @@ -12,8 +12,8 @@ |
13 | 13 | */ |
14 | 14 | $messages['en'] = array( |
15 | 15 | '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', |
18 | 18 | 'dplforum-never' => 'Never', |
19 | 19 | 'dplforum-toofew' => 'DPL Forum: Too few categories!', |
20 | 20 | 'dplforum-toomany' => 'DPL Forum: Too many categories!' |
— | — | @@ -35,8 +35,8 @@ |
36 | 36 | */ |
37 | 37 | $messages['ar'] = array( |
38 | 38 | 'dplforum-desc' => 'امتداد منتدى معتمد على DPL', |
39 | | - 'dplforum-by' => 'بواسطة', |
40 | | - 'dplforum-edited' => ' - آخر تعديل', |
| 39 | + 'dplforum-by' => 'بواسطة $1', |
| 40 | + 'dplforum-edited' => '- آخر تعديل', |
41 | 41 | 'dplforum-never' => 'أبدا', |
42 | 42 | 'dplforum-toofew' => 'منتدى DPL: تصنيفات قليلة جدا!', |
43 | 43 | 'dplforum-toomany' => 'منتدى DPL: تصنيفات كثيرة جدا!', |
— | — | @@ -47,8 +47,8 @@ |
48 | 48 | */ |
49 | 49 | $messages['arz'] = array( |
50 | 50 | 'dplforum-desc' => 'امتداد منتدى معتمد على DPL', |
51 | | - 'dplforum-by' => 'بواسطة', |
52 | | - 'dplforum-edited' => ' - آخر تعديل', |
| 51 | + 'dplforum-by' => 'بواسطة $1', |
| 52 | + 'dplforum-edited' => '- آخر تعديل', |
53 | 53 | 'dplforum-never' => 'أبدا', |
54 | 54 | 'dplforum-toofew' => 'منتدى DPL: تصنيفات قليلة جدا!', |
55 | 55 | 'dplforum-toomany' => 'منتدى DPL: تصنيفات كثيرة جدا!', |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | */ |
61 | 61 | $messages['bg'] = array( |
62 | 62 | 'dplforum-desc' => 'DPL-базирано форумно разширение', |
63 | | - 'dplforum-by' => 'от', |
| 63 | + 'dplforum-by' => 'от $1', |
64 | 64 | 'dplforum-never' => 'Никога', |
65 | 65 | 'dplforum-toofew' => 'DPL Форум: Твърде малко категории!', |
66 | 66 | 'dplforum-toomany' => 'DPL Форум: Твърде много категории!', |
— | — | @@ -77,8 +77,8 @@ |
78 | 78 | */ |
79 | 79 | $messages['cs'] = array( |
80 | 80 | 'dplforum-desc' => 'Rozšíření DPL fórum', |
81 | | - 'dplforum-by' => ',', |
82 | | - 'dplforum-edited' => ' - poslední úprava', |
| 81 | + 'dplforum-by' => ', $1', |
| 82 | + 'dplforum-edited' => '- poslední úprava', |
83 | 83 | 'dplforum-never' => 'Nikdy', |
84 | 84 | 'dplforum-toofew' => 'DPL fórum: Příliš málo kategorií!', |
85 | 85 | 'dplforum-toomany' => 'DPL fórum: Příliš mnoho kategorií!', |
— | — | @@ -91,8 +91,8 @@ |
92 | 92 | */ |
93 | 93 | $messages['de'] = array( |
94 | 94 | 'dplforum-desc' => 'DPL-basierte Forumserweiterung', |
95 | | - 'dplforum-by' => 'durch', |
96 | | - 'dplforum-edited' => ' - Zuletzt bearbeitet', |
| 95 | + 'dplforum-by' => 'durch $1', |
| 96 | + 'dplforum-edited' => '- Zuletzt bearbeitet', |
97 | 97 | 'dplforum-never' => 'Nie', |
98 | 98 | 'dplforum-toofew' => 'DPL Forum: Zu wenig Kategorien!', |
99 | 99 | 'dplforum-toomany' => 'DPL Forum: Zu viele Kategorien!', |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | */ |
105 | 105 | $messages['dsb'] = array( |
106 | 106 | 'dplforum-desc' => 'Forumowe rozšyrjenje na zakłaźe DPL', |
107 | | - 'dplforum-by' => 'wót', |
| 107 | + 'dplforum-by' => 'wót $1', |
108 | 108 | 'dplforum-edited' => '- Slědna změna', |
109 | 109 | 'dplforum-never' => 'Žednje', |
110 | 110 | 'dplforum-toofew' => 'DPL-forum: Pśemało kategorijow!', |
— | — | @@ -122,8 +122,8 @@ |
123 | 123 | */ |
124 | 124 | $messages['eo'] = array( |
125 | 125 | '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', |
128 | 128 | 'dplforum-never' => 'Neniam', |
129 | 129 | 'dplforum-toofew' => 'DPL-Forumo: Tro malmultaj kategorioj!', |
130 | 130 | 'dplforum-toomany' => 'DPL-Forumo: Tro multaj da kategorioj!', |
— | — | @@ -134,8 +134,8 @@ |
135 | 135 | */ |
136 | 136 | $messages['fa'] = array( |
137 | 137 | 'dplforum-desc' => 'افزونهٔ تالار گفتگو مبتنی بر DPL', |
138 | | - 'dplforum-by' => 'توسط', |
139 | | - 'dplforum-edited' => ' - آخرین ویرایش', |
| 138 | + 'dplforum-by' => 'توسط $1', |
| 139 | + 'dplforum-edited' => '- آخرین ویرایش', |
140 | 140 | 'dplforum-never' => 'هرگز', |
141 | 141 | 'dplforum-toofew' => 'تالار گفتگوی DPL: تعداد ناکافی ردهها!', |
142 | 142 | 'dplforum-toomany' => 'تالار گفتگوی DPL: تعداد بیش از حد ردهها!', |
— | — | @@ -147,8 +147,8 @@ |
148 | 148 | */ |
149 | 149 | $messages['fi'] = array( |
150 | 150 | 'dplforum-desc' => 'DPL-pohjainen foorumilaajennus', |
151 | | - 'dplforum-by' => 'tehnyt', |
152 | | - 'dplforum-edited' => ' - Viimeksi muokattu', |
| 151 | + 'dplforum-by' => 'tehnyt $1', |
| 152 | + 'dplforum-edited' => '- Viimeksi muokattu', |
153 | 153 | 'dplforum-never' => 'Ei koskaan', |
154 | 154 | 'dplforum-toofew' => 'DPL-forum: Liian vähän luokkia!', |
155 | 155 | 'dplforum-toomany' => 'DPL-forum: Liian paljon luokkia!', |
— | — | @@ -162,8 +162,8 @@ |
163 | 163 | */ |
164 | 164 | $messages['fr'] = array( |
165 | 165 | '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', |
168 | 168 | 'dplforum-never' => 'Jamais', |
169 | 169 | 'dplforum-toofew' => 'DPL Forum : pas assez de catégories !', |
170 | 170 | 'dplforum-toomany' => 'DPL Forum : trop de catégories !', |
— | — | @@ -174,8 +174,8 @@ |
175 | 175 | */ |
176 | 176 | $messages['gl'] = array( |
177 | 177 | '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', |
180 | 180 | 'dplforum-never' => 'Nunca', |
181 | 181 | 'dplforum-toofew' => 'Foro DPL: moi poucas categorías!', |
182 | 182 | 'dplforum-toomany' => 'Foro DPL: demasiadas categorías!', |
— | — | @@ -186,8 +186,8 @@ |
187 | 187 | */ |
188 | 188 | $messages['grc'] = array( |
189 | 189 | 'dplforum-desc' => 'Ἐπέκτασις τῆς ἀγορὰς βεβασισμένη εἰς τὴν DPL', |
190 | | - 'dplforum-by' => 'ὑπὸ', |
191 | | - 'dplforum-edited' => ' - Ἐσχάτως μεταγεγραμμένη', |
| 190 | + 'dplforum-by' => 'ὑπὸ $1', |
| 191 | + 'dplforum-edited' => '- Ἐσχάτως μεταγεγραμμένη', |
192 | 192 | 'dplforum-never' => 'Οὔποτε', |
193 | 193 | 'dplforum-toofew' => 'Ἀγορὰ DPL: Τὰ μάλα ὀλίγαι κατηγορίαι!', |
194 | 194 | 'dplforum-toomany' => 'Ἀγορὰ DPL: Τὰ μάλα πολλαὶ κατηγορίαι!', |
— | — | @@ -199,8 +199,8 @@ |
200 | 200 | */ |
201 | 201 | $messages['he'] = array( |
202 | 202 | 'dplforum-desc' => 'הרחבת פורום מבוסס DPL', |
203 | | - 'dplforum-by' => 'על ידי', |
204 | | - 'dplforum-edited' => ' - נערכה לאחרונה', |
| 203 | + 'dplforum-by' => 'על ידי $1', |
| 204 | + 'dplforum-edited' => '- נערכה לאחרונה', |
205 | 205 | 'dplforum-never' => 'מעולם לא', |
206 | 206 | 'dplforum-toofew' => 'פורום DPL: מעט מדי קטגוריות!', |
207 | 207 | 'dplforum-toomany' => 'פורום DPL: יותר מדי קטגוריות!', |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | */ |
213 | 213 | $messages['hsb'] = array( |
214 | 214 | 'dplforum-desc' => 'Forumowe rozšěrjenje na zakładźe DPL', |
215 | | - 'dplforum-by' => 'wot', |
| 215 | + 'dplforum-by' => 'wot $1', |
216 | 216 | 'dplforum-edited' => '- Posledni raz wobdźěłany', |
217 | 217 | 'dplforum-never' => 'Ženje', |
218 | 218 | 'dplforum-toofew' => 'Forum DPL: Přemało kategorijow!', |
— | — | @@ -223,7 +223,7 @@ |
224 | 224 | */ |
225 | 225 | $messages['hu'] = array( |
226 | 226 | 'dplforum-desc' => 'DPL-alapú fórumkiterjesztés', |
227 | | - 'dplforum-edited' => ' - Utolsó szerkesztés', |
| 227 | + 'dplforum-edited' => '- Utolsó szerkesztés', |
228 | 228 | 'dplforum-never' => 'soha', |
229 | 229 | 'dplforum-toofew' => 'DPL fórum: túl kevés kategória!', |
230 | 230 | 'dplforum-toomany' => 'DPL fórum: túl sok kategória!', |
— | — | @@ -234,8 +234,8 @@ |
235 | 235 | */ |
236 | 236 | $messages['ia'] = array( |
237 | 237 | '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', |
240 | 240 | 'dplforum-never' => 'Nunquam', |
241 | 241 | 'dplforum-toofew' => 'Foro DPL: Non bastante categorias!', |
242 | 242 | 'dplforum-toomany' => 'Foro DPL: Troppo de categorias!', |
— | — | @@ -246,8 +246,8 @@ |
247 | 247 | */ |
248 | 248 | $messages['id'] = array( |
249 | 249 | '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', |
252 | 252 | 'dplforum-never' => 'Tidak pernah', |
253 | 253 | 'dplforum-toofew' => 'Forum DPL: Terlalu sedikit kategori!', |
254 | 254 | 'dplforum-toomany' => 'Forum DPL: Terlalu banyak kategori!', |
— | — | @@ -258,8 +258,8 @@ |
259 | 259 | */ |
260 | 260 | $messages['it'] = array( |
261 | 261 | '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', |
264 | 264 | 'dplforum-never' => 'Mai', |
265 | 265 | 'dplforum-toofew' => 'DPL Forum: Troppo poche categorie!', |
266 | 266 | 'dplforum-toomany' => 'DPL Forum: Troppe categorie!', |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | */ |
272 | 272 | $messages['ja'] = array( |
273 | 273 | 'dplforum-desc' => 'DynamicPageList ベースのフォーラムを実現する拡張機能', |
274 | | - 'dplforum-edited' => ' - 最終編集', |
| 274 | + 'dplforum-edited' => '- 最終編集', |
275 | 275 | 'dplforum-toofew' => 'DPL Forum: カテゴリが少なすぎます!', |
276 | 276 | 'dplforum-toomany' => 'DPL Forum: カテゴリが多すぎます!', |
277 | 277 | ); |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | * @author Thearith |
282 | 282 | */ |
283 | 283 | $messages['km'] = array( |
284 | | - 'dplforum-by' => 'ដោយ', |
| 284 | + 'dplforum-by' => 'ដោយ$1', |
285 | 285 | 'dplforum-edited' => 'កែប្រែជាចុងក្រោយ', |
286 | 286 | 'dplforum-never' => 'មិនដែល', |
287 | 287 | 'dplforum-toofew' => 'ចំណាត់ថ្នាក់ក្រុមតិចតួចណាស់!', |
— | — | @@ -292,8 +292,8 @@ |
293 | 293 | */ |
294 | 294 | $messages['ksh'] = array( |
295 | 295 | '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', |
298 | 298 | 'dplforum-never' => 'Nimohls', |
299 | 299 | 'dplforum-toofew' => 'DPL Forum: Nit jenooch Saachjruppe!', |
300 | 300 | 'dplforum-toomany' => 'DPL Forum: Zofill Saachjruppe!', |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | */ |
306 | 306 | $messages['lb'] = array( |
307 | 307 | 'dplforum-desc' => 'DPL-baséiert Forumerweiderungen', |
308 | | - 'dplforum-by' => 'vum', |
| 308 | + 'dplforum-by' => 'vum $1', |
309 | 309 | 'dplforum-edited' => "- Vir d'läscht geännert", |
310 | 310 | 'dplforum-never' => 'Ni', |
311 | 311 | 'dplforum-toofew' => 'DPL Forum: Ze wéineg Kategorien!', |
— | — | @@ -333,7 +333,7 @@ |
334 | 334 | */ |
335 | 335 | $messages['mr'] = array( |
336 | 336 | 'dplforum-desc' => 'DPL-आधारित चर्चासत्र विस्तार', |
337 | | - 'dplforum-by' => 'कडून', |
| 337 | + 'dplforum-by' => 'कडून $1', |
338 | 338 | 'dplforum-edited' => '- शेवटी बदललेली', |
339 | 339 | 'dplforum-never' => 'कधीच नाही', |
340 | 340 | 'dplforum-toofew' => 'डीपीएल चर्चासत्र: खूपच कमी वर्ग!', |
— | — | @@ -345,8 +345,8 @@ |
346 | 346 | */ |
347 | 347 | $messages['ms'] = array( |
348 | 348 | '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', |
351 | 351 | 'dplforum-never' => 'Tiada', |
352 | 352 | 'dplforum-toofew' => 'Forum DPL: Kategori terlalu sedikit!', |
353 | 353 | 'dplforum-toomany' => 'Forum DPL: Kategori terlalu banyak!', |
— | — | @@ -370,7 +370,7 @@ |
371 | 371 | * @author Slomox |
372 | 372 | */ |
373 | 373 | $messages['nds'] = array( |
374 | | - 'dplforum-by' => 'vun', |
| 374 | + 'dplforum-by' => 'vun $1', |
375 | 375 | 'dplforum-never' => 'Nie', |
376 | 376 | ); |
377 | 377 | |
— | — | @@ -380,8 +380,8 @@ |
381 | 381 | */ |
382 | 382 | $messages['nl'] = array( |
383 | 383 | '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', |
386 | 386 | 'dplforum-never' => 'Nooit', |
387 | 387 | 'dplforum-toofew' => 'DPL Forum: te weinig categorieën!', |
388 | 388 | 'dplforum-toomany' => 'DPL Forum: te veel categorieën!', |
— | — | @@ -392,8 +392,8 @@ |
393 | 393 | */ |
394 | 394 | $messages['nn'] = array( |
395 | 395 | 'dplforum-desc' => 'DPL-basert forumtillegg', |
396 | | - 'dplforum-by' => 'av', |
397 | | - 'dplforum-edited' => ' - sist endra', |
| 396 | + 'dplforum-by' => 'av $1', |
| 397 | + 'dplforum-edited' => '- sist endra', |
398 | 398 | 'dplforum-never' => 'Aldri', |
399 | 399 | 'dplforum-toofew' => 'DPL-forum: For få kategoriar!', |
400 | 400 | 'dplforum-toomany' => 'DPL-forum: For mange kategoriar!', |
— | — | @@ -404,8 +404,8 @@ |
405 | 405 | */ |
406 | 406 | $messages['no'] = array( |
407 | 407 | 'dplforum-desc' => 'DPL-basert forumutvidelse', |
408 | | - 'dplforum-by' => 'av', |
409 | | - 'dplforum-edited' => ' - sist endret', |
| 408 | + 'dplforum-by' => 'av $1', |
| 409 | + 'dplforum-edited' => '- sist endret', |
410 | 410 | 'dplforum-never' => 'Aldri', |
411 | 411 | 'dplforum-toofew' => 'DPL-forum: For få kategorier.', |
412 | 412 | 'dplforum-toomany' => 'DPL-forum: For mange kategorier.', |
— | — | @@ -416,8 +416,8 @@ |
417 | 417 | */ |
418 | 418 | $messages['oc'] = array( |
419 | 419 | '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', |
422 | 422 | 'dplforum-never' => 'Pas jamai', |
423 | 423 | 'dplforum-toofew' => 'DPL Forum : Pas pro de categorias !', |
424 | 424 | 'dplforum-toomany' => 'DPL Forum : Tròp de categorias !', |
— | — | @@ -430,8 +430,8 @@ |
431 | 431 | */ |
432 | 432 | $messages['pl'] = array( |
433 | 433 | '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', |
436 | 436 | 'dplforum-never' => 'Nigdy', |
437 | 437 | 'dplforum-toofew' => 'Forum DPL: Zbyt mało kategorii!', |
438 | 438 | 'dplforum-toomany' => 'Forum DPL: Zbyt wiele kategorii!', |
— | — | @@ -451,8 +451,8 @@ |
452 | 452 | */ |
453 | 453 | $messages['pt'] = array( |
454 | 454 | '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', |
457 | 457 | 'dplforum-never' => 'Nunca', |
458 | 458 | 'dplforum-toofew' => 'DPL Forum: Categorias em número insuficiente!', |
459 | 459 | 'dplforum-toomany' => 'DPL Forum: Demasiadas categorias!', |
— | — | @@ -470,8 +470,8 @@ |
471 | 471 | */ |
472 | 472 | $messages['ru'] = array( |
473 | 473 | 'dplforum-desc' => 'Форумное расширение, основанное на DPL', |
474 | | - 'dplforum-by' => 'от', |
475 | | - 'dplforum-edited' => ' - последняя правка', |
| 474 | + 'dplforum-by' => 'отv $1', |
| 475 | + 'dplforum-edited' => '- последняя правка', |
476 | 476 | 'dplforum-never' => 'Никогда', |
477 | 477 | 'dplforum-toofew' => 'Форум DPL: Слишком мало категорий!', |
478 | 478 | 'dplforum-toomany' => 'Форум DPL: Слишком много категорий!', |
— | — | @@ -482,7 +482,7 @@ |
483 | 483 | */ |
484 | 484 | $messages['scn'] = array( |
485 | 485 | 'dplforum-desc' => 'Estenzioni forum basata sù DPL', |
486 | | - 'dplforum-by' => 'di', |
| 486 | + 'dplforum-by' => 'di $1', |
487 | 487 | 'dplforum-edited' => '- Mudificatu ùrtima vota', |
488 | 488 | 'dplforum-never' => 'Mai', |
489 | 489 | 'dplforum-toofew' => 'DPL Forum: Troppi picca catigurìi!', |
— | — | @@ -494,8 +494,8 @@ |
495 | 495 | */ |
496 | 496 | $messages['sk'] = array( |
497 | 497 | 'dplforum-desc' => 'Rozšírenie DPL fórum', |
498 | | - 'dplforum-by' => ',', |
499 | | - 'dplforum-edited' => ' - posledná úprava', |
| 498 | + 'dplforum-by' => ', $1', |
| 499 | + 'dplforum-edited' => '- posledná úprava', |
500 | 500 | 'dplforum-never' => 'Nikdy', |
501 | 501 | 'dplforum-toofew' => 'DPL fórum: Príliš málo kategórií!', |
502 | 502 | 'dplforum-toomany' => 'DPL fórum: Príliš mnoho kategórií!', |
— | — | @@ -506,8 +506,8 @@ |
507 | 507 | */ |
508 | 508 | $messages['sv'] = array( |
509 | 509 | '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', |
512 | 512 | 'dplforum-never' => 'Aldrig', |
513 | 513 | 'dplforum-toofew' => 'DPL-forum: För få kategorier!', |
514 | 514 | 'dplforum-toomany' => 'DPL-forum: För många kategorier!', |
— | — | @@ -525,8 +525,8 @@ |
526 | 526 | */ |
527 | 527 | $messages['tl'] = array( |
528 | 528 | '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', |
531 | 531 | 'dplforum-never' => 'Hindi kailanman', |
532 | 532 | 'dplforum-toofew' => 'Talakayang DPL: Napakakaunting mga kaurian!', |
533 | 533 | 'dplforum-toomany' => 'Talakayang DPL: Napakaraming mga kaurian!', |
— | — | @@ -544,7 +544,7 @@ |
545 | 545 | */ |
546 | 546 | $messages['uk'] = array( |
547 | 547 | 'dplforum-desc' => 'Форумне розширення, засноване на DPL', |
548 | | - 'dplforum-by' => 'від', |
| 548 | + 'dplforum-by' => 'від $1', |
549 | 549 | 'dplforum-edited' => '- Остання правка', |
550 | 550 | 'dplforum-never' => 'Ніколи', |
551 | 551 | 'dplforum-toofew' => 'Форум DPL: Занадто мало категорій!', |
— | — | @@ -556,7 +556,7 @@ |
557 | 557 | */ |
558 | 558 | $messages['vec'] = array( |
559 | 559 | 'dplforum-desc' => 'Estension forum basà su DPL', |
560 | | - 'dplforum-by' => 'da', |
| 560 | + 'dplforum-by' => 'da $1', |
561 | 561 | 'dplforum-edited' => " - Modifegà l'ultima òlta", |
562 | 562 | 'dplforum-never' => 'Mai', |
563 | 563 | 'dplforum-toofew' => 'DPL Forum: Massa poche categorie!', |
— | — | @@ -568,8 +568,8 @@ |
569 | 569 | */ |
570 | 570 | $messages['vi'] = array( |
571 | 571 | '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', |
574 | 574 | 'dplforum-never' => 'Chưa bao giờ', |
575 | 575 | 'dplforum-toofew' => 'Diễn đàn DPL: Quá ít thể loại!', |
576 | 576 | 'dplforum-toomany' => 'Diễn đàn DPL: Quá nhiều thể loại!', |
Index: trunk/extensions/DPLforum/DPLforum.php |
— | — | @@ -30,9 +30,9 @@ |
31 | 31 | |
32 | 32 | */ |
33 | 33 | |
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 ); |
37 | 37 | } |
38 | 38 | |
39 | 39 | $wgExtensionFunctions[] = 'wfDPLforum'; |
— | — | @@ -43,29 +43,29 @@ |
44 | 44 | 'description' => 'DPL-based forum extension', |
45 | 45 | 'descriptionmsg' => 'dplforum-desc', |
46 | 46 | 'author' => 'Ross McClure', |
47 | | - 'version' => '3.2' |
| 47 | + 'version' => '3.3' |
48 | 48 | ); |
49 | 49 | |
50 | | -$dir = dirname(__FILE__) . '/'; |
| 50 | +$dir = dirname( __FILE__ ) . '/'; |
51 | 51 | $wgExtensionMessagesFiles['DPLforum'] = $dir . 'DPLforum.i18n.php'; |
52 | 52 | $wgAutoloadClasses['DPLForum'] = $dir . 'DPLforum_body.php'; |
53 | 53 | |
54 | 54 | function wfDPLforum() { |
55 | 55 | global $wgParser; |
56 | 56 | |
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' ) ); |
60 | 60 | } |
61 | 61 | |
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' ); |
65 | 65 | } |
66 | 66 | return true; |
67 | 67 | } |
68 | 68 | |
69 | | -function parseForum($input, $argv, &$parser) { |
| 69 | +function parseForum( $input, $argv, &$parser ) { |
70 | 70 | $f = new DPLForum(); |
71 | | - return $f->parse($input, $parser); |
| 71 | + return $f->parse( $input, $parser ); |
72 | 72 | } |