Project

General

Profile

« Previous | Next » 

Revision 1918

Added by Dietmar over 11 years ago

! /modules/news/ beginning beginning recoding
replacing absolute MediaUrl with place holder

View differences:

view.php
23 23
}
24 24
/* -------------------------------------------------------- */
25 25
global $post_id, $post_section,$TEXT,$MESSAGE;
26
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
26 27

  
27 28
// load module language file
28 29
$lang = (dirname(__FILE__)) . '/languages/' . LANGUAGE . '.php';
......
54 55
$groups[0]['image'] = '';
55 56

  
56 57
$query_users = $database->query("SELECT group_id,title,active FROM ".TABLE_PREFIX."mod_news_groups WHERE section_id = '$section_id' ORDER BY position ASC");
57
if($query_users->numRows() > 0)
58
{
58
if($query_users->numRows() > 0){
59 59

  
60 60
	while( false != ($group = $query_users->fetchRow()) )
61 61
	{
......
73 73

  
74 74
// Check if we should show the main page or a post itself
75 75
// if(!defined('POST_ID') OR !is_numeric(POST_ID))
76
if(!isset($post_id) || !is_numeric($post_id))
77
{
76
if(!isset($post_id) || !is_numeric($post_id)){
78 77

  
79 78
	// Check if we should only list posts from a certain group
80 79
	if(isset($_GET['g']) AND is_numeric($_GET['g'])) {
......
192 191
			</div>
193 192
			<?php
194 193
		}
195
		while( false != ($post = $query_posts->fetchRow()) )
194
		while( false != ($post = $query_posts->fetchRow(MYSQL_ASSOC)) )
196 195
		{
197 196
			if(isset($groups[$post['group_id']]['active']) AND $groups[$post['group_id']]['active'] != false)
198 197
			{ // Make sure parent group is active
......
224 223
					$post_link .= 'g='.$_GET['g'];
225 224
					}
226 225
				}
227

  
228 226
				// Get group id, title, and image
229 227
				$group_id = $post['group_id'];
230 228
				$group_title = $groups[$group_id]['title'];
......
266 264

  
267 265
}
268 266
//elseif(defined('POST_ID') AND is_numeric(POST_ID))
269
elseif(isset($post_id) && is_numeric($post_id))
270
{
267
elseif(isset($post_id) && is_numeric($post_id)){
271 268
// print '<h2>'.POST_ID.'/'.PAGE_ID.'/'.POST_SECTION.'</h2>';
272 269
//  if(defined('POST_SECTION') AND POST_SECTION == $section_id)
273
	if(isset($post_section) && ($post_section == $section_id))
274
	{
270
	if(isset($post_section) && ($post_section == $section_id)){
275 271
		// Get settings
276 272
		$setting_post_header = $setting_post_footer = $setting_comments_header
277 273
		                     = $setting_comments_loop = $setting_comments_footer = '';
......
301 297
			exit($MESSAGE['PAGES_NOT_FOUND']);
302 298
		}
303 299

  
304
		// Get post info
300
// Get post info
305 301
		$t = time();
306 302
		$query_post = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts
307 303
			WHERE post_id = '".$post_id."' AND active = '1'
......
332 328
				$post_link_path = str_replace(WB_URL, WB_PATH,$post_link);
333 329
				$create_date = date(DATE_FORMAT, $post['created_when']+TIMEZONE);
334 330
				$create_time = date(TIME_FORMAT, $post['created_when']+TIMEZONE);
335
				// Get group id, title, and image
331
// Get group id, title, and image
336 332
				$group_id = $post['group_id'];
337 333
				$group_title = $groups[$group_id]['title'];
338 334
				$group_image = $groups[$group_id]['image'];
......
372 368
			$values = array(WB_URL.'/modules/news/comment.php?post_id='.$post_id.'&amp;section_id='.$section_id, $MOD_NEWS['TEXT_COMMENTS']);
373 369
			print str_replace($vars, $values, $setting_comments_header);
374 370

  
375
			// Query for comments
371
// Query for comments
376 372
			$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");
377 373
			if($query_comments->numRows() > 0)
378 374
			{

Also available in: Unified diff