Revision 901
Added by Matthias almost 16 years ago
view.php | ||
---|---|---|
33 | 33 |
echo "\n</style>\n"; |
34 | 34 |
} |
35 | 35 |
|
36 |
// check if module language file exists for the language set by the user (e.g. DE, EN) |
|
37 |
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) { |
|
38 |
// no module language file exists for the language set by the user, include default module language file EN.php |
|
39 |
require_once(WB_PATH .'/modules/news/languages/EN.php'); |
|
40 |
} else { |
|
41 |
// a module language file exists for the language defined by the user, load it |
|
42 |
require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php'); |
|
43 |
} |
|
44 |
|
|
36 | 45 |
//overwrite php.ini on Apache servers for valid SESSION ID Separator |
37 | 46 |
if(function_exists('ini_set')) { |
38 | 47 |
ini_set('arg_separator.output', '&'); |
... | ... | |
214 | 223 |
if($post_long_len < 9) { |
215 | 224 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], ''); |
216 | 225 |
} else { |
217 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $TEXT['READ_MORE']);
|
|
226 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $MOD_NEWS['TEXT_READ_MORE']);
|
|
218 | 227 |
} |
219 | 228 |
} else { |
220 | 229 |
if($post_long_len < 9) { |
221 | 230 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '', ''); |
222 | 231 |
} else { |
223 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '', $TEXT['READ_MORE']);
|
|
232 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '', $MOD_NEWS['TEXT_READ_MORE']);
|
|
224 | 233 |
} |
225 | 234 |
} |
226 | 235 |
echo str_replace($vars, $values, $setting_post_loop); |
... | ... | |
291 | 300 |
$group_image = $groups[$group_id]['image']; |
292 | 301 |
if($group_image == '') { $display_image = 'none'; } else { $display_image = ''; } |
293 | 302 |
if($group_id == 0) { $display_group = 'none'; } else { $display_group = ''; } |
294 |
$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[BACK]', '[MODI_DATE]', '[MODI_TIME]', '[PUBLISHED_DATE]', '[PUBLISHED_TIME]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]');
|
|
303 |
$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[BACK]', '[TEXT_BACK]', '[TEXT_LAST_CHANGED]', '[MODI_DATE]', '[TEXT_AT]', '[MODI_TIME]', '[PUBLISHED_DATE]', '[PUBLISHED_TIME]', '[TEXT_POSTED_BY]', '[TEXT_ON]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]');
|
|
295 | 304 |
$post_short=$post['content_short']; |
296 | 305 |
$wb->preprocess($post_short); |
297 | 306 |
if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') { |
298 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']);
|
|
307 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $MOD_NEWS['TEXT_BACK'], $MOD_NEWS['TEXT_LAST_CHANGED'], $post_date, $MOD_NEWS['TEXT_AT'], $post_time, $publ_date, $publ_time, $MOD_NEWS['TEXT_POSTED_BY'], $MOD_NEWS['TEXT_ON'], $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']);
|
|
299 | 308 |
} else { |
300 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '');
|
|
309 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $MOD_NEWS['TEXT_BACK'], $MOD_NEWS['TEXT_LAST_CHANGED'], $post_date, $MOD_NEWS['TEXT_AT'], $post_time, $publ_date, $publ_time, $MOD_NEWS['TEXT_POSTED_BY'], $MOD_NEWS['TEXT_ON'], '', '', '', '');
|
|
301 | 310 |
} |
302 | 311 |
$post_long = ($post['content_long']); |
303 | 312 |
} |
... | ... | |
321 | 330 |
if(($post['commenting'] == 'private' AND isset($wb) AND $wb->is_authenticated() == true) OR $post['commenting'] == 'public') { |
322 | 331 |
|
323 | 332 |
// Print comments header |
324 |
echo str_replace('[ADD_COMMENT_URL]', WB_URL.'/modules/news/comment.php?id='.POST_ID.'&sid='.$section_id, $setting_comments_header); |
|
333 |
$vars = array('[ADD_COMMENT_URL]','[TEXT_COMMENTS]'); |
|
334 |
$values = array(WB_URL.'/modules/news/comment.php?id='.POST_ID.'&sid='.$section_id, $MOD_NEWS['TEXT_COMMENTS']); |
|
335 |
echo str_replace($vars, $values, $setting_comments_header); |
|
325 | 336 |
|
326 | 337 |
// Query for comments |
327 | 338 |
$query_comments = $database->query("SELECT title,comment,commented_when,commented_by FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '".POST_ID."' ORDER BY commented_when ASC"); |
... | ... | |
334 | 345 |
$commented_date = gmdate(DATE_FORMAT, $comment['commented_when']+TIMEZONE); |
335 | 346 |
$commented_time = gmdate(TIME_FORMAT, $comment['commented_when']+TIMEZONE); |
336 | 347 |
$uid = $comment['commented_by']; |
337 |
$vars = array('[TITLE]','[COMMENT]','[DATE]','[TIME]','[USER_ID]','[USERNAME]','[DISPLAY_NAME]', '[EMAIL]');
|
|
348 |
$vars = array('[TITLE]','[COMMENT]','[TEXT_ON]','[DATE]','[TEXT_AT]','[TIME]','[TEXT_BY]','[USER_ID]','[USERNAME]','[DISPLAY_NAME]', '[EMAIL]');
|
|
338 | 349 |
if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') { |
339 |
$values = array(($comment['title']), ($comment['comment']), $commented_date, $commented_time, $uid, ($users[$uid]['username']), ($users[$uid]['display_name']), ($users[$uid]['email']));
|
|
350 |
$values = array(($comment['title']), ($comment['comment']), $MOD_NEWS['TEXT_ON'], $commented_date, $MOD_NEWS['TEXT_AT'], $commented_time, $MOD_NEWS['TEXT_BY'], $uid, ($users[$uid]['username']), ($users[$uid]['display_name']), ($users[$uid]['email']));
|
|
340 | 351 |
} else { |
341 |
$values = array(($comment['title']), ($comment['comment']), $commented_date, $commented_time, '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], '');
|
|
352 |
$values = array(($comment['title']), ($comment['comment']), $MOD_NEWS['TEXT_ON'], $commented_date, $MOD_NEWS['TEXT_AT'], $commented_time, $MOD_NEWS['TEXT_BY'], '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], '');
|
|
342 | 353 |
} |
343 | 354 |
echo str_replace($vars, $values, $setting_comments_loop); |
344 | 355 |
} |
... | ... | |
352 | 363 |
} |
353 | 364 |
|
354 | 365 |
// Print comments footer |
355 |
echo str_replace('[ADD_COMMENT_URL]', WB_URL.'/modules/news/comment.php?id='.POST_ID.'&sid='.$section_id, $setting_comments_footer); |
|
366 |
$vars = array('[ADD_COMMENT_URL]','[TEXT_ADD_COMMENT]'); |
|
367 |
$values = array(WB_URL.'/modules/news/comment.php?id='.POST_ID.'&sid='.$section_id, $MOD_NEWS['TEXT_ADD_COMMENT']); |
|
368 |
echo str_replace($vars, $values, $setting_comments_footer); |
|
356 | 369 |
} |
357 | 370 |
if(ENABLED_ASP) { |
358 | 371 |
$_SESSION['comes_from_view'] = POST_ID; |
Also available in: Unified diff
made news Modul multilingual, see ticket #676 (some additional translations are needed)