- Home
- Categorie
- Coding e Sistemistica
- Gestione di Forum
- errote user the day template
-
errote user the day template
[php]
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="bottom"><span class="gensmall">
<!-- BEGIN switch_user_logged_in -->
{LAST_VISIT_DATE}<br />
<!-- END switch_user_logged_in -->
{CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
<td align="right" valign="bottom" class="gensmall">
<!-- BEGIN switch_user_logged_in -->
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
<!-- END switch_user_logged_in -->
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
</tr>
</table><table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th>
<th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- BEGIN catrow -->
<tr>
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
<td class="rowpic" colspan="3" align="right"> </td>
</tr>
<!-- BEGIN forumrow -->
<tr>
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
</tr>
<!-- END forumrow -->
<!-- END catrow -->
</table><table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
<tr>
<td align="left">
<!-- BEGIN switch_user_logged_in -->
<span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a></span>
<!-- END switch_user_logged_in -->
</td>
<td align="right"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
</table><table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
</tr>
<!--
<tr>
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}<br />{VISIT_COUNTER}</span>
</td>
</tr>
-->
<tr>
<td class="row1" align="center" valign="middle" rowspan="3"><span class="mainmenu">{L_NAME_WELCOME}</span><BR /><span class="mainmenu">{U_NAME_LINK}</span><BR /><BR />{AVATAR_IMG}</td>
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
</td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} {COLOR_GROUPS_LIST}<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
</tr>
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left"><span class="gensmall">{L_WHOSBIRTHDAY_TODAY}<br />{L_WHOSBIRTHDAY_WEEK}</span></td>
</tr>
<!-- End add - Birthday MOD -->
<!-- BEGIN switch_user_logged_in -->
<tr>
<td colspan="2" class="row1" align="left"><span class="gensmall"><b><a href="{U_RECOMMEND_FORUM}">{L_RECOMMEND_FORUM}</a></b></span></td>
</tr>
<!-- END switch_user_logged_in -->
</table><table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table><!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}:
<input class="post" type="text" name="username" size="10" />
{L_PASSWORD}:
<input class="post" type="password" name="password" size="10" maxlength="32" />
<!-- BEGIN switch_allow_autologin -->
{L_AUTO_LOGIN}
<input class="text" type="checkbox" name="autologin" />
<!-- END switch_allow_autologin -->
<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
</span> </td>
</tr>
</table>
</form>
<!-- END switch_user_logged_out --><br clear="all" />
<table cellspacing="3" border="0" align="center" cellpadding="0">
<tr>
<td width="20" align="center"><img src="templates/subSilver/images/folder_new_big.gif" alt="{L_NEW_POSTS}"/></td>
<td><span class="gensmall">{L_NEW_POSTS}</span></td>
<td> </td>
<td width="20" align="center"><img src="templates/subSilver/images/folder_big.gif" alt="{L_NO_NEW_POSTS}" /></td>
<td><span class="gensmall">{L_NO_NEW_POSTS}</span></td>
<td> </td>
<td width="20" align="center"><img src="templates/subSilver/images/folder_locked_big.gif" alt="{L_FORUM_LOCKED}" /></td>
<td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
</tr>
</table>
[/php]
questo è il codice modificato da me...sapete dirmi come farlo funzionare???:(
-
la mods installata è questa
[php]
########################################################MOD Title: Users of the day
MOD Version: 2.1
Author: ZoZo [email protected]
Description:
Displays, under the online users list, a list of the registered users
who have visited during the last XX hours. Can also display the list
of the users who didn't come. (see "Edit below")
Installation Level: easy
Installation Time: 2-3 minutes
Files To Edit: 3
- /templates/subSilver/index_body.tpl
- /language/lang_english/lang_main.php
- /includes/page_header.php
Included Files: None
########################################################
VERSION HISTORY:
October 22th 2004: v2.1
1. Now admins are displayed first, then mods then users.
2. Corrected a problem in the text file with Easy Mod Installer.
June 20th 2003: v2.0
1. The list's delay is customizable, but you must give a number in hours, 24 by default.
2. There's now a counter for each list.
3. The MOD doesn't display the list of the users who didn't visit by default.
October 28th 2002: v1.1
1. The MOD uses the database variable "user_session_time" instead of "user_lastvisit", which is updated only when the user logs out.
October 15th 2002: v1.0
1. Created main features.
########################################################
TODO LIST:
1. Don't restrict the time unit to hours.
########################################################
PLEASE REPORT ANY BUGS OR SUGGESTIONS
########################################################
#-----[ ACTION: open ]---------------------------------
/templates/subSilver/index_body.tpl
#-----[ ACTION: find ]---------------------------------
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
#-----[ ACTION: replace by ]---------------------------
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
#-----[ ACTION: find ]---------------------------------
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} [ {L_WHOSONLINE_ADMIN} ] [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
#-----[ ACTION: add after ]----------------------------
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{USERS_OF_THE_DAY_LIST}</span></td>#-----[ ACTION: repeat for all templates ]-------------
#-----[ ACTION: open ]--------------------------------
/language/lang_english/lang_main.php
#-----[ ACTION: find ]--------------------------------
$lang['Registered_users'] = 'Registered Users:';
#-----[ ACTION: add before ]--------------------------
$lang['Day_users'] = '%d registered users visit during the last %d hours:';
$lang['Not_day_users'] = '%d registered users <span style="color:red">DIDN'T</span> visit during the last %d hours:';#-----[ ACTION: repeat for all languages ]------------
#-----[ ACTION: open ]--------------------------------
/includes/page_header.php
#-----[ ACTION: find ]--------------------------------
'LOGGED_IN_USER_LIST' => $online_userlist,
#-----[ ACTION: add after ]---------------------------
'USERS_OF_THE_DAY_LIST' => $day_userlist,
#-----[ ACTION: find ]--------------------------------
//
// Obtain number of new private messages
// if user is logged in
//#-----[ ACTION: add before ]--------------------------
//
// Users of the day MOD
//// ############ Edit below ############
// #
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 24; // change here to the number of hours wanted for the list
// #
// ############ Edit above ############$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', LINE, FILE, $sql);
}$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme . '"';
}
if ( $row['user_allow_viewonline'] )
{
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
}
else
{
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
}
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{
$day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$day_users++;
}
else
{
$not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$not_day_users++;
}
}
}$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;
$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;
if ( $display_not_day_userlist )
{
$day_userlist .= '<br />' . $not_day_userlist;
}//
// End of MOD
//#-----[ ACTION: save/close all ]----------------------
#-----[ ACTION: upload the modified files ]-----------
#-----[ ACTION: enjoy ]-------------------------------
#-----[ PLEASE REPORT ANY BUGS OR SUGGESTIONS]--------
[/php]
-
è estremamente elementare questa installazione