CommunityAdmins.com - Last visit mod
Talk sports at SportsForums.net
Add Us:   MySpace   Facebook   StumbleUpon
Username:    Password:
Remember Me?    
Last visit mod
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    CommunityAdmins.com Forum Index -> Technical Issues
 See a User Guidelines violation? Please contact us.
Author Message

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/2/2006, 2:13 pm    Post subject: Last visit mod Reply with quote

I am trying to install the last visit mod by and keep running into problems with sessios.php

I am hoping someone that has this mod installed can fix this problem in the mod's instructions which are very ambiguous to say the least.

includes/sessions.php

Code:


#
#-----[ FIND ]------------------------------------------------
#
if ( $user_id != ANONYMOUS )
{
    $last_visit = (

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

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

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

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

#


Now if you follow the instructions it could be edited a number of different ways because the instructions do not give full lines to find.

Edit one would look like this:

Code:
//if ( $user_id != ANONYMOUS )
   //{


edit two like this:

Code:
//if (!$admin) 
       //{


Neither of which I am sure are correct so if you know the correct edit here can you please help me out thanks.

Currently I have the mod installed but without using the eidts on sessions.php and the visits show that the entire 243 members visited the site in the last 24 hours which we know is not true Laughing

Also, avatars are no longer showing but this could be to do with the seesions.php file not being edited so if I can get the correct edit for this file and they still dont work, I will get back to you on that one.
_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/2/2006, 3:08 pm    Post subject: Reply with quote

I guess I should point out the mod version is 1.2.9 by niels and compatible with 2.0.18 (I am on 2.0.19)
_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top

Thoul

Joined: 14 Sep 2005
Posts: 169

PostPosted: 2/2/2006, 3:46 pm    Post subject: Reply with quote

The first edit would be the correct one in this case. I doubt the avatar problem is related to this, but I suppose it's possible.
_________________
Phantasy Star: The Fringes of Algo | phpBB Smith
Back to top

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/2/2006, 10:48 pm    Post subject: Reply with quote

I have tried all manner of editing this file without any luck so here is the code from the mod for editing ... (notice incomplete lines to find) which makes it difficult to work out what to edit exactly.

Can someone please post the EXACT code to find and then what the EXACT edit should look like please ?

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

#
#-----[ FIND ]------------------------------------------------
#
if ( $user_id != ANONYMOUS )
{
    $last_visit = (

#
#-----[ 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 ]---------------------------------
#
//

#
#-----[ FIND ]----------------------------------------
#
     message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
   }
 }

#
#-----[ REPLACE WITH ]---------------------------------
#
      message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
    }
//}

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

#
#-----[ FIND ]------------------------------------------------
#
$sql = 'DELETE FROM ' . SESSIONS_TABLE . '
   WHERE session_time < ' . (time() - (int) $board_config['session_length']) . "
       AND session_id <> '$session_id'";

#
#-----[ REPLACE WITH ]--------------------------------
#
$sql = "DELETE FROM " . SESSIONS_TABLE . "
   WHERE UNIX_TIMESTAMP() - session_time >=172800
       AND session_id <> '$session_id'";

#

_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top

Nick

Joined: 09 Sep 2005
Posts: 775
Location: Next to the stereo

PostPosted: 2/2/2006, 10:52 pm    Post subject: Reply with quote

Oh man, I've had to ask others to install the LVH for me thrice now (none have even started yet...) cause I can't get sessions to work either...

I wish you luck HG.
_________________
[The Smash Syndicate] Ek Pyros - Out of Fire
Back to top

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/2/2006, 11:05 pm    Post subject: Reply with quote

Luck is not what is needed as Thoul will come to the rescue here for sure.

Patrick has this mod installed on his forums so I have no doubt that the problems in the installation of it can be overcome.
_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top

Thoul

Joined: 14 Sep 2005
Posts: 169

PostPosted: 2/3/2006, 2:36 am    Post subject: Reply with quote

This is most of it. There's one step that I'm unsure about. The $thispage_id step is out of order in respect to the rest of the steps & code. There are two places in the file that it could go, but I'm not sure which one was intended for it.


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

#
#-----[ FIND ]------------------------------------------------
#
   if ( $user_id != ANONYMOUS )
   {
      $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;

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

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

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

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
# Result of above edits (leave off the # at the beginning of each line:
#
#   //if ( $user_id != ANONYMOUS )
#   //{
#      $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;


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

      if (!$admin)
      {
         $sql = "UPDATE " . USERS_TABLE . "
            SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
            WHERE user_id = $user_id";

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

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_lastlogon = " . time() .  ", user_totallogon=user_totallogon+1
#
# Result of above edits (leave off the # at the beginning of each line:
#
#      if (!$admin)
#      {
#         $sql = "UPDATE " . USERS_TABLE . "
#            SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit, user_lastlogon = " . time() .  ", user_totallogon=user_totallogon+1
#            WHERE user_id = $user_id";

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

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

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
# Result of above edits (leave off the # at the beginning of each line:
#
#      $sessiondata['userid'] = $user_id;
#   //}

#
#-----[ FIND ]------------------------------------------------
#
   //
   // Does a session exist?
   //
   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 " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
         WHERE s.session_id = '$session_id'
            AND u.user_id = s.session_user_id";

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

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
 AND session_time > $expiry_time
#
# Result of above edits (leave off the # at the beginning of each line:
#
#      $sql = "SELECT u.*, s.*
#         FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
#         WHERE s.session_id = '$session_id'
#            AND u.user_id = s.session_user_id AND session_time > $expiry_time";

#
#-----[ FIND ]------------------------------------------------
#
               if ( $userdata['user_id'] != ANONYMOUS )
               {
                  $sql = "UPDATE " . USERS_TABLE . "
                     SET user_session_time = $current_time,
#
#-----[ IN-LINE FIND ]----------------------------------------
#
if

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

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

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
# Result of above edits (leave off the # at the beginning of each line:
#
#               //if ( $userdata['user_id'] != ANONYMOUS )
#               //{
#                  $sql = "UPDATE " . USERS_TABLE . "
#                     SET user_session_time = $current_time,

#
#-----[ FIND ]----------------------------------------
#
                     message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
                  }
               }

#
#-----[ REPLACE WITH ]---------------------------------
#
      message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
    }
//}

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

#
#-----[ FIND ]------------------------------------------------
#
   $sql = 'DELETE FROM ' . SESSIONS_TABLE . '
      WHERE session_time < ' . (time() - (int) $board_config['session_length']) . "
         AND session_id <> '$session_id'";

#
#-----[ REPLACE WITH ]--------------------------------
#
$sql = "DELETE FROM " . SESSIONS_TABLE . "
   WHERE UNIX_TIMESTAMP() - session_time >=172800
       AND session_id <> '$session_id'";

#

_________________
Phantasy Star: The Fringes of Algo | phpBB Smith
Back to top

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/3/2006, 4:11 am    Post subject: Reply with quote

Well after trying all that it still does not work. As soon as I upload sessions.php I get blank pages.

I have created a .txt of sessions modded with the code changes in place for you to look at.

http://www.freebiesparadise.com/freebies/sessions.txt
_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top

dealo

Joined: 29 Sep 2005
Posts: 35
Location: Australia

PostPosted: 2/3/2006, 7:58 am    Post subject: Reply with quote

which version of the mod are you using HG as the one ive got went straight on without a hasstle, on 3 different sites. I could email you the mod im using if you want.

(its the "last 24 hour one")
Back to top

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/3/2006, 2:27 pm    Post subject: Reply with quote

dealo I am using v1.2.9 which was supposedly updated for phpBB v2.0.18

The install file says it is in Beta

It is the Last Visit mod by niels

I have the one that you are using which is a little diferent as it doesn't show how many guests visited in the last 24 hours and that is the part I want and hence the reason I have decided to use this mod.
_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top
Display posts from previous:   
Post new topic   Reply to topic    CommunityAdmins.com Forum Index -> Technical Issues All times are GMT - 5 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Programming Forum

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - phpBBHacks.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - DrGregHouse.com - Bad Boy Blog - BadBoyForums.com - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact - Staff - User Guidelines>

We Support phpBBHacks.com. Forum Buttons by Daz. Privacy Policy. Powered by phpBB © phpBB Group. phpBB SEO.
Copyright © 2005-2008. CommunityAdmins.com, iFroggy Network. All Rights Reserved.