Normal top 10 sitede var...Sadece kurulumda boardindex.php de
// Find all boards and categories, as well as related information. This will be sorted by the natural order of boards and categories, which we control.
üzerine ekle
// max.online olanlar ivan_
// !!!SLOW This query is sorta slow. Should we just add a key? (or would that be bad in the long run?)
$temp = cache_get_data('stats_total_time_members', 600);
$members_result = db_query("
SELECT ID_MEMBER, realName, totalTimeLoggedIn
FROM {$db_prefix}members" . (!empty($temp) ? "
WHERE ID_MEMBER IN (" . implode(', ', $temp) . ")" : '') . "
ORDER BY totalTimeLoggedIn DESC
LIMIT 20", __FILE__, __LINE__);
$context['top_time_online'] = array();
$temp2 = array();
$max_time_online = 1;
while ($row_members = mysql_fetch_assoc($members_result))
{
$temp2[] = (int) $row_members['ID_MEMBER'];
if (count($context['top_time_online']) >= 10)
continue;
// Figure out the days, hours and minutes.
$timeDays = floor($row_members['totalTimeLoggedIn'] / 86400);
$timeHours = floor(($row_members['totalTimeLoggedIn'] % 86400) / 3600);
// Figure out which things to show... (days, hours, minutes, etc.)
$timelogged = '';
if ($timeDays > 0)
$timelogged .= $timeDays . $txt['totalTimeLogged5'];
if ($timeHours > 0)
$timelogged .= $timeHours . $txt['totalTimeLogged6'];
$timelogged .= floor(($row_members['totalTimeLoggedIn'] % 3600) / 60) . $txt['totalTimeLogged7'];
$context['top_time_online'][] = array(
'id' => $row_members['ID_MEMBER'],
'name' => $row_members['realName'],
'time_online' => $timelogged,
'seconds_online' => $row_members['totalTimeLoggedIn'],
'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
);
if ($max_time_online < $row_members['totalTimeLoggedIn'])
$max_time_online = $row_members['totalTimeLoggedIn'];
}
mysql_free_result($members_result);
foreach ($context['top_time_online'] as $i => $member)
$context['top_time_online'][$i]['time_percent'] = round(($member['seconds_online'] * 100) / $max_time_online);
// Cache the ones we found for a bit, just so we don't have to look again.
if ($temp !== $temp2)
cache_put_data('stats_total_time_members', $temp2, 480);
//Yeah baby give me some colors =).
if (!empty($MemberColor_ID_MEMBER)) {
//Now Load the Missing global :)
global $user_profile;
loadMemberData($MemberColor_ID_MEMBER);
$cmemcolid = NULL;
if (!empty($modSettings['MemberColorStats'])) {
// max.online olanlar
foreach($context['top_time_online'] as $key => $value) {
$cmemcolid = $context['top_time_online'][$key]['id'];
$profile = &$user_profile[$cmemcolid];
if(!empty($profile['member_group_color']) || !empty($profile['post_group_color']))
$context['top_time_online'][$key]['link'] = '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '"><font color="'.(!empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color']).'">' . $profile['realName'] . '</font></a>';
}
}
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember'])) {
$profile = &$user_profile[$modSettings['latestMember']];
if(!empty($profile['member_group_color']) || !empty($profile['post_group_color']))
$context['latest_member']['link'] = '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '"><font color="'.(!empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color']).'">' . $profile['realName'] . '</font></a>';
}
}
boardindex.template.php de
// Here's where the "Info Center" starts...
üstüne ekle
// Full istatistikler . . .
echo '<br><div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor"><tr>
<td width="100%" colspan="5" class="catbg" height="24">
<font color="#FFFFFF"><b>FuLL - TOP 10</b></font></td> </tr>
<tr class="titlebg"><span class="smalltext">
<td width="16%"><span class="smalltext">Top 10 Mesaj</font></td>
<td width="16%"><span class="smalltext">Top 10 Karma</font></td>
<td width="26%"><span class="smalltext">Top 10 Online </font></td>
<td width="16%"><span class="smalltext">Top 10 Konu </font></td>
<td width="26%"><span class="smalltext">Top 10 Popüler Konu</font></td></tr>
<tr class="windowbg">
<td width="16%" valign="top"><table width="100%"><tr>
<td width="75%" class="windowbg2"><b><span class="smalltext"><u>Üye</u></font></b></td>
<td width="25%" class="windowbg2" align="right"><span class="smalltext"><b><u>Mesaj</u></b></td></tr><tr>';
foreach ($context['top_posters'] as $poster)
{echo '
<td width="75%" class="windowbg2"><span class="smalltext"><img src="', $settings['images_url'], '/1top10.gif" />', $poster['link'], '</td>
<td width="25%" class="windowbg2" align="right"><span class="smalltext">', $poster['num_posts'], '</td></tr>';
}echo '</table></td>
<td width="16%" valign="top"><table width="100%"class="windowbg" ><tr>
<td width="75%" class="windowbg2"><span class="smalltext"><b><u>Üye</u></b></td>
<td width="25%" class="windowbg2" align="right"><span class="smalltext"><b><u>Karma</u></b></td></tr><tr>';
foreach ($context['karma'] as $poster)
{echo '
<td width="75%" class="windowbg2" valign="top"><span class="smalltext"><img src="', $settings['images_url'], '/2top10.gif" />',$poster['link'], '</td>
<td width="25%" class="windowbg2" align="right" valign="top"><span class="smalltext"><center>',$poster['karma'], '</center></td></tr>';
}echo '</table></td>
<td width="26%" valign="top"><table width="100%"class="windowbg" ><tr>
<td width="30%" class="windowbg2"><span class="smalltext"><b><u>Üye</u></b></td>
<td width="70%" class="windowbg2" align="right"><span class="smalltext"><center><b><u>Sure</u></b></center></td></tr><tr>';
foreach ($context['top_time_online'] as $poster)
{echo '
<td width="30%" class="windowbg2" valign="top"><span class="smalltext"><img src="', $settings['images_url'], '/2top10.gif" />',$poster['link'], '</td>
<td width="70%" class="windowbg2" align="right" valign="top"><span class="smalltext">',$poster['time_online'], '</td></tr>';
}echo '</table></td>
<td width="16%" valign="top"><table width="100%"class="windowbg" ><tr>
<td width="75%" class="windowbg2"><span class="smalltext"><b><u>Üye</u></b></td>
<td width="25%" class="windowbg2" align="right"><span class="smalltext"><center><b><u>Konu</u></b></center></td></tr><tr>';
foreach ($context['top_starters'] as $poster)
{echo '
<td width="75%" class="windowbg2" valign="top"><span class="smalltext"><img src="', $settings['images_url'], '/3top10.gif" />', $poster['link'], '</td>
<td width="25%" class="windowbg2" align="right" valign="top"><span class="smalltext"><center>',$poster['num_topics'], '</center></td></tr>';
}echo '</table></td>
<td width="26%" valign="top"><table width="100%"class="windowbg" ><tr>
<td width="80%" class="windowbg2"><span class="smalltext"><b><u>Konu</u></b></td>
<td width="20%" class="windowbg2" align="right"><span class="smalltext"><center><b><u>Hit</u></b></center></td></tr><tr>';
foreach ($context['top_topics_views'] as $topic)
{echo '
<td width="80%" class="windowbg2" valign="top"><span class="smalltext"><img src="', $settings['images_url'], '/4top10.gif" />', $topic['link'], '</td>
<td width="20%" class="windowbg2" align="right" valign="top"><span class="smalltext"><center>', $topic['num_views'], '<img src="', $settings['images_url'], '/ivan_hit.gif" /></center></td></tr>';
}echo '</table></td></tr>';
echo '<tr class="windowbg">
<td width="100%"colspan="5" height="0"><table width="100%"><tr>
<tr class="titlebg"><span class="smalltext">
<td width="32%"><span class="smalltext"><b><u>Yanitlanan Kategori</u></b></td>
<td width="28%"><span class="smalltext"><b><u>Yanitlanan Konu</u></b></td>
<td width="7%"><span class="smalltext"><center><b><u>Hit</u></b></center></td>
<td width="15%"><span class="smalltext"><b><u>Gönderen</u></b></td>
<td width="18%"><b><span class="smalltext"><u>Tarih</u></b></td></tr> </table>
<table cellspacing="1" width="100%" cellpadding="0" border="0"><tr>';
foreach ($context['latest_posts'] as $post)
echo '
<td class="windowbg2" valign="top" width="32%"><span class="smalltext"><img src="', $settings['images_url'], '/6top10.gif" />', $post['board']['link'], '</td>
<td class="windowbg2" valign="top" width="28%"><span class="smalltext"><img src="', $settings['images_url'], '/7top10.gif" /><a href="',$post['href'],'">', $post['short_subject'], '</td>
<td class="windowbg2" valign="top" width="8%"><span class="smalltext"><center>', $post['ivan_hit'], '<img src="', $settings['images_url'], '/ivan_hit.gif" /></center></td>
<td class="windowbg2" valign="top" width="15%"><span class="smalltext"><img src="', $settings['images_url'], '/8top10.gif" />', $post['poster']['link'],'</td>
<td class="windowbg2" valign="top" width="18%"><span class="smalltext"><img src="', $settings['images_url'], '/9top10.gif" />', $post['time'], '</td></tr>';
echo '</table></td></tr></table></div>'