Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> BUGS/FIXES - Raven's v7.3 Customized Distro
Author Message
GeekyGuy
Client



Joined: Jun 03, 2004
Posts: 302
Location: Huber Heights Ohio

PostPosted: Fri Jul 16, 2004 4:23 pm Reply with quote

I really wouldn't call this a bug, but it is annoying me. I just posted a message to the Shout Box, and the time is off by 3 hours. Shout Box shows 3:02, but I posted it at 6:02.

I have set my time zone in the Forums to GMT-4 hours, which should be correct for my area. Is there another place I should set my timezone?

_________________
"The Daytona 500 is ours! We won it, we won it, we won it!", Dale Earnhardt, February 15th, 1998, Daytona 500 
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Tao_Man
Involved
Involved



Joined: Jul 15, 2004
Posts: 252
Location: OKC, OK

PostPosted: Fri Jul 16, 2004 4:28 pm Reply with quote

My setup keys off of system time, which for my host is EDT I would guess that you are east cost and your server is west cost. I have not found a way to set "Nuke time" just in the forums.

_________________
------------------------------------------
To strive, to seek, to find, but not to yield!
I don't know Kara-te but I do know cra-zy, and I WILL use it! 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Fri Jul 16, 2004 4:34 pm Reply with quote

Look here [ Only registered users can see links on this board! Get registered or login! ] and/or do a search for 'formatTimestamp'. I have posted a method that works with news items and maybe you can modify it to offset your time.
 
View user's profile Send private message
GeekyGuy







PostPosted: Fri Jul 16, 2004 4:41 pm Reply with quote

As always, you rock. Thanks.

This is the only minor irritation I've encountered, other than the fixes you've already posted.

Thanks again.
 
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Sat Jul 17, 2004 5:57 am Reply with quote

I'm on the westcoast and my server is in Texas, but it's set to EST. I can correct for this in the block-shoutbox.php file, around line 136 ....

Code:
if ($Submit == "Shout") {

        $test = 0;
        $yr = date(Y);
        $mnth = date(m);
        $dy = date(d);
        $day = "$mnth-$dy-$yr";
        $h = date(g)-2;      //  This is the server time.  Since it's daylight savings time I use -2, in the fall I'll change it to -3
        $m = date(i);
        $ap = date(a);
        $time = "$h:$m:$ap";


Hope that helps.

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
GeekyGuy







PostPosted: Sat Jul 17, 2004 9:58 am Reply with quote

CodyG,

That snippet of code is not in the version of block-Shout_Box.php in Ravens 7.3 distro. I think this is the code I need to change, I'm just not sure what/where to change:

Quote:
// date("O"); = difference to GMT. Example: +0800

$sql = "select * from ".$prefix."_shoutbox_date";
$resultD = $db->sql_query($sql);
$rowD = $db->sql_fetchrow($resultD);
$day = date("$rowD[1]");
$time = date("$rowD[2]");


I am pretty sure it is in the line: $time = date("$rowD[2]");
But everything I've tried has failed.
 
CodyG







PostPosted: Sat Jul 17, 2004 10:52 am Reply with quote

You're right! I obviously do not have the latest version of shoutbox on my other site and I was using that code to show how I had changed the time.

how about this (if you are on east coast and server on westcoast)?
$time=date("$rowD[2]")+3;
?? Did that not work? Maybe something in the php manual about date() would be useful.
 
CodyG







PostPosted: Sat Jul 17, 2004 11:01 am Reply with quote

Okies... I'm just guessing at this point, but I got this idea from the manual.

$timeoffset=3;
$servertime = date("$rowD[2]");
$time = $servertime+$timeoffset;
 
GeekyGuy







PostPosted: Sat Jul 17, 2004 11:26 am Reply with quote

I've tried using the Offset
date("O")+0300;
both before and after the function, but it makes no changes at all.

I also tried your $timeoffset, and it messes up the time like most of the other things I've tried. It shows:

GeekyGuy: This is a test shout
07-17-2004 13

And it should be :

GeekyGuy: This is a test shout
07-17-2004 10:26am

Which is still showing the server time (PDT instead of EDT)
 
Raven







PostPosted: Sat Jul 17, 2004 12:28 pm Reply with quote

You will need to convert the timestamp from the table back to a unixtimestamp and then apply the offset in seconds and then convert it back before displaying it Wink
 
GeekyGuy







PostPosted: Sat Jul 17, 2004 12:35 pm Reply with quote

Yup, I'm sure that'll fix it. Wink

(pssst. Hey, anybody know what the hell he just said?)
RavensScripts

edit: I am actually searching for a way to do that now
 
CodyG







PostPosted: Sat Jul 17, 2004 12:45 pm Reply with quote

good plan... if I knew what raven what talking about I'd help. Wink
 
Raven







PostPosted: Sat Jul 17, 2004 2:08 pm Reply with quote

d*** rookies Bang Head ROTFL

Your date looks like this
Code:
07-17-2004 10:26am

So, to alter that you need to convert it back into a unixTimeStamp. Here is a quick-n-dirty routine I just threw together to demonstrate. I know there is a shorter way but I'm on my way out the door and I think this will get you by.
Code:
<?

$dateS = '07-17-2004 10:26am';
$date = explode(' ',$dateS);
$time = explode('am',$date[1]);
$ampm = $time[1];
$date = explode('-',$date[0]);
$time = explode(':',$time[0]);
$offset = 60*60*3; //offset in seconds
$date = strtotime($date[2].'-'.$date[0].'-'.$date[1].' '.$time[0].':'.$time[1])+$offset;
echo date('Y-m-d h:ia',$date);
?>
 
GeekyGuy







PostPosted: Sat Jul 17, 2004 3:29 pm Reply with quote

I've given up on it for today. I've given myself a headache, and I have two cats that are demanding some attention.

Thanks again Raven, you're the best.
 
GeekyGuy







PostPosted: Sun Jul 18, 2004 11:18 am Reply with quote

I decided that I really didn't need to show the time a Shout was posted, so I just turned it off in the Shout Box administration.

Problem resolved Laughing
 
Raven







PostPosted: Sun Jul 18, 2004 1:09 pm Reply with quote

Chicken.
 
GeekyGuy







PostPosted: Sun Jul 18, 2004 1:14 pm Reply with quote

Yuppers!

I need to learn a whole lot more before I attempt that again. I've not had enough time to hit those books. Crying or Very sad

Raven's probably forgotten more about PHPNuke than I will ever know
RavensScripts
 
Raven







PostPosted: Sun Jul 18, 2004 1:22 pm Reply with quote

I am going to look at this later today because I have nothing else to do and you're such a great guy ROTFL - Confidence is high - Resolution is near!
 
GeekyGuy







PostPosted: Sun Jul 18, 2004 1:28 pm Reply with quote

Most excellent. You are da Man!

I've got to hand it to ya Raven, this distro is awesome. And Coppermine is actually working (didn't work when I installed it on my old setup). I've got some pics of my two cats up on my site now.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> BUGS/FIXES - Raven's v7.3 Customized Distro

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©