PDA

View Full Version : User's local time in post!


Admin
03-08-2002, 10:00 PM
A very simple hack, but I'm sure your users will like this. :)
With this you can display the local time for every user in their post. Look to the left to see the hack in action.

To install this hack download the attached file (localtimepost.hack.php), upload to your /admin folder and use vbHacker (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36378).

That's all I have to say... wow that was short. :D

Have fun that's what really matters! :)

Abbas
03-09-2002, 08:55 AM
Hey..nice one FireFly- especially for forums with people from all around the world.

Thanks
-Abbas

Tim Wheatley
03-09-2002, 09:55 AM
This is great! Thanks :)

Tommy Boy
03-09-2002, 10:37 AM
You mean it didn't show the local time before this hack?? :eek:

TheComputerGuy
03-09-2002, 10:47 AM
Very Nice Chen,

filth
03-09-2002, 10:51 AM
Excellent hack

Cheers

Jawelin
03-09-2002, 02:38 PM
Nice idea !
Just, I got confused reading the translated NOW time just above POST time...
It shouldn't be cleaner to put there the original poster time AT THE MOMENT he posted, instead of the poster timezone at the reader's instant ? :rolleyes:
This issue, I could use $post[dateline] instead of time() ... What do you think about ? ;)

Besides, I made a slight modification to display that line only when the poster's time is different than the 'official' board time, just to have a lighter postbit on the left side...
Great idea I stolen immediately, btw!
:)

Thanks.

Admin
03-09-2002, 06:24 PM
Yeah you can use $post['dateline'] instead of time() to get the time it was when the post was posted. But I want to know what the time IS right now, because maybe I need to PM the user or something. :)

Tommy Boy
03-09-2002, 06:58 PM
Ahh... NOW I get it. Sorry for the confusion earlier.

Lionhead
03-09-2002, 11:58 PM
Cool hack

Thx FireFly :)

Massiel
03-10-2002, 12:03 AM
Very cool, gonna try it!

Lionel
03-10-2002, 12:37 AM
I don't get it. I have my time set as -5 For EST and it is showing 2:47 AM for some one in Montreal when it is 9:40 only.

Massiel
03-10-2002, 01:51 AM
Tried it but it's not showing anything :( I assume it's the funcions.php and not the admin/functions.php right? I am sure that's how it is. Found the line, added the stuff under it, saved it, uploaded it and then went to postbit template and added the $post[localtime] but nothing showed. Where in the postbit does that go anyway? Does it replace something else or does it go on its own? Thanks in advance :)

Lionel
03-10-2002, 01:56 AM
ok-I guess the members never set their time...

Massiel
03-10-2002, 02:14 AM
Please help!

Lionel
03-10-2002, 02:20 AM
Originally posted by Massiel
Please help!

admin/functions.php

forums/functions.php not supposed to exists.

Massiel
03-10-2002, 03:26 AM
What do you mean forums/functions.php is not supposed to exist? what is it doing there then? Now I am more confused :(

Admin
03-10-2002, 10:23 AM
You should not have any file called functions.php in the vBulletin root folder, only one under the admin folder.

Massiel
03-10-2002, 11:13 AM
How come there is one? Should I delete it? wow....

Psychdrone
03-10-2002, 11:33 PM
Hey ff, how much of a load dose this add??

I like it but......

eva2000
03-10-2002, 11:36 PM
why not local date as well ?

Erwin
03-11-2002, 09:54 AM
Great hack as usual from FireFly! :)

Admin
03-11-2002, 11:21 AM
Psy -- none.
eva -- is that really needed? I thought it would just complicate the postbit more. To do that anyway, replace $timeformat in the hack to "$dateformat $timeformat".

eva2000
03-12-2002, 12:51 AM
Originally posted by FireFly
Psy -- none.
eva -- is that really needed? I thought it would just complicate the postbit more. To do that anyway, replace $timeformat in the hack to "$dateformat $timeformat". well it will confuse a few people as to whether it's a certain time on the same day or the day after/before

