Files
phpbb_board3-portal_tlw/root/portal/block/top_posters.php
2009-09-03 12:48:45 +00:00

39 lines
1001 B
PHP

<?php
/**
*
* @package Board3 Portal v2
* @version $Id$
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
{
exit;
}
/**
*/
$sql = 'SELECT user_id, username, user_posts, user_colour
FROM ' . USERS_TABLE . '
WHERE user_type <> ' . USER_IGNORE . '
AND user_posts <> 0
ORDER BY user_posts DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_most_poster']);
while( ($row = $db->sql_fetchrow($result)) && ($row['username']) )
{
$template->assign_block_vars('top_poster', array(
'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&amp;sr=posts'),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'POSTER_POSTS' => $row['user_posts'],
)
);
}
$db->sql_freeresult($result);
$template->assign_var('S_DISPLAY_TOP_POSTERS', true);
?>