Description : Add a custom block for display the Top Gamers on Portal (only available for Olympus Arcade)
Author : rainman
Revision : Morpheus
Open portal.php
Find :
Code: Select all
page_header($user->lang['PORTAL']);
Code: Select all
// Top gamers on index
$PLAYERS = '';
$sql_array = array(
'SELECT' => 's.gamer_id, COUNT(s.game_id) AS cups_nbr, u.username, u.user_colour, u.user_id',
'FROM' => array(
SCORES_TABLE => 's',
USERS_TABLE => 'u'
),
'WHERE' => 'u.user_id = s.gamer_id AND s.is_ultim = 0 AND s.is_valid = 1 AND s.is_first = 1',
'GROUP_BY' => 's.gamer_id',
'ORDER_BY' => 'cups_nbr DESC'
);
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, 3);
$i=0;
while( $row = $db->sql_fetchrow($result))
{
$i = $i+1;
$template->assign_block_vars('winners', array(
'NAME_WINNER' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'GOT_CUPS' => $row['cups_nbr'],
'NUM_WINNER' => $i,
));
}
// Top gamers on index
Find :
Code: Select all
<!-- IF S_DISPLAY_MAINMENU -->
<!-- INCLUDE portal/block/main_menu.html -->
<!-- ENDIF -->
Code: Select all
<!-- INCLUDE portal/block/winners.html -->
Copy the same following code :
Code: Select all
<div class="portal-panel">
<div class="inner">
<span class="portal-corners-top"><span></span></span>
<h3><img src="{T_THEME_PATH}/images/portal/portal_top_gamers.gif" width="18px" height="18px" alt=""/> Arcade Top Gamers</h3><br />
<!-- BEGIN winners -->
<span style="float:left;">{winners.NAME_WINNER} {winners.GOT_CUPS} Cups</span>
<span style="float:right;padding-right:10px;"><img src="images/qualitycup_{winners.NUM_WINNER}.gif" title="First"></span><br style="clear:both" />
<!-- END winners -->
<span class="portal-corners-bottom"><span></span></span>
</div>