it could be

1 am local time but that could be on Mar 11 or Mar 12

RCK
03-24-2002, 12:32 PM
If you want to install this hack into your pm system,
just do the following:

in your private.php, just after } else {
$fromuserinfo['username'] = "N/A";
}

copy the FireFly's code, and change all the $post['localtime'] with $fromuserinfo['localtime']

then into your privmsg template,
just add Local Time: $fromuserinfo[localtime]<br> after Registered: $fromuserinfo[joindate]<br>
Enjoy :cool:

Admin
03-26-2002, 07:25 AM
Just released a vbHacker version. :)

Visionray
03-29-2002, 05:37 AM
worked great! Thanks :D

Itworx4me
04-21-2002, 06:22 AM
Love the Hack FireFly. Is there anyway for the time to update like every 10 seconds or so??? In stead of it updating when you change threads or pages.

mashby
04-26-2002, 10:23 PM
Great work Firefly! I installed it without a bit of trouble on my 2.2.5 vB. Thank you! :D

KuraFire
04-30-2002, 03:42 PM
Yay, brilliant hack, thanks! :D

*hits install button*

bonnmac
05-08-2002, 01:43 AM
I'm not having much luck with hacks today. It doesn't show up? Local Time shows up but nothing after it. :( I used vbhacker and it said everything was successful. I went and dble checked everything but it still doesn't show anything.

Cynthia Blue
05-10-2002, 06:12 PM
Got the file.. I don't have VBHacker and I really don't want to get it. :P This should be simple to just plop the code in, but what are the symple instructions? All the weird code in the download file is messing me up. :p

Edit... I think those number (;i:9;s:40) refer to the line number? Or at least the last number? Well I have another hack in that file (fuctions.php) so line numbers ain't gonna cut it. :)

Edit2.. ok it's the length, not the line number. But I still don't know what code to find, and what to put it by/replace it with. :p

Thanks.

Smoothie
05-29-2002, 04:40 PM
A text version of this hack would be appreciated!

Admin
05-29-2002, 04:58 PM
Text version as requested by Smoothie. :)

Smoothie
05-29-2002, 05:01 PM
Thank you FireFly!

Mone'
05-31-2002, 03:48 AM
Thankyou !

Boofo
05-31-2002, 04:33 AM
Thank you very much. I've been looking for this, must have missed it. Thanks again! :)

Originally posted by RCK
If you want to install this hack into your pm system,
just do the following:

in your private.php, just after

copy the FireFly's code, and change all the $post['localtime'] with $fromuserinfo['localtime']

then into your privmsg template,
just add Local Time: $fromuserinfo[localtime]<br> after Registered: $fromuserinfo[joindate]<br>
Enjoy :cool:

bluecat
06-06-2002, 01:58 AM
Worked for me just fine in 2.2.5. I had to manually edit part of the code and vbhacker told me exactly how to do it. :) I do have a question for anyone...does that vbhacker work on any script?

Boofo
06-06-2002, 02:01 AM
No, it will only work on scripts written for it. :)

Originally posted by bluecat
Worked for me just fine in 2.2.5. I had to manually edit part of the code and vbhacker told me exactly how to do it. :) I do have a question for anyone...does that vbhacker work on any script?

Parker Clack
06-06-2002, 04:33 AM
Chen:

Ok. I don't know what I am doing here so what would you put your their local date?

You have

$post['localtime'] = date($timeformat, time()+($post['timezoneoffset']-$timeoffset)*3600);

for the localtime.

what would you use for $post['localdate'] ?

Thanks,
Parker

Admin
06-06-2002, 08:31 AM
The same thing, except $dateformat instead of $timeformat.

Parker Clack
06-06-2002, 10:04 AM
Thanks Chen. That worked like a charm.

Parker

Boofo
06-06-2002, 10:23 AM
If I wanted to use that on my forum home, where in the index.php would I need to enter it? :)

Originally posted by FireFly
The same thing, except $dateformat instead of $timeformat.

