Frage zu Statistic.mod
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
-
- Mitglied
- Beiträge: 1151
- Registriert: 30.01.2006 15:15
- Kontaktdaten:
Frage zu Statistic.mod
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?)
-
- Mitglied
- Beiträge: 1151
- Registriert: 30.01.2006 15:15
- Kontaktdaten:
-
- Mitglied
- Beiträge: 3907
- Registriert: 17.07.2002 14:03
- Wohnort: Graz
Hallo,
das
das
besser nicht, denn es geht nicht um den Statistic MOD an sich, sondern um einen der Statisitk MOD Module (stat_modules)Valerie Raghnall hat geschrieben:vielleicht verlinkst du mal den mod, damit man sich das ansehen kann?

Viele Grüße - gloriosa 
Die einen schützen sich vor frischem Wind, während die anderen ihn nutzen.
Kein kostenloser MOD-Einbau usw. bzw. Support via PN, Email oder IRC !

Die einen schützen sich vor frischem Wind, während die anderen ihn nutzen.
Kein kostenloser MOD-Einbau usw. bzw. Support via PN, Email oder IRC !
-
- Mitglied
- Beiträge: 1151
- Registriert: 30.01.2006 15:15
- Kontaktdaten:
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>
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>
Ersetz die Zeile
durch -->
Code: Alles auswählen
LIMIT ' . $return_limit;
Code: Alles auswählen
LIMIT 0,100';
-
- Mitglied
- Beiträge: 1151
- Registriert: 30.01.2006 15:15
- Kontaktdaten: