miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Master Class miniBB Support Forums / Master Class /  
 

Loading user_custom item on login (for timezones)

 
Author Pjanssen
Guest
#1 | Posted: 26 Sep 2006 03:08 
Hi,

I'm currently working on the implementation of user dependant timezones for miniBB. This is because the people visiting my forum are from all over the world, and having just one time without the use of timezones or DST can be quite confusing.
I've added an input field in the user preferences form, so that the timezone setting is saved in the database, and this works fine. I've also found the place where the timezone should be used (convert_date function in bb_functions.php).

But I've still got one major problem: how do I load the timezone setting from the database and store it somewhere in a session variable when someone logs in?

Thanks.

Author Paul
Lead Developer 
#2 | Posted: 26 Sep 2006 03:45 
Take a look at $timeDiff option of setup_options.php. Probably it's the best way to change it dynamically, when user is browsing the forums; all the rest will be done correspondigly to that option.

Author Pjanssen
Guest
#3 | Posted: 26 Sep 2006 03:53 
I know about the $timeDiff variable, but that's not based on the user location.
It merely gives the same offset to the time for everyone.

Author Paul
Lead Developer 
#4 | Posted: 26 Sep 2006 04:01 
Yes, but pay attention to my words... change it dynamically. Write your own piece of code, which changes it dynamically, basing on user's settings. Paste this code in bb_plugins.php - it will use $timeDiff on the forums overall, as it would be set in options. Do you get the idea?

Author Pjanssen
Guest
#5 | Posted: 26 Sep 2006 04:05 
Ah yeah I get the idea.
Then I'd have to figure out how to get the users setting from the database by using the miniBB mysql functions.

Thanks for the help, I'm going to see if I can get it to work.

Author Paul
Lead Developer 
#6 | Posted: 26 Sep 2006 05:00 
You may need to edit bb_cookie.php file, so it gets an additional field from database, if user is logged in, and then build $timeDiff options basing on that.

I think, that's more easier as you can imagine :-) I have in mind to develop a solution for that in the future, but still have no time to make it public.

Author Pjanssen
Guest
#7 | Posted: 26 Sep 2006 06:37 
Thanks for the tip about bb_cookie, that was indeed a simple way to make it work!

Now for Daylight saving time .. ;)

Author Anonymous
Guest
#8 | Posted: 16 Dec 2006 23:31 
does anyone have any specifics on how to get this to work?

Author marsbar
Associated Member
#9 | Posted: 10 Jan 2007 07:41 
Paul wrote: I have in mind to develop a solution for that in the future, but still have no time to make it public.

Am holding my breath for the solution!
-mb

Author Paul
Lead Developer 
#10 | Posted: 10 Jan 2007 11:07 
I still have no free time for that. If somebody want to pay for the solution, it could force it.

Master Class miniBB Support Forums / Master Class /
 Loading user_custom item on login (for timezones)
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