bandersen
06-16-2002, 05:21 PM
Cute, I have installed it!

Please....what code do I put inside a popup to display all users in the same timezone?

Odil
06-29-2002, 07:23 AM
Originally posted by FireFly
A very simple hack, but I'm sure your users will like this. :)
With this you can display the local time for every user in their post. Look to the left to see the hack in action.

To install this hack download the attached file (localtimepost.hack.php), upload to your /admin folder and use vbHacker (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36378).

That's all I have to say... wow that was short. :D

Have fun that's what really matters! :)

I just installed this but it just says local time:
with no time displayed. How can I fix this or remove it if fix isn't possible?

Odil

Admin
06-29-2002, 07:59 AM
Have you uploaded the hacked functions.php?

Heineken77
07-16-2002, 05:35 PM
This is my first hack with vbHacker. Thanks firefly! works great :)

Got it working perfectly and used chModded functions.php to 777. What was it originally I can't seem to recall. 644?

Thanks!
Heineken

Boofo
07-16-2002, 08:08 PM
Chen,

Is the following what I would need to get the date format, too? And can I use this on my forumhome?

} else {
$post[signature] = "";
}

/* User local time in post */
global $timeoffset;
$post['localtime'] = date($timeformat, time()+($post['timezoneoffset']-$timeoffset)*3600);
/* User local time in post */

/* User local date in post */
global $timeoffset;
$post['localdate'] = date($dateformat, time()+($post['timezoneoffset']-$timeoffset)*3600);
/* User local date in post */

Admin
07-17-2002, 12:56 PM
Yes, and no.

Boofo
07-17-2002, 05:34 PM
Could you please tell me then how to get the users date according to their time offset for the forumhome? :)

Admin
07-18-2002, 07:15 PM
$bbuserinfo['localtime'] = date($timeformat, time()+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
$bbuserinfo['localdate'] = date($dateformat, time()+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);

wolfe
07-22-2002, 10:05 PM
no working for me just says Local Time: nothing here :( please help i have edited templates and uploaded functions.php

i am using VBB 2.2.4

Massiel
07-27-2002, 04:45 AM
Firefly this worked great for a while but for some reason my local time is not 4 hrs off, any ideas why? :(

Keyser S?ze
08-07-2002, 10:28 AM
installed with the txt ver. getting this error, was a very easy install so i dunno why im getting this error, on the main page right at the top

Parse error: parse error, unexpected $ in /home/virtual/site61/fst/var/www/html/forums/admin/functions.php on line 2255

this is line 2255 WHERE subscribethread.threadid='$threadid'

any help pls?

2 X Viverridae
08-14-2002, 01:14 PM
Installed quickly, works great!

Seem to be saying that to FireFly a lot today... :)

NexDog
08-20-2002, 10:17 AM
Clicks install ;)

Odil
08-25-2002, 02:10 AM
Originally posted by FireFly
Text version as requested by Smoothie. :)

Thanks Firefly, vbhacker file ads the Local time part in but not the actual time, gives an error that the code required couldn't be found.

Odil

Ice Man_00
08-31-2002, 01:52 PM
Can this be used in a newer versions of VBB ??
Tried to install it manually in 227 version, but it dosen`t show.

Here`s what i did:

} else {
$post[signature] = "";
}

/* User local time in post */
global $timeoffset;
$post['localtime'] = date($timeformat, time()+($post['timezoneoffset']-$timeoffset)*3600);
/* User local time in post */
} else {
$postsperday=0;
$post[username]=$post[postusername];
$post[usertitle]="Guest";
$post[joindate]="Not Yet";
$post[posts]="N/A";

Is this wrong ?

Boofo
08-31-2002, 02:29 PM
Here's what I have and it works fine. I am using 2.2.5, but I can't see why it wouldn't work in 2.2.7 unless it has changed more than I thought it did. Are you using $post[localtime] in your postbit? By the way, I have the local date here too in case you want that too. :)

} else {
$post[signature] = "";
}

