Seite 1 von 1

Frage zu Statistic.mod

Verfasst: 02.03.2006 21:09
von wwwthomasbauerattf
Wie kann man eigentlich einstellen, dass mehr als die Top 10 angezeigt werden... (Z.B. das bei "most loggend on users" nicht die Top 10 sondern die Top 100 angezeigt werden?)

Verfasst: 08.03.2006 11:01
von wwwthomasbauerattf
kann mir da keiner helfen? das kann doch nicht so schwer sein?

Verfasst: 08.03.2006 13:35
von Valerie Raghnall
wenn es nicht so schwer ist, kannst du es doch selber auch, hm?

vielleicht verlinkst du mal den mod, damit man sich das ansehen kann?

Verfasst: 08.03.2006 13:39
von gloriosa
Hallo,
das
Valerie Raghnall hat geschrieben:vielleicht verlinkst du mal den mod, damit man sich das ansehen kann?
besser nicht, denn es geht nicht um den Statistic MOD an sich, sondern um einen der Statisitk MOD Module (stat_modules) :wink:

Verfasst: 08.03.2006 20:06
von wwwthomasbauerattf
schau valerie, ich bin ned grad a php-profi. deshalb frag ich andere ob sie das wissen:

aber, hier ist der most_logged_on_users:
vl kann mir wer sagen, wo man was ändern muss, dass nicht die top 10 angezeigt werden, sondern die z.b. top 100:

module.php:
<?php
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

// DB Cache used here

//
// Top Posting Users
//
$template->assign_vars(array(
'L_RANK' => $lang['Rank'],
'L_TIME'=> $lang['Time'],
'L_PERCENTAGE' => $lang['Percent'],
'L_USERNAME' => $lang['Username'],
'L_GRAPH' => $lang['Graph'],
'MODULE_NAME' => $lang['module_name'])
);

//
// Method 1 to define Vote Bars: Define the Images
//
/*
$bars = array(
'left' => 'images/vote_lcap.gif',
'right' => 'images/vote_rcap.gif',
'bar' => 'images/voting_bar.gif'
);

$statistics->init_bars($bars);
*/

//
// Method 2 to define Vote Bars: Let the Statistics Mod define default Bars
//
$statistics->init_bars();

$sql = "SELECT SUM(user_totaltime) as total_time FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS;

if ( !($result = $stat_db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve users data', '', __LINE__, __FILE__, $sql);
}

$row = $stat_db->sql_fetchrow($result);
$total_time = $row['total_time'];

$sql = 'SELECT user_id, username, user_totaltime
FROM ' . USERS_TABLE . '
WHERE (user_id <> ' . ANONYMOUS . ' ) AND (user_totaltime > 0)
ORDER BY user_totaltime DESC
LIMIT ' . $return_limit;

if ( !($result = $stat_db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve users data', '', __LINE__, __FILE__, $sql);
}

$user_count = $stat_db->sql_numrows($result);
$user_data = $stat_db->sql_fetchrowset($result);

$firstcount = $user_data[0]['user_totaltime'];

for ($i = 0; $i < $user_count; $i++)
{
$class = ($i % 2) ? $theme['td_class2'] : $theme['td_class1'];

$statistics->do_math($firstcount, $user_data[$i]['user_totaltime'], $total_time);

$template->assign_block_vars('users', array(
'RANK' => $i+1,
'CLASS' => $class,
'USERNAME' => $user_data[$i]['username'],
'PERCENTAGE' => $statistics->percentage,
'BAR' => $statistics->bar_percent,
'URL' => append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id']),
'TIME' => make_hours($user_data[$i]['user_totaltime']))
);
}

?>


module.tpl:



<table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%">
<tr>
<td class="catHead" align="center" colspan="5">
<span class="cattitle">{MODULE_NAME}</span>
</td>
</tr>
<tr>
<th colspan="1" class="thCornerL" align="center"><strong>{L_RANK}</strong></th>
<th colspan="1" class="thTop" align="center" width="10%"><strong>{L_USERNAME}</strong></th>
<th colspan="1" class="thTop" align="center" width="20%"><strong>{L_TIME}</strong></th>
<th colspan="1" class="thTop" align="center" width="10%"><strong>{L_PERCENTAGE}</strong></th>
<th colspan="1" class="thCornerR" align="center" width="40%"><strong>{L_GRAPH}</strong></th>
</tr>
<!-- BEGIN users -->
<tr>
<td class="{users.CLASS}" align="left" width="10%"><span class="gen">{users.RANK}</span></td>
<td class="{users.CLASS}" align="left" width="10%"><span class="gen"><a href="{users.URL}">{users.USERNAME}</a></span></td>
<td class="{users.CLASS}" align="center" width="20%"><span class="gen">{users.TIME}</span></td>
<td class="{users.CLASS}" align="center" width="10%"><span class="gen">{users.PERCENTAGE}%</span></td>
<td class="{users.CLASS}" align="left" width="40%">
<table cellspacing="0" cellpadding="0" border="0" align="left">
<tr>
<td align="right"><img src="{LEFT_GRAPH_IMAGE}" width="4" height="12" /></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" align="left" width="{users.BAR}%">
<tr>
<td><img src="{GRAPH_IMAGE}" width="100%" height="12" /></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" align="left">
<tr>
<td align="left"><img src="{RIGHT_GRAPH_IMAGE}" width="4" height="12" /></td>
</tr>
</table>
</td>
</tr>
<!-- END users -->
</table>

Verfasst: 09.03.2006 00:31
von easygo
Ersetz die Zeile

Code: Alles auswählen

LIMIT ' . $return_limit;
durch -->

Code: Alles auswählen

LIMIT 0,100';

Verfasst: 09.03.2006 09:39
von wwwthomasbauerattf
danke für die hilfe...