vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Local time and date in post, pm, usernotes and profile v1.5 (https://vborg.vbsupport.ru/showthread.php?t=60863)

Boofo 01-30-2004 01:06 AM

Link is right. All you should need to do is make suure the server is set to the correct timezone and see that DST is set to NO (for now) in the Admin CP. After that it should all be automatic, I think.

Natch, is your linear local time working all right? It was when we fixed it. Is it still ok?

Natch 01-30-2004 01:17 AM

Quote:

Originally Posted by Boofo
Link is right. All you should need to do is make suure the server is set to the correct timezone and see that DST is set to NO (for now) in the Admin CP. After that it should all be automatic, I think.

Natch, is your linear local time working all right? It was when we fixed it. Is it still ok?

Sorry mate - but no.

Since the last edit, all of Linear, Hybrid and Threaded modes show the localtime at -1 of what it should be, but in a PM from me, the localtime is accurate.

Boofo 01-30-2004 01:21 AM

Take the last edit out then until I can look at it more closely and try to figure out what is going wrong. Let me know if the linear time is showing right again after you remove the last code, will you, please?

And how is it in the profile?

Natch 01-30-2004 01:36 AM

localtime is correct in Profile:

After removing that code, the localtime is still one hour early in showthread...

This is what I still have left in showthread.php - before
PHP Code:

        $post['musername'] = fetch_musername($post);
        
$post['islastshown'] = ($post['postid'] == $lastpostid);
        
$post['attachments'] = &$postattach["$post[postid]"]; 

I have
PHP Code:

// Local Date and Time in Post
        
$post['tzoffset'] = $post['timezoneoffset'];
        if (
$post['dstonoff'])
        {
            
// DST is on, add an hour
            
$post['tzoffset']++;
        }
        
$post['localtime'] = date($vboptions['timeformat'], TIMENOW+($post['tzoffset']-$vboptions['timeoffset'])*3600);
        
$post['localdate'] = date($vboptions['dateformat'], TIMENOW+($post['tzoffset']-$vboptions['timeoffset'])*3600);
// Local Date and Time in Post 


Boofo 01-30-2004 01:43 AM

Didn't you say yesterday that when we added the DST code, that it fixed it for you? And everything was showing the right time? If that was the case, then something happened somewhere when we added the extra code. But that should have fixed itself when we removed it. I'm at a total loss here. This has me totally stumped. On my site the time shows correct in all of the thread display modes, as well as everywhere else. I have had a few people test it on their sites, and they are reporting no time loss or gain.Please double-check everything and see if maybe you left something out somewhere. I don't know how to fix it when it works everywhere else. Anyone else have any ideas?

Natch 01-30-2004 01:55 AM

Sorry about this pal ... I'll look over this thread again and revert all the files back to prior to this hack - then work it thru ...

Boofo 01-30-2004 02:05 AM

You don't need to apologize. I just want to help you get it working like it does for me and a lot of others. ;)

The file in the first post has all of the updates that you should need. It was updated after the DST code. I didn't add the hybred or threaded mode to that one yet until we can figure out what is going on.

Natch 01-30-2004 02:27 AM

The only thing I can think of is that maybe the Auto-detection of [dstonoff] is not working properly in this file for some reason ...

I'm gonna do a Beyond Compare with the original vb# RC3 showthread ...

I'll let u know what I find out ...

Boofo 01-30-2004 02:31 AM

Please keep me posted. It seems to work fine for me. Maybe something is different in your file.

Link14716 01-30-2004 02:33 AM

If everyone is having all of these problems, I'm to the point where I'm about to suggest making a damned duplicate of vbdate that uses $post['timezoneoffset'] or whatever instead of $bbuserinfo['timezoneoffset'].

Natch 01-30-2004 02:38 AM

well that wasn't helpful - the only change to that file is the one from your attachment - and the time is still out.

Turning DST from auto to on to off changed nothing in Linear mode ...

Natch 01-30-2004 02:39 AM

Turning DST to off in profile changes the other locations of the hack tho ...

Boofo 01-30-2004 02:41 AM

Natch, try adding this:


PHP Code:

      global $vboptions$post$timeoffset$timezoneoffset

above this:

PHP Code:

     $post['tzoffset'] = $post['timezoneoffset']; 

and let me know if it does anything.

Leave the User CP DST setting to Auto.

Natch 01-30-2004 02:48 AM

No change mate ...

Boofo 01-30-2004 02:51 AM

I guess I'm confused why it was working fine for you after we added the DST code and now it doesn't. I'm stumped.

Natch 01-30-2004 02:53 AM

Me too ... plus the fact that the same exact code works for PM's but not in showthread ...

Natch 01-30-2004 02:55 AM

http://www.mobileforces.org/forums/s...ead.php?t=2129 <- at the bottom of this thread, you can see that the time (now) for me is nearly 1500 hours, but it's actually nearly 1600 hours ...

But in a PM I just sent to myself, it says:
Code:

[Local Time: 15:50]
[Local Date: 30-01-2004]


Boofo 01-30-2004 02:55 AM

Quote:

Originally Posted by Link14716
If everyone is having all of these problems, I'm to the point where I'm about to suggest making a damned duplicate of vbdate that uses $post['timezoneoffset'] or whatever instead of $bbuserinfo['timezoneoffset'].

Matt, this is almost exactly the same code that Chen used for vB2 (except with vB3 variables) so it should work fine for everyone. There are only 2 people who have reported any problems at all with this hack. Which is starting to lead me to believe that it isn't the hack as much as maybe another hack they have installed messing with it. Or a setting off somewhere. If you have any ideas, I'm willing to listen.

Boofo 01-30-2004 02:58 AM

Quote:

Originally Posted by Natch
http://www.mobileforces.org/forums/s...ead.php?t=2129 <- at the bottom of this thread, you can see that the time (now) for me is nearly 1500 hours, but it's actually nearly 1600 hours ...

But in a PM I just sent to myself, it says:
Code:

[Local Time: 15:50]
[Local Date: 30-01-2004]


But it was working fine for you before we messed with the second instance of code. In my showthread, it reports everyone's time as what it actually is. I don't think it's the showthread.php.

Boofo 01-30-2004 03:11 AM

Natch, if you're up for it, I have one last thing to try. Take all of the code you added for this hack out of the showthread.php. Now, open up the functions_showthread.php and find:

PHP Code:

 // format date/time
 
$post['postdate'] = vbdate($vboptions['dateformat'], $post['dateline'], true);
 
$post['posttime'] = vbdate($vboptions['timeformat'], $post['dateline']); 

and below it add:

PHP Code:

// Local Date and Time in Post
    
$post['tzoffset'] = $post['timezoneoffset'];
    if (
$post['dstonoff'])
     {
        
// DST is on, add an hour
        
$post['tzoffset']++;
    }
  
$post['localtime'] = date($vboptions['timeformat'], TIMENOW+($post['tzoffset']-$vboptions['timeoffset'])*3600);
  
$post['localdate'] = date($vboptions['dateformat'], TIMENOW+($post['tzoffset']-$vboptions['timeoffset'])*3600);
// Local Date and Time in Post 

and let me know if that fixes everything.

Natch 01-30-2004 03:13 AM

If I take out the new code, and put in the old code it generates exactly the same time regardless ...

Boofo 01-30-2004 03:15 AM

Did you take it out of the showthread.php and put it in the functions_showthread.php?

Natch 01-30-2004 03:20 AM

I just did that - and it's right on the money :)

Linear, Hybrid and Threaded modes all ok :)