/* User local time and date in post */
global $timeoffset;
$post['localtime'] = date($timeformat, time()+($post['timezoneoffset']-$timeoffset)*3600);
$post['localdate'] = date($dateformat, time()+($post['timezoneoffset']-$timeoffset)*3600);
/* User local time and date in post */
} else {
$postsperday=0;
$post[username]=$post[postusername];
$post[usertitle]="Guest";
$post[joindate]="Not Yet";
$post[posts]="N/A";

Ice Man_00
08-31-2002, 03:19 PM
thx for the quick reply. But it still dosen`t work. Must have changed a lot since 2.2.5 then... :(

Boofo
08-31-2002, 03:28 PM
Are you using $post['localtime'] or $post[localtime] to get the time?

Originally posted by Ice Man_00
thx for the quick reply. But it still dosen`t work. Must have changed a lot since 2.2.5 then... :(

Tim Wheatley
08-31-2002, 03:49 PM
Reinstalled 2.2.7. Thanks again.

Ice Man_00
08-31-2002, 03:51 PM
If you mean in my postbit template, this is what i use...

Location: $post[field2]<br>
Local time: $post[localtime]<br>
Local date: $post[localdate]<br>
Posts: $post[posts]<br>

N9ne
08-31-2002, 03:57 PM
I have $post[localtime] and it works for me :confused:

Ice Man_00
08-31-2002, 04:02 PM
Since this is hacken into functions.php and is output in the postbit template. Is there anywhere else it gets the info from ?? Another file ??
Maybe there is something missing, somwhere..

aykordeen
11-11-2002, 05:01 AM
I've tried to install it several times on my 2.2.8 and I keep getting this error message:

Parse error: parse error in /home/www/mywebsite/forum/admin/functions.php on line 817

Fatal error: Call to undefined function: vbdate() in /home/www/mywebsite/forum/admin/sessions.php on line 399

Any ideas as to the cause?

Thanks.

XFLBret
12-06-2002, 05:30 PM
is there a way to make this work in the PM postbit as well?

LangTuDaTinh
01-05-2003, 07:34 PM
thanks for a great hack

i modifed a bit since some of my user doesn't chage to their local time when register so

i added another option in

registeradult
registercoppa

by change to this



<option value="0" >(GMT) Western Europe Time, London, Lisbon</option>
<option value="0.1" selected>Please select your local time</option>


as u can see i changed default option to another option which value is 0.1.

so if user doesn't select their local time zone when they are registering, the value for time zone will be 0.0 instead of 0

i also modifed a bit in functions.php



} else {
$post[signature] = "";
}

/* User local time in post */
if ($post[timezoneoffset] =="0.1") {
$timetag="";
$timetabbr="";
$post[localtime]="";
}
else {
global $timeoffset;
$post['localtime'] = date($timeformat, time()+($post['timezoneoffset']-$timeoffset)*3600);
$timetag="Local Time: ";
$timetabbr="<br>";
}



then instead of put $post[localtime] in postbit, i will put

$timetag$post[localtime]$timetabbr

I also use these for Location and Bookmarks's hack.

if user doesn't specify a location then their location will not display in postbit and the same for bookmarks' hack.....check out my postbit.

ChevyMan
03-03-2003, 01:55 PM
Ok I installed this but I get an error. It has local time but after it says array [localtime] how can I fix this?

Thanks

Sliderx
03-08-2003, 07:12 AM
that great thx FireFly

Esr Tek
03-18-2003, 02:39 AM
I installed this w/ vbhacker and it seemed to go fine..
However I have no difference in forums..
Vb 2.3.0
Any ideas.. I am a VB and php newb

Esr Tek
03-18-2003, 08:27 PM
**Bump**

Please anyone???

It all went thru the automated way yet it's not working :(
It didn't seem to really update the function.php (even though it had no errors on install ??)

However my offline (deafult file) is the same as the online (updated) file.

The above post's have me confused as what to add, which one of the edits (code quotes) is the right one??

Many Thanks in advance ;)