Hallo,
ich habe schon gesehen, dass viele Foren die Top Poster im Footer veröffentlichen.
Ich habe 2 Fragen dazu:
(1) Wo finde ich diesen MOD? (Hab über die suche nichts gefunden)
(2) Kann man den MOD so einstellen, dass er jeweils die Top Post im jeweiligen Forum ermittelt. Ansonsten macht es ja nach paar Monaten keinen Sinn, da die Top Poster feststehen.
Danke für Eure Antworten.
Top User 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.
- DreamPromise
- Mitglied
- Beiträge: 3793
- Registriert: 27.01.2004 17:56
Moin moin
zu 1:
zu 1:
##############################################################
## MOD Title: Top Poster of the Month
## MOD Author: 3Di < 3D@you3d.za.net > (Marco) http://www.phpbb2italia.za.net/phpbb2/index.php
## MOD Author: Dicky < rfoote@tellink.net > (Richard Foote) http://dicky.askmaggymae.com
## MOD Description: Have a Top Poster of the Month to show on your phpBB. Admin not included.
## MOD Version: 0.3.0
##
## Installation Level: (Easy)
## Installation Time: 5 minutes
## Files To Edit:
##
## index.php
## language/lang_english/lang_main.php
## templates/subSilver/index_body.tpl
##
## Included Files:
## N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/
##############################################################
## Author Notes:
##
## tested on a fresh phpBB 2.0.18 (localhost)
##
##############################################################
## MOD History:
##
## 2005-11-02 - Version 0.3.0 beta
## - core code partially re written, elapsed time updated in real time (after refresh).
## - added NoBody fake user in case of no top poster (abandoned board? )
## - added post/posts language bit
##
## 2005-10-28 - Version 0.1.0 beta
## - first public release
##
## 2005-10-27 - Version 0.0.1 alpha
## - first version in localhost
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------------
#
//
// Start page proper
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// -- Top Poster of the Month add --------------
$today = time();
$date_today = gmdate("Y-m-d", $today);
list($year_cur, $month_cur, $day1) = split('-', $date_today);
$month_start_cur = gmmktime (0,0,0, $month_cur, 1, $year_cur); // Start time for current month
$month_end_cur = $today;
$month_start = $month_start_cur;
$month_end = $month_end_cur;
$sql = 'SELECT u.username, u.user_regdate, u.user_id, u.user_posts, p.poster_id, p.post_time, COUNT(p.post_id) AS total_posts
FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p
WHERE (u.user_id <> ' . ANONYMOUS . ')
AND (u.user_id = p.poster_id)
AND (u.user_level <> ' . ADMIN . ')
AND p.post_time BETWEEN ' . $month_start . ' AND ' . $month_end . '
GROUP BY u.user_id
ORDER BY total_posts DESC';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve Top Poster of the Month\'s data', '', __LINE__, __FILE__, $sql);
}
// let's go with the loop
$posts_data = $db->sql_fetchrowset($result);
$num_items = count($posts_data);
$top_posts = $posts_data[0][total_posts]; // The first row will have the most posts since we ordered by total_posts
for ( $row = 0; $row < $num_items; $row++ )
{
while ( list( $key, $value ) = each( $posts_data ) )
{
if ( $value[total_posts] == $top_posts ) // We have a poster with a match of the top_posts
{
$topm_un = $posts_data[0]['username'];
$topm_rd = $posts_data[0]['user_regdate'];
$topm_id = $posts_data[0]['user_id'];
$topm_up = $posts_data[0]['user_posts'];
$topm_tp = $posts_data[0]['total_posts']; // posts made into the selected elapsed time
}
}
}
if ($topm_tp <1)
{
$topm_un = $lang['Top_Username_None'];
}
if ($topm_tp ==1)
{
$lang['Top_Posts'] = $lang['Top_Post'];
}
// -- Top Poster of the Month end --------------
#
#-----[ FIND ]------------------------------------------------
#
'FORUM_LOCKED_IMG' => $images['forum_locked'],
#
#-----[ AFTER, ADD ]-----------------------------------------
#
// --- Top Poster of the Month add -------------
'TOPM_UN' =>sprintf($lang['Top_Username'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$topm_id") . '">', $topm_un, '</a>'),
'TOPM_RD' => $topm_rd,
'TOPM_ID' => $topm_id,
'TOPM_UP' => $topm_up,
// --- Top Poster of the Month end -------------
#
#-----[ FIND ]------------------------------------------------
#
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// --- Top Poster of the Month add -------------
'L_TOPM_UNA_L' => $lang['Top_Username'],
'L_TOPM_UID_L' => $lang['Top_User_ID'],
'L_TOPM_UTP_L' => $lang['Top_User_Posts'],
'L_TOPM_URD_L' => $lang['Top_User_Registration_date'],
'L_TOPM_UPO_L' => sprintf($lang['Top_User_Month_Posts'], $topm_tp),
'L_TOPM_UNN_L' => $lang['Top_Username_None'],
'L_TOPM_POSTS_L' => $lang['Top_Posts'],
// --- Top Poster of the Month end -------------
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// -- Top Poster of the Month add --------------
$lang['Top_Username'] = 'The Top Poster of the Month till this moment is <b>%s%s%s</b>';
$lang['Top_User_Month_Posts'] = ' with a total of <b>%d</b>';
$lang['Top_Posts'] = ' posts';
$lang['Top_Post'] = ' post';
$lang['Top_Username_None'] = '<b>NoBody</b>';
// --- Top Poster of the Month end -------------
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]----------------------------------------
# the line is longer..
<td class="row1" align="center" valign="middle" rowspan="2">
#
#-----[ IN-LINE FIND ]----------------------------------------
#
rowspan="2"
#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
rowspan="3"
#
#-----[ FIND ]----------------------------------------
# the line is longer...
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}
#
#-----[ FIND ]----------------------------------------
#
</tr>
#
#-----[ AFTER, ADD ]----------------------------------
#
<tr>
<td class="row1" align="left"><span class="gensmall">{TOPM_UN}{L_TOPM_UPO_L}{L_TOPM_POSTS_L}</span>
</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
Sowas zb.: Zum Bild