Users visited today doesnt work

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 !

Users visited today doesnt work

Postby gwuk on Mon 21. Mar, 2005 05:27

Hello,
I installed the Last visit mod, but after a couple of months of it working, it suddenly stopped working. I do kind of remember the last couple of mods I installed before I noticed it wasnt working, but none modified the sessions.php file. Here is the problem.

The statistics seem to be reset every hour or so. Sometimes I will go on the site and there have been 14 users in total for the day, and all 14 of these were in the hour. and then next timeI come on to my forum it will state a less number. Does anyone know why this might be happening or a particular file that if changed could have caused this problem?
gwuk
Poster
Poster
 
Posts: 4
Joined: Thu 20. Jan, 2005 02:41

Postby gwuk on Mon 21. Mar, 2005 05:29

One of the mods I installed changed this file:

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

#
#-----[ FIND ]------------------------------------------
#
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));

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

// friendly date mod\\*******************

$thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));

$L_Today = 'Today';
$L_Yesterday = 'Yesterday';
$time_format = " - h:i a";// - hour:minute am/pm

$date = getdate();
$today = $date['mday'];
$month = $date['mon'];
$year = $date['year'];

$forum_date_today = @gmdate ("d", $gmepoch);
$forum_date_month = @gmdate ("m", $gmepoch);
$forum_date_year = @gmdate ("Y", $gmepoch);

if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Today . @gmdate ($time_format, $gmepoch);//today

else
if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday

else
//if today is 1 and the month is not 1, then we have to check how many days in the previews month
//and then set $yesterday to the last day in the previews month
if ($today == 1 && $month != 1)
{
$yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
}
else
//if we are in the first day in the year
if ($today == 1 && $month == 1)
{
$yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
}

return ($thetime);
//end friendly date \\*******************************

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


Would the functions.php cause this problem?
gwuk
Poster
Poster
 
Posts: 4
Joined: Thu 20. Jan, 2005 02:41

Postby jas on Tue 22. Mar, 2005 13:42

I've exactly installed the same mods and have the same troubles.

...coïncidence ?
jas
Poster
Poster
 
Posts: 2
Joined: Tue 22. Mar, 2005 13:23

Postby jas on Tue 22. Mar, 2005 13:56

Well... :roll: Don't look for anymore Gwuk, that's it !! i've just replaced the old lines and it work perfectly

This is the "cool" code... :)
Code: Select all
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
}

//
// Pagination routine, generates
// page number sequence

I can't say what's wrong with this "friendly date" mod :roll:
jas
Poster
Poster
 
Posts: 2
Joined: Tue 22. Mar, 2005 13:23


Return to Last visit [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron