punbb/viewtopic.php
changeset 10 98d80b672f3c
parent 7 98bbc533541c
equal deleted inserted replaced
9:a932ce8c4827 10:98d80b672f3c
   274 
   274 
   275 $pun_page['item_count'] = 0;	// Keep track of post numbers
   275 $pun_page['item_count'] = 0;	// Keep track of post numbers
   276 
   276 
   277 // Retrieve the posts (and their respective poster/online status)
   277 // Retrieve the posts (and their respective poster/online status)
   278 $query = array(
   278 $query = array(
   279 	'SELECT'	=> 'u.email, u.title, u.url, u.location, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online',
   279 	'SELECT'	=> 'u.email, u.title, u.url, u.location, eu.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online',
   280 	'FROM'		=> 'posts AS p',
   280 	'FROM'		=> table_prefix . 'pun_posts AS p',
   281 	'JOINS'		=> array(
   281 	'JOINS'		=> array(
   282 		array(
   282 		array(
   283 			'INNER JOIN'	=> 'users AS u',
   283 			'INNER JOIN'	=> table_prefix . 'pun_users AS u',
   284 			'ON'			=> 'u.id=p.poster_id'
   284 			'ON'			=> 'u.id=p.poster_id'
   285 		),
   285 		),
       
   286     array(
       
   287 			'INNER JOIN'	=> table_prefix . 'users AS eu',
       
   288 			'ON'			=> 'u.id=eu.user_id'
       
   289 		),
   286 		array(
   290 		array(
   287 			'INNER JOIN'	=> 'groups AS g',
   291 			'INNER JOIN'	=> table_prefix . 'pun_groups AS g',
   288 			'ON'			=> 'g.g_id=u.group_id'
   292 			'ON'			=> 'g.g_id=u.group_id'
   289 		),
   293 		),
   290 		array(
   294 		array(
   291 			'LEFT JOIN'		=> 'online AS o',
   295 			'LEFT JOIN'		=> table_prefix . 'pun_online AS o',
   292 			'ON'			=> '(o.user_id=u.id AND o.user_id!=1 AND o.idle=0)'
   296 			'ON'			=> '(o.user_id=u.id AND o.user_id!=1 AND o.idle=0)'
   293 		),
   297 		),
   294 	),
   298 	),
   295 	'WHERE'		=> 'p.topic_id='.$id,
   299 	'WHERE'		=> 'p.topic_id='.$id,
   296 	'ORDER BY'	=> 'p.id',
   300 	'ORDER BY'	=> 'p.id',
   297 	'LIMIT'		=> $pun_page['start_from'].','.$pun_user['disp_posts']
   301 	'LIMIT'		=> $pun_page['start_from'].','.$pun_user['disp_posts'],
       
   302   'PARAMS' => array(
       
   303     'NO_PREFIX' => true
       
   304   )
   298 );
   305 );
   299 
   306 
   300 ($hook = get_hook('vt_qr_get_posts')) ? eval($hook) : null;
   307 ($hook = get_hook('vt_qr_get_posts')) ? eval($hook) : null;
   301 $result = $pun_db->query_build($query, true) or error(__FILE__, __LINE__);
   308 $result = $pun_db->query_build($query, true) or error(__FILE__, __LINE__);
   302 while ($cur_post = $pun_db->fetch_assoc($result))
   309 while ($cur_post = $pun_db->fetch_assoc($result))