mini
bb
®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon!
Click here to read more
.
Community Forum
|
Forums
|
File Bank
|
Sign Up
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Community Forum
/
Master Class
/
Loading user_custom item on login (for timezones)
Pjanssen
Guest
#1
|
Posted: 26 Sep 2006 03:08
Reply
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.
Paul
CEO
#2
|
Posted: 26 Sep 2006 03:45
Reply
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.
Pjanssen
Guest
#3
|
Posted: 26 Sep 2006 03:53
Reply
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.
Paul
CEO
#4
|
Posted: 26 Sep 2006 04:01
|
Edited by: Paul
Reply
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?
Pjanssen
Guest
#5
|
Posted: 26 Sep 2006 04:05
Reply
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.
Paul
CEO
#6
|
Posted: 26 Sep 2006 05:00
Reply
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.
Pjanssen
Guest
#7
|
Posted: 26 Sep 2006 06:37
Reply
Thanks for the tip about bb_cookie, that was indeed a simple way to make it work!
Now for Daylight saving time .. ;)
Anonymous
Guest
#8
|
Posted: 16 Dec 2006 23:31
Reply
does anyone have any specifics on how to get this to work?
marsbar
Associated Member
#9
|
Posted: 10 Jan 2007 07:41
Reply
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
Paul
CEO
#10
|
Posted: 10 Jan 2007 11:07
Reply
I still have no free time for that. If somebody want to pay for the solution, it could force it.
Your reply
»
Username
»
Password
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.
Before posting, be sure your message is compliant with our
forum posting rules
. If not, it may be locked or deleted with no explanation.
News & Announcements
FAQ
How To
Bugs
Other
Official Addons and Solutions
Custom Tutorials and Modifications
Master Class
Specific
Re-cycled
Suggestions
Testimonials
qwerty
Online now: Guests - 37
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0
Forums are powered by
miniBB
®