[ Príspevok: 1 ] 
AutorSpráva
Offline

Prevádzkovateľ fóra
Prevádzkovateľ fóra
Last visit

Registrovaný: 01.05.05
Príspevky: 13414
Témy: 1496 | 1496
Bydlisko: Bratislava
NapísalOffline : 13.10.2006 9:15 | Last visit

Kód:
##############################################################
## MOD Title:          Last visit
## MOD Author:         Niels < ncr@db9.dk > (Niels Chr. Rřd) http://mods.db9.dk
## MOD Description:    This mod will register when the user last
##                     logged in, allong with the info about how
##                     many users have visited the board.
## MOD Version:        1.2.8
## MOD Compatibility:  2.0.5->2.0.6
##
## Installation Level: Intermediate
## Installation Time:  25 minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:      14
##      index.php
##      memberlist.php
##      search.php
##      admin/admin_board.php
##      includes/functions.php
##      includes/page_header.php
##      includes/sessions.php
##      includes/usercp_viewprofile.php
##      language/lang_english/lang_admin.php
##      language/lang_english/lang_main.php
##      templates/subSilver/index_body.tpl
##      templates/subSilver/member_body.tpl   
##      templates/subSilver/profile_view_body.tpl 
##      templates/subSilver/admin/board_config_body.tpl   
##
## Included Files:     0
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/
##############################################################
## Author Notes:
##
## 1. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 1.1 SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then delete it from the phpBB root directory.
##
## Please, do it NOW! Before editing phpBB files by EM or manually!!!
## Otherwise, you may have an error message during your next
## connection.
##
## 1.2 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
##
## 2. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=5
##
##############################################################
## MOD History:
##
##   2003-12-15 - Version 1.2.8
##      - phpBB template & EasyMOD compliance enhancement
##      - Chinese Traditional Taiwan, Danish, Deutsch, Dutch,
##        French, Hungarian, Italian, Polish & Thai translations
##        now provide with the MOD
##
##   2003-08-10 - Version 1.2.7
##      - search.php was missing - now added again
##
##   2003-08-10 - Version 1.2.6
##      - Merge part 1, 2, 3 & 4
##      - Add French translation if needed
##      - Update instructions to work with 2.0.5/2.0.6
##      - How-to rewrite to be EasyMOD compatible
##
##   ????-??-?? - Version 1.2.5
##      - change the code in index.php - minor speed different
##
##   ????-??-?? - Version 1.2.4
##      - add, posibilty to log guest users time
##
##   ????-??-?? - Version 1.2.3
##      - removed som added code in session.php
##
##   ????-??-?? - Version 1.2.2
##      - fixed that guest users was not counted rigth if
##        mixed timezones
##
##   ????-??-?? - Version 1.2.1
##      - typo, missed a comma in session.php
##
##   ????-??-?? - Version 1.2.0
##      - BETA for phpBB2 version 2.0.2.
##
##   ????-??-?? - Version 1.0.19
##      - guest was still beeing reset, new change to
##        session.php $dato
##
##   ????-??-?? - Version 1.0.18
##      - fixed session.php that guest users are reset from
##        the "today list"
##
##   ????-??-?? - Version 1.0.17
##      - moved some changes from page_header.php over to
##        index.php, for incresed performance
##
##   ????-??-?? - Version 1.0.16
##      - missed something in the page_header.php file
##
##   ????-??-?? - Version 1.0.15
##      - added extra feature, that how meny guest visited
##        the board today are also countet
##
##   ????-??-?? - Version 1.0.14
##      - fixed that the language part was missing from the
##        last hour addition
##
##   ????-??-?? - Version 1.0.13
##      - Now includes the number of users witch have visited
##        the board the last hour
##
##   ????-??-?? - Version 1.0.12
##      - corection to follow phpBB2 coding guidelines
##
##   ????-??-?? - Version 1.0.11
##      - corrected a typo in how timezones are handled
##
##   ????-??-?? - Version 1.0.10
##      - History started, change in how timezones are handled
##
##   ????-??-?? - Version 1.0.0
##      - initial release for RC-2
##
##   ????-??-?? - Version 0.9.0
##      - initial BETA for RC-2
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy last_visit_db_update.php to last_visit_db_update.php

#
# This MOD need a database update.
# Then, as you must have now copied the last_visit_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir/last_visit_db_update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#

#
#-----[ OPEN ]------------------------------------------------
#
index.php

#
#-----[ FIND ]------------------------------------------------
#
//
// Start output of page

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Last visit MOD
$time_now=time();
$time1Hour=$time_now-3600;
$minutes = date('is', $time_now);
$hour_now = $time_now - (60*($minutes[0].$minutes[1])) - ($minutes[2].$minutes[3]);
$dato=create_date('H', $time_now,$board_config['board_timezone']);
$timetoday = $hour_now - (3600*$dato);
$sql = 'SELECT session_ip, MAX(session_time) as session_time FROM '.SESSIONS_TABLE.' WHERE session_user_id="'.ANONYMOUS.'" AND session_time >= '.$timetoday.' AND session_time< '.($timetoday+86399).' GROUP BY session_ip';
if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, "Couldn't retrieve guest user today data", "", __LINE__, __FILE__, $sql);
while( $guest_list = $db->sql_fetchrow($result))
{
   if ($guest_list['session_time'] >$time1Hour) $users_lasthour++;
}
$guests_today = $db->sql_numrows($result);
$sql = 'SELECT user_id,username,user_allow_viewonline,user_level,user_lastlogon FROM ' . USERS_TABLE . ' WHERE user_id!="'.ANONYMOUS.'" AND user_session_time >= '.$timetoday.' AND user_session_time< '.($timetoday+86399).' ORDER BY username';
if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, "Couldn't retrieve user today data", "", __LINE__, __FILE__, $sql);
while( $todayrow = $db->sql_fetchrow($result))
{
   $style_color = "";
   if ($todayrow['user_lastlogon']>=$time1Hour)
   {
      $users_lasthour++;
   }
   switch ($todayrow['user_level'])
   {
      case ADMIN :
            $todayrow['username'] = '<b>' . $todayrow['username'] . '</b>';
            $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
         break;
      case MOD :
            $todayrow['username'] = '<b>' . $todayrow['username'] . '</b>';
            $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
         break;
   }
    $users_today_list.=( $todayrow['user_allow_viewonline'])?' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $todayrow['user_id']) . '"' . $style_color .'>' . $todayrow['username'] . '</a>,' : (($userdata[user_level]==ADMIN) ? ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $todayrow['user_id']) . '"' . $style_color .'><i>' . $todayrow['username'] . '</i></a>,' : '');
   if (!$todayrow['user_allow_viewonline']) $logged_hidden_today++;
   else $logged_visible_today++;
}
if ($users_today_list)
{
   $users_today_list[ strlen( $users_today_list)-1] = ' ';
} else
{
   $users_today_list = $lang['None'];
}
$total_users_today = $db->sql_numrows($result)+$guests_today;

$users_today_list = $lang['Registered_users'].' ' . $users_today_list;
$l_today_user_s = ($total_users_today) ? ( ( $total_users_today == 1 )? $lang['User_today_total'] : $lang['Users_today_total'] ) : $lang['Users_today_zero_total'];
$l_today_r_user_s = ($logged_visible_today) ? ( ( $logged_visible_today == 1 ) ? $lang['Reg_user_total'] : $lang['Reg_users_total'] ) : $lang['Reg_users_zero_total'];
$l_today_h_user_s = ($logged_hidden_today) ? (($logged_hidden_today == 1) ? $lang['Hidden_user_total'] : $lang['Hidden_users_total'] ) : $lang['Hidden_users_zero_total'];
$l_today_g_user_s = ($guests_today) ? (($guests_today == 1) ? $lang['Guest_user_total'] : $lang['Guest_users_total']) : $lang['Guest_users_zero_total'];
$l_today_users = sprintf($l_today_user_s, $total_users_today);
$l_today_users .= sprintf($l_today_r_user_s, $logged_visible_today);
$l_today_users .= sprintf($l_today_h_user_s, $logged_hidden_today);
$l_today_users .= sprintf($l_today_g_user_s, $guests_today);
// End add - Last visit MOD

#
#-----[ FIND ]------------------------------------------------
#
'FORUM_LOCKED_IMG' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
'USERS_TODAY_LIST' => $users_today_list,

'L_USERS_LASTHOUR' =>($users_lasthour)?sprintf($lang['Users_lasthour_explain'],$users_lasthour):$lang['Users_lasthour_none_explain'],
'L_USERS_TODAY' =>$l_today_users,
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
memberlist.php

#
#-----[ FIND ]------------------------------------------------
#
$mode_types_text =

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$lang['Sort_Joined']

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, $lang['Last_logon']

#
#-----[ FIND ]------------------------------------------------
#
$mode_types =

#
#-----[ IN-LINE FIND ]----------------------------------------
#
'joindate'

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, 'lastlogon'

#
#-----[ FIND ]------------------------------------------------
#
for($i = 0

#
#-----[ IN-LINE FIND ]----------------------------------------
#
0

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
($userdata['user_level'] == ADMIN ) ? 0:1

#
#-----[ FIND ]------------------------------------------------
#
'L_JOINED' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
'L_LOGON' => $lang['Last_logon'],
// End add - Last visit MOD

#
#-----[ FIND ]------------------------------------------------
#
case 'joined':
$order_by =
break;

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
case 'lastlogon':
   $order_by = ($userdata['user_level'] == ADMIN ) ? "user_lastlogon $sort_order LIMIT $start, " . $board_config['topics_per_page'] : "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
   break;
// End add - Last visit MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT username

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, user_regdate

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_lastlogon, user_allow_viewonline

#
#-----[ FIND ]------------------------------------------------
#
'JOINED' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
'LAST_LOGON' => ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $row['user_allow_viewonline'])) ? (($row['user_lastlogon'])? create_date($board_config['default_dateformat'], $row['user_lastlogon'], $board_config['board_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'],
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
search.php

#
#-----[ FIND ]------------------------------------------------
#
      $sql = "SELECT session_id
         FROM " . SESSIONS_TABLE;

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start replacement - Last visit MOD
   $expiry_time = $current_time - $board_config['session_length'];
      $sql = "SELECT session_id
         FROM " . SESSIONS_TABLE ." WHERE session_time>$expiry_time";
// Start replacement - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------------
#
$prune_no = (

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
$hidde_last_logon_yes = ( $new['hidde_last_logon'] ) ? "checked=\"checked\"" : "";
$hidde_last_logon_no = ( !$new['hidde_last_logon'] ) ? "checked=\"checked\"" : "";
// End add - Last visit MOD

#
#-----[ FIND ]------------------------------------------------
#
"L_ENABLE_PRUNE" =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
"L_HIDDE_LAST_LOGON" => $lang['Hidde_last_logon'],
"L_HIDDE_LAST_LOGON_EXPLAIN" => $lang['Hidde_last_logon_expain'],
// End add - Last visit MOD

#
#-----[ FIND ]------------------------------------------------
#
"PRUNE_NO" =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
"HIDDE_LAST_LOGON_YES" => $hidde_last_logon_yes,
"HIDDE_LAST_LOGON_NO" => $hidde_last_logon_no,
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Last visit MOD
function make_hours($base_time)
{
   global $lang;
   $years = floor($base_time/31536000);
   $base_time = $base_time - ($years*31536000);
   $weeks = floor($base_time/604800);
   $base_time = $base_time - ($weeks*604800);
   $days = floor($base_time/86400);
   $base_time = $base_time - ($days*86400);
   $hours = floor($base_time/3600);
   $base_time = $base_time - ($hours*3600);
   $min = floor($base_time/60);
   $sek = $base_time - ($min*60);
   if ($sek<10) $sek ='0'.$sek;
   if ($min<10) $min ='0'.$min;
   if ($hours<10) $hours ='0'.$hours;
   $result=(($years)?$years.' '.(($years==1)?$lang['Year']:$lang['Years']).', ':'').
   (($years || $weeks)?$weeks.' '.(($weeks==1)?$lang['Week']:$lang['Weeks']).', ':'').
   (($years || $weeks || $days) ? $days.' '.(($days==1)?$lang['Day']:$lang['Days']).', ':'').
   (($hours)?$hours.':':'00:').(($min)?$min.':' :'00:').$sek;
   return ($result)?$result:$lang['None'];
}
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------------
#
//
// Get basic

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Last visit MOD
if ( !$userdata['user_level']==MOD )
{
   $template->assign_block_vars('switch_user_is_not_moderator', array());
} else
{
   $template->assign_block_vars('switch_user_is_moderator', array());
}
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------------
#
if (
{// (
$last_visit = (

$sql = "UPDATE " . USERS_TABLE . "
SET

#
#-----[ IN-LINE FIND ]----------------------------------------
#
if

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//

#
#-----[ IN-LINE FIND ]----------------------------------------
#
{

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//

#
#-----[ IN-LINE FIND ]----------------------------------------
#
user_lastvisit = $last_visit

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_lastlogon = " . time() .  ", user_totallogon=user_totallogon+1

#
#-----[ FIND ]------------------------------------------------
#
$sessiondata['userid'] = $user_id;
}

#
#-----[ IN-LINE FIND ]----------------------------------------
#
}

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//

#
#-----[ FIND ]------------------------------------------------
#
if ( !empty($session_id) )
{

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
$expiry_time = $current_time - $board_config['session_length'] ;
// End add - Last visit MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT u.*, s.*
FROM
WHERE
AND

#
#-----[ IN-LINE FIND ]----------------------------------------
#
";

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
 AND session_time > $expiry_time

#
#-----[ FIND ]------------------------------------------------
#
if ( $userdata['user_id'] != ANONYMOUS )
{
$sql =
SET

#
#-----[ IN-LINE FIND ]----------------------------------------
#
if

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//

#
#-----[ IN-LINE FIND ]----------------------------------------
#
{

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$thispage_id

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_totalpages = user_totalpages+1, user_totaltime = user_totaltime+($current_time-".$userdata['session_time'].")

#
#-----[ FIND ]------------------------------------------------
#
}

//
// Delete expired sessions

#
#-----[ IN-LINE FIND ]----------------------------------------
#
}

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//

#
#-----[ FIND ]------------------------------------------------
#
WHERE session_time < $expiry_time

#
#-----[ IN-LINE FIND ]----------------------------------------
#
session_time < $expiry_time

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
UNIX_TIMESTAMP() - session_time >=172800

#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------------
#
'JOINED' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Last visit MOD
'L_LOGON' => $lang['Last_logon'],
'LAST_LOGON' => ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $profiledata['user_allow_viewonline'])) ? (($profiledata['user_lastlogon'])? create_date($board_config['default_dateformat'], $profiledata['user_lastlogon'], $board_config['board_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'],

'L_TOTAL_ONLINE_TIME' => $lang['Total_online_time'],
'TOTAL_ONLINE_TIME' => make_hours($profiledata['user_totaltime']),
'L_LAST_ONLINE_TIME' => $lang['Last_online_time'],
'LAST_ONLINE_TIME' => make_hours($profiledata['user_session_time']-$profiledata['user_lastlogon']),
'L_NUMBER_OF_VISIT' => $lang['Number_of_visit'],
'NUMBER_OF_VISIT' => ($profiledata['user_totallogon']>0) ? $profiledata['user_totallogon']: $lang['None'],
'L_NUMBER_OF_PAGES' => $lang['Number_of_pages'],
'NUMBER_OF_PAGES' => ($profiledata['user_totalpages']) ? $profiledata['user_totalpages']: $lang['None'],
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Last visit MOD
$lang['Hidde_last_logon'] = "Hidden last logon time";
$lang['Hidde_last_logon_expain'] = "If this is set to yes, users last logon time, is hidden to other users except administrators";
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#
 
// Start add - Last visit MOD
$lang['Last_logon'] = 'Last Visit';
$lang['Hidde_last_logon'] = 'Hidden';
$lang['Never_last_logon'] = 'Never';
$lang['Users_today_zero_total'] = 'In total <b>0</b> users have visited this site today :: ';
$lang['Users_today_total'] = 'In total <b>%d</b> user have visited this site today :: ';
$lang['User_today_total'] = 'In total <b>%d</b> users have visited this site today :: ';
$lang['Users_lasthour_explain'] = ', %d of them within the last hour.';
$lang['Users_lasthour_none_explain'] = ''; //showen of none have visited the last hour, fill if you like

$lang['Years'] = 'Years';
$lang['Year'] = 'Year';
$lang['Weeks'] = 'Weeks';
$lang['Week'] = 'Week';
$lang['Day'] = 'Day';
$lang['Total_online_time'] = 'Total Online Duration';
$lang['Last_online_time'] = 'Last Online Duration';
$lang['Number_of_visit'] = 'Number of visits';
$lang['Number_of_pages'] = 'Number of page hits';
// End add - Last visit MOD

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
rowspan

#
#-----[ IN-LINE FIND ]----------------------------------------
#
rowspan="2"

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
rowspan="3"

#
#-----[ FIND ]------------------------------------------------
#
{NEWEST_USER}</span>
</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Last visit MOD -->
<tr>
   <td class="row1" align="left"><span class="gensmall">{L_USERS_TODAY}&nbsp;{L_USERS_LASTHOUR}<br />{USERS_TODAY_LIST}</br></span></td>   
</tr>
<!-- Start add - Last visit MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/memberlist_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
{L_POSTS}

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Last visit MOD -->
<th class="thTop" nowrap="nowrap">{L_LOGON}</th>
<!-- End add - Last visit MOD -->

#
#-----[ FIND ]------------------------------------------------
#
{memberrow.POSTS}

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Last visit MOD -->
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.LAST_LOGON}</span></td>
<!-- End add - Last visit MOD -->
   
#
#-----[ FIND ]------------------------------------------------
#
<td class="catBottom"

#
#-----[ IN-LINE FIND ]----------------------------------------
#
colspan="8"

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
colspan="9"

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td width="100%"><b><span class="gen">{JOINED}</span></b></td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Last visit MOD -->
<tr>
   <td valign="middle" align="right"><span class="gen">{L_LOGON}:&nbsp;</span></td>
   <td width="100%"><b><span class="gen">{LAST_LOGON}</span></b></td>
</tr>
<!-- BEGIN switch_user_is_moderator -->
<tr>
  <td valign="middle" align="right"><span class="gen">{L_TOTAL_ONLINE_TIME}:&nbsp;</span></td>
  <td width="100%"><b><span class="gen">{TOTAL_ONLINE_TIME}</span></b></td>
</tr>
<tr>
  <td valign="middle" align="right"><span class="gen">{L_LAST_ONLINE_TIME}:&nbsp;</span></td>
  <td width="100%"><b><span class="gen">{LAST_ONLINE_TIME}</span></b></td>
</tr>
<tr>
  <td valign="middle" align="right"><span class="gen">{L_NUMBER_OF_VISIT}:&nbsp;</span></td>
  <td width="100%"><b><span class="gen">{NUMBER_OF_VISIT}</span></b></td>
</tr>
<tr>
<td valign="middle" align="right"><span class="gen">{L_NUMBER_OF_PAGES}:&nbsp;</span></td>
<td width="100%"><b><span class="gen">{NUMBER_OF_PAGES}</span></b></td>
</tr>
<!-- END switch_user_is_moderator -->
<!-- End add - Last visit MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
{PRUNE_NO} /> {L_NO}</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Last visit MOD -->
<tr>
   <td class="row1">{L_HIDDE_LAST_LOGON}<br /><span class="gensmall">{L_HIDDE_LAST_LOGON_EXPLAIN}</span></td>
   <td class="row2"><input type="radio" name="hidde_last_logon" value="1" {HIDDE_LAST_LOGON_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="hidde_last_logon" value="0" {HIDDE_LAST_LOGON_NO} /> {L_NO}</td>
</tr>
<!-- End add - Last visit MOD -->

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM


last_visit_db_update.php
Kód:
<?php
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. R?# Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.8
##
## phpBB2 database update script for mods
## this file is intended to use with phpBB2, when installing mods
## after so you may delete this file, but only admin can use so it really doesen't matter
## The script will look what prefix you are using, and use the existing DB defined by congig.php
## The execution of this script's included SQL is harmless, so you can run it as meny times you like
## note, though that the users last visit, will be set back to his/her last login,
## but that is a minor cosmetic isue, that will correct it self next time the use  logs in
##
## the following example are from my mods, and you can add some self, for other mods if you like
## you will after execution get a list over those commands that are run with succes and those with warnings !
## delete the sample lines if you are using it only for other mods
##
#########################################################

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'ALTER TABLE '.USERS_TABLE.' ADD user_lastlogon INT (11) DEFAULT "0" not null',
'UPDATE '.USERS_TABLE.' SET user_lastlogon=user_lastvisit WHERE user_lastlogon="0"',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("hidde_last_logon", "0")',
'ALTER TABLE ' . USERS_TABLE .' ADD user_totaltime INT (11) DEFAULT "0"',
'ALTER TABLE ' . USERS_TABLE .' ADD user_totallogon INT (11) DEFAULT "0"',
'ALTER TABLE ' . USERS_TABLE .' ADD user_totalpages INT (11) DEFAULT "0"',
'UPDATE '. USERS_TABLE .' SET user_totaltime=(user_session_time-user_lastlogon) WHERE user_totaltime="0" AND user_lastlogon>0',
'UPDATE '. USERS_TABLE .' SET user_totallogon=1 WHERE user_totallogon="0" AND user_session_time<>"0"'
);


$mods = array (
'Last Visit PART 1 Mod','Last Visit PART 1 Mod','Last Visit PART 2 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod'
);

############################################### Do not change anything below this line #######################################

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

if ($userdata['user_level']!=ADMIN)
      message_die(GENERAL_ERROR, "You are not Authorised to do this");
$n=0;
$message="<b>This list is a result of the SQL queries needed for MOD</b><br/><br/>";
while($sql[$n])
{
   $message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
   if(!$result = $db->sql_query($sql[$n]))
   $message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
   else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
   $n++;
}
 message_die(GENERAL_MESSAGE, $message);
?>


_________________
Streacom DA2 | SilverStone Titanium SX800-LTI 800W | ASRock X299E-ITX/ac | Intel Core i9-9980XE & be quiet! Dark Rock TF | Kingston HyperX Impact 64 GB DDR4 2666 MHz | NVIDIA Titan RTX 24 GB | Intel SSD Optane 905P 480 GB NVMe U.2 & Intel SSD 750 1,2 TB NVMe U.2 & Intel SSD 660p 2 TB NVMe M.2 & Seagate BackUp Plus Portable 56 TB USB | 55" 4K OLED Dell Alienware AW5520QF | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech G603 | Logitech F710 | Harman Kardon Sabre SB 35 & Sennheiser RS 175 | Microsoft Windows 11 Enterprise | APC Back-UPS BE-850 VA | Lenovo ThinkPad X250 & Microsoft Windows 11 Professional | iPhone 15 Pro 256 GB & Pitaka Aramid | SilverStone ML05B Milo | Corsair SF600 SFX 600W | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 & NOCTUA NH-L12S | Kingston HyperX Savage 32 GB DDR4 2400 MHz | NVIDIA GeForce GT 710 1 GB | Intel SSD Optane Memory 32 GB NVMe M.2 & Intel SSD 730 240 GB SATA | Ubuntu 24.04.1 LTS
 [ Príspevok: 1 ] 


Last visit



Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy.

Last.fm

v Sieťové a internetové programy

0

1028

09.03.2006 14:59

Pekaboo

V tomto fóre nie sú ďalšie neprečítané témy.

Last post info

v Redakčné systémy

0

726

14.10.2006 14:54

JanoF

V tomto fóre nie sú ďalšie neprečítané témy.

Metro: Last Light

v Počítačové hry

1

513

19.09.2011 6:32

patrikos68

V tomto fóre nie sú ďalšie neprečítané témy.

The Last Ninja

v Počítačové hry

2

700

07.02.2008 2:04

sergi80

V tomto fóre nie sú ďalšie neprečítané témy.

Metro: Last Light

[ Choď na stránku:Choď na stránku: 1 ... 6, 7, 8 ]

v Počítačové hry

225

5607

08.11.2013 10:58

Ingenium Deerro

V tomto fóre nie sú ďalšie neprečítané témy.

Last x hours registrations

v Redakčné systémy

2

608

23.10.2006 22:40

JanoF

Táto téma je zamknutá, nemôžete posielať nové príspevky alebo odpovedať na staršie.

P/I: Metro: Last Light

v Predám

8

559

21.10.2013 18:48

Only Human

V tomto fóre nie sú ďalšie neprečítané témy.

Posts in Last 24 Hours

v Redakčné systémy

0

585

14.10.2006 15:03

JanoF

V tomto fóre nie sú ďalšie neprečítané témy.

P: Metro Last Light (kupon)

v Predám

10

628

04.06.2013 21:51

pipo137

V tomto fóre nie sú ďalšie neprečítané témy.

K:Metro:Last Light Cz

v Kúpim

1

395

12.05.2013 15:25

Koroner

Táto téma je zamknutá, nemôžete posielať nové príspevky alebo odpovedať na staršie.

P: Metro Last Light (STEAM)

v Predám

19

1010

16.05.2013 20:37

Rainmaker

V tomto fóre nie sú ďalšie neprečítané témy.

METRO 2033: The Last Refuge

v Predám

0

327

19.06.2013 10:14

pedge

V tomto fóre nie sú ďalšie neprečítané témy.

P:The Last of Us

v Predám

0

627

26.01.2014 14:13

backy6

V tomto fóre nie sú ďalšie neprečítané témy.

Pcforum group na last.fm

v Krčma

11

1600

18.01.2009 19:09

br4n0

V tomto fóre nie sú ďalšie neprečítané témy.

P/I: Metro: Last light kupon

v Predám

4

341

12.06.2013 22:26

peter360

V tomto fóre nie sú ďalšie neprečítané témy.

The Fall - Last days of Gaia

v Počítačové hry

0

720

03.03.2007 10:38

edkis



© 2005 - 2024 PCforum, edited by JanoF