Great work Boofo!

Natch 01-30-2004 03:22 AM

https://vborg.vbsupport.ru/external/2004/08/6.gif

Boofo 01-30-2004 03:25 AM

Now please, double check everything again, pm, profile, everything and let me know if everything is kosher now. I'll explain my mistake after I hear back from you. ;)

Oh, and make sure there is no code for this hack anywhere in the showthread.php now.

Natch 01-30-2004 03:30 AM

All good Boofo :) https://vborg.vbsupport.ru/external/2004/08/6.gif again!

Check: showthread.php has no mods at all, it's the changes in includes/functions_showthread.php that do the trick :)

Boofo 01-30-2004 03:42 AM

Great! And thank you for bearing with me on this. I couldn't have done it without you. I will update the first post with the changes now. This should fix it for anyone else that has had any problems.


BTW: I gave you credit for all of your hard work in helping me track this down. Thank you very much, sir. Now I can get to work on my other hacks for my site. ;)

Natch 01-30-2004 03:46 AM

[high]* Natch blushes ...
[/high]

Looking forward to your work again ... and I appreciate your patience on the support :D

Boofo 01-30-2004 03:53 AM

Anytime, my firend. You are one heck of a beta tester. ;)

Stop by the site and register and I'll show you some of what I am working on now. The site's pretty dead, but I can get more coding done that way. ;)

