×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Incorrect time being recorded on front-end and back-end

Incorrect time being recorded on front-end and back-end 14 years 9 months ago #5606

  • Harris Bokhari
  • Harris Bokhari's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Hi

I'm using version 1.5.12 of Joomla and using the beta of Joomlacomment 4.0.

I've read the previous posts and changed my config on Joomla so that it's recording the correct time (I'm in the UK and have added +1 for summertime).

If I enter a comment on the front end - it's one hour behind (so, it's 22:15 here and it's marked the comment as 21:15).

On the back end - if I amend an existing comment, it changes the time but it drops to 15:15 (-7 hours).

I made the change to comment.class.php and I think it's made a change to the front end but both are still out.

Any ideas on what I could do?

Thanks
Harris

Incorrect time being recorded on front-end and back-end 14 years 9 months ago #5611

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
What changes did you make to the comment.class.php - perhaps you can try this super activity thingy that some users suggested here on the forum.

Incorrect time being recorded on front-end and back-end 14 years 9 months ago #5621

  • Harris Bokhari
  • Harris Bokhari's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Hi Daniel

Thanks for getting back.

I looked compojoom.com/forum/17-jocomment-40/4748...ot-correct.html#5091 where you provided some code.

I can revert it back - have you got a url that I can have a look at?

:)

Thanks
Harris

Incorrect time being recorded on front-end and back-end 14 years 9 months ago #5622

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hi Harris,
Perhaps you can read this:
compojoom.com/forum/6-bug-report/5032-ti...shown-and-wrong.html

Also - you've edited the comment through the backend - I forgot to change the backend function. All the changes you made in comment.class.php only effect the frontend.

Incorrect time being recorded on front-end and back-end 14 years 9 months ago #5632

  • Harris Bokhari
  • Harris Bokhari's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Hi Daniel

Thanks, I'll have a go with this later and let you know.

Regards
Harris

Incorrect time being recorded on front-end and back-end 14 years 9 months ago #5649

  • Harris Bokhari
  • Harris Bokhari's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Hi Daniel

Just to let you know that I've done with:

* Added the put env statement in the index.php file for unregistered users,
* I've changed the getLocalDate function in utils.php (I've highlighted the code in black):

function getLocalDate($strdate,$format='%Y-%m-%d %H:%M:%S') {

jimport('joomla.utilities.date');
$user =& JFactory::getUser();

// if we have an anonymous user, then use global config, instead of the user params
if($user->get('id')) {
$tz = $user->getParam('timezone');


} else {
$conf =& JFactory::getConfig();
$tz = $conf->getValue('config.offset');
}

$jdate = new JDate($strdate);


// If in the UK - check if DST and set
if ($tz == 0)
{

$date_now = date_create(gmdate(date("y-m-d") . " 01:00"));
$offset_req = $date_now ->getoffset();

if ($offset_req <> False)
{

$tz++;
}

}


$jdate->setOffset($tz);
$formatDate = $jdate->toFormat($format);
return $formatDate;
}

/*
* Function to escape string for database use
*/
function mysql_escape_string($value)
{
$database =& JFactory::getDBO();
$result = $database->getEscaped($value);
return $result;
}

}

I just didn't think it was practical to get all my members to change their timezone settings. Also we would have to keep remembering to revert it when it changes back.

* In admin.comment.php, I commented out the line "$row->date = date("Y-m-d H:i:s");" as I would rather leave the date as is as opposed to having it be wrong.

* I had a look at the super activity and I'd rather use your comments module as it is.

It seems to work so I'm happy :)

Thanks
Harris
  • Page:
  • 1
Time to create page: 0.102 seconds