IT NEWS PC REVUE PC FORUM FreeBSDInternet time: @146
Obsah fóra
Pravidlá  •  Kontakt  •  Prihlásenie  •  Registrácia

Potrebujete hotovosť?

Vyskúšajte rýchly úver pre každého! K tomu súťaž o auto ŠKODA Fabia. www.proficredit.sk

Prichádza doba elektrická.

Na Slovensku sme využili jedinečnú možnosť a povozili sme sa na autoviny.zoznam.sk

Ako ste stratili hmostnosť.

Zistite jej tajomstvo pre dokonalé telo. Môžete dosiahnuť tieto výsledky tiež. www.janinblog.com

Pre ľahší život

Pozrite sa, ako sa dostať do zdravšej a ľahšej telesnej hmotnosti. www.janinblog.com

Hľadáte jedinečný nábytok?

Vyskúšajte značku Bogfran priamo od dovozcu za nízke ceny. www.najlepsinabytok.sk

Last visit

Zaslať odpoveď
AutorSpráva
JanoF
Správca fóra
Správca fóra

Založený: 01.05.2005
Príspevky: 8736
Bydlisko: Bratislava
Vek: 27

PríspevokZaslal: Pi 13.10.06 9:15Odpovedať s citátomNávrat hore

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);
?>

_________________
Skrinka: Nexus Morpho & Enermax UCTB12P | Zdroj: Enermax EMG800AWT 800W | Základná doska: Asus Rampage III Gene | Procesor: Intel Core i7 990X Extreme Edition 3.46 GHz & Scythe Susanoo SCSO-1000 | Pamäť: Kingston HyperX XMP 24 GB DDR3 1600 MHz | Grafická karta: Asus GeForce GT 440 1 GB DDR3 & Thermalright HR-03 | Pevný disk: Intel SSD 510 Series 250 GB & Hitachi Deskstar 5K4000 4000 GB | Optická mechanika: Plextor PX-820SA | Čítačka kariet: Akasa AK-ICR-11 | Klávesnica: Logitech G19 | Myš: Logitech G9x & Razer Kabuto | Monitor: 24" LCD Eizo FlexScan S2431WE | Reproduktory: Logitech Z-2300 | Operačný systém: Microsoft Windows 7 & FreeBSD 9 | Záložný zdroj: APC Back-UPS ES 700 | Spotreba: Idle - 200W / Burn - 400W | Mobil: Nokia N9 64 GB
Zobraziť informácie o autoroviOdoslať súkromnú správuOdoslať e-mailSkypeFacebookTwitterZobraziť autorove WWW stránky
Zobraziť príspevky z predchádzajúcich:    
Zaslať odpoveď
Nemôžete pridávať nové témy do tohto fóra.
Nemôžete odpovedať na témy v tomto fóre.
Nemôžete upravovať svoje príspevky v tomto fóre.
Nemôžete mazať svoje príspevky v tomto fóre.
Nemôžete hlasovať v tomto fóre.

Powered by phpBB 2.x.x © 2005 - 2012 PCforum, webhosting by WebSupport, edited by JanoF

SEO - optimalizácia pre vyhľadávače

Freebsd