Zelda-King 01-30-2004 06:18 AM

Quote:

Originally Posted by Boofo
Matt, this is almost exactly the same code that Chen used for vB2 (except with vB3 variables) so it should work fine for everyone. There are only 2 people who have reported any problems at all with this hack. Which is starting to lead me to believe that it isn't the hack as much as maybe another hack they have installed messing with it. Or a setting off somewhere. If you have any ideas, I'm willing to listen.

That's possible I suppose. I have the User Forum Activeness hack installed. That's the only hack I'm using in member.php though.

Boofo, if you like, I could set you up with a temporary admin account on my board so you can have a looksee...

Boofo 01-30-2004 06:23 AM

Have you tried the code anywhere else? Can you install it for the pms and postbits and see if it is working right there? that might help us to narrow it down at least. The file in the first post has been updated with all of the changes.

Zelda-King 01-30-2004 02:51 PM

OK I did that but I'm still getting the same times in PMs, usernotes and posts as I get in profiles... and that was after cleaning my cache and downloading the file about 15 minutes before this post was made.

Boofo 01-30-2004 10:29 PM

If you downloaded and installed the new code for the functions_showthread.php, and it is still off, then I'm beginning to believe it has to be your server time setting is off in the Admin CP. With the new code changes, how far off are we still?

Zelda-King 01-31-2004 12:25 AM

As far as I'm aware, as I've said before, there is no longer such an option (vBulletin doesn't need that manually set in the admin cp any more) and in any case everyone's regular vB times show correctly. Could you point me exactly where you mean please.

Boofo 01-31-2004 12:29 AM

Default Time Zone Offset in the Date and Time Options in the Admin CP under vBulletin Options. ;)

Zelda-King 01-31-2004 12:38 AM

Ah yes. I knew about that but that's not server time. Mine is set at -5 and I've said I can't give you a straight 'how many hours out' reply because it is different for each timezone. ie, EST is correct.

Zelda-King 01-31-2004 12:45 AM

Disregard my last post. I've spotted something different. Times are now all 2 hours behind.

Boofo 01-31-2004 01:49 AM

What did you spot? Maybe it is interfering with this?

Where are you located and is DST in effect there right now?

Zelda-King 01-31-2004 01:52 AM

No, it's just the update. Before the times screwed up pending on area and now they're all 2 hours behind.

Boofo 01-31-2004 01:59 AM

Try turning DST off in the Admin CP and make sure it is set to Automatically detec DST settings in YOUR user cp and tell me if that does anything.

Don't lose faith. We'll get it working for you. Everyone else seems to be all fixed up. We'll get you there, too. ;)


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02246 seconds
  • Memory Usage 1,840KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete