LAST VISIT MOD FULLY WORKING VERSION FOR PHPBB 2.0.18

This mod will register when the user last logged in, allong with the info about how meny users have visited the board

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby acoolwelshbloke on Wed 21. Dec, 2005 18:19

Billy has provided the file you need I sujest you take a look at it or reinstall the mod on the index.php file.

Here are the instructions on what you need to add/alter in the index.php:
Code: Select all
#
#-----[ 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
Last edited by acoolwelshbloke on Wed 21. Dec, 2005 18:20, edited 1 time in total.
www.thegamersforums.com
<b><u>For All Your Gaming Needs!</u></b>
acoolwelshbloke
Poster
Poster
 
Posts: 66
Joined: Wed 02. Nov, 2005 15:09

Postby Billy2423 on Wed 21. Dec, 2005 18:19

That on a new indexphp is at line 337 and here it is

Code: Select all
      'FORUM_IMG' => $images['forum'],
      'FORUM_NEW_IMG' => $images['forum_new'],
      'FORUM_LOCKED_IMG' => $images['forum_locked'],

// 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

      'L_FORUM' => $lang['Forum'],
      'L_TOPICS' => $lang['Topics'],
      'L_REPLIES' => $lang['Replies'],
      'L_VIEWS' => $lang['Views'],
      'L_POSTS' => $lang['Posts'],

or post your index and i will fix it for you...
Image
Billy2423
Poster
Poster
 
Posts: 16
Joined: Tue 27. Jan, 2004 00:47
Location: USA

Postby DVD_GR on Wed 21. Dec, 2005 21:42

thanks guys the error in index.php is corrected!thanks a lot!

now I get a error
Parse error: parse error, unexpected ';' in /home/x8x163d/public_html/octech-gr/forum/admin/admin_board.php on line 117

at the attached admin_board
www.octech.gr forum of scientific overclocking
www.2821.gr/indexen.htm visit chania!!!
DVD_GR
Poster
Poster
 
Posts: 12
Joined: Fri 02. Dec, 2005 05:33

Previous

Return to Last visit [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 0 guests

cron