Kód:
#################################################################
## Mod Title: Last x hours registrations
## Mod Version: 1.0
## Author: dzidzius (you can find me at forum www.ForumBest.150.pl, there send all questions)
## Description:
## This mods adds user names list that registered in last x(you can defined it) hours
## under last registered user name.
## Installation Level: easy
## Installation Time: 2
## Files To Edit:
##
## index.php,
## templates\subSilver\index_body.tpl,
## Generator: phpBB2 phpBB MODCreator v 1.1
#################################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
#################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
#################################################################
##
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ OPEN ]------------------------------------------
#
# index.php
#
#-----[ FIND ]------------------------------------------
#
# //
# // Start output of page
# //
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Begin Last x hours registrations MOD
//
$new_user_list = '';
$number_of_hours = 48;
$sql = "SELECT user_id, username, user_regdate
FROM " . USERS_TABLE . "
ORDER BY user_regdate DESC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
if ( $row['user_regdate'] >= ( time() - $number_of_hours*3600 ) )
$new_user_list .= ($new_user_list !='') ? ', <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>' : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>';
else break;
}
$new_user_list = ($new_user_list != '') ? 'In last ' . $number_of_hours . ' hours registered: ' . $new_user_list : 'There are no new users in last ' . $number_of_hours . ' hours';
$db->sql_freeresult($result);
//
// End Last x hours registrations MOD
//
#
#-----[ FIND ]------------------------------------------
#
# 'FORUM_IMG' => $images['forum'],
#
#-----[ BEFORE, ADD ]------------------------------------------
#
# 'NEW_USERS_LAST_DAYS' => $new_user_list,
#
#-----[ OPEN ]------------------------------------------
#
# templates\subSilver\index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
# <td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
#
#-----[ REPLACE WITH ]------------------------------------------
#
# <td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}<br />{NEW_USERS_LAST_DAYS}</span>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM