MyBB Support

NewPoints Template Help

Submitted by ash7890, , Thread ID: 41118

Thread Closed

RE: NewPoints Template Help

#2
You can try using the phpintemplates and adding this query (from newpoints plugin) to the top of the template. Not sure if it will work but most likely because it runs the query again..

Code:
$richest_users = '';
$bgcolor = alt_trow();

$fields = array('uid', 'username', 'newpoints', 'usergroup', 'displaygroup');

$plugins->run_hooks("newpoints_stats_start");

// get richest users
$query = $db->simple_select('users', implode(',', $fields), '', array('order_by' => 'newpoints', 'order_dir' => 'DESC', 'limit' => intval($mybb->settings['newpoints_main_stats_richestusers'])));
while($user = $db->fetch_array($query)) {
$bgcolor = alt_trow();

$user['username'] = build_profile_link(format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']), intval($user['uid']));
$user['newpoints'] = newpoints_format_points($user['newpoints']);

$plugins->run_hooks("newpoints_stats_richest_users");

eval("\$richest_users .= \"".$templates->get('newpoints_statistics_richest_user')."\";");
}

if($richest_users == '')
{
$colspan = 2;
$no_results = $lang->newpoints_noresults;
eval("\$richest_users = \"".$templates->get('newpoints_no_results')."\";");
}

Users browsing this thread: 1 Guest(s)