[RELEASE] DST MOD (daylight savings time)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
blulegend
Registered User
Posts: 83
Joined: Wed Jan 30, 2002 5:41 pm

Post by blulegend »

narf, heres a fix to all your problems.

Code: Select all

# 
#-----[ OPEN /includes/functions.php ]------------------------------ 
# 

# 
#-----[ FIND around line 90 ]----------------------------------- 
# 

   return ( $row = $db->sql_fetchrow($result) ) ? $row : false; 

# 
#-----[ REPLACE WITH ]------------------------------------------- 
# 

   // DST MOD 
   // OLD return ( $row = $db->sql_fetchrow($result) ) ? $row : false; 
   if ( $row = $db->sql_fetchrow($result) ) 
   { 
      if ( $row['user_timezone'] > 12 ) $row['user_timezone'] -= 50; 
      return $row; 
   } 
   else 
   { 
      return false; 
   } 
   // END MOD 

I have added this fix to my code above and will resubmit it to the database when it is back online.

xamot
Registered User
Posts: 13
Joined: Mon Apr 15, 2002 4:15 am
Location: St. Louis, Mo, USA

RE: complexity & breaking last visit mod

Post by xamot »

re: breaking last visit mod:

I posted about this here. If I mod the mod I'll post it there.

re: complexity of my timezone data structure:

Yeah. Originally I was going to put it in a new db table and only fetch the timezone you needed at that time. That would also allow for admin pages to be created to add and remove timezones. But then it also require a language translation table for the descriptions (unless the name and shortname where still stored in lang_main.php, while the data was in the table). It also doesn't appear the way of doing things in phpbb. I thought about using php objects but I'm not sure if that would create incompatiblities for people running older php versions. I'm open to caching schemes if you have a good idea, but the complexity is what is required if people want fully functional timezone abilities. (I don't really need it, but I think it is an interesting problem) They could trim their lang_timezone.php files to what they are using. I'm curious to find out how much of a performance hit it would be. It seems that phpbb does load a BUNCH of translation globals. Plus I don't see a problem with multiple mods. If people want simple they can have that if they want complex they could have that if I get this working.

ickie
Registered User
Posts: 20
Joined: Fri Apr 05, 2002 1:16 pm
Location: Pensacola Fl.
Contact:

Post by ickie »

Are you gonna post a revised version of DST? I could not make it work, all was there but the times did not seem to change?, i had the problem in profile area, it would let me select , yes or no, but would not keep it when page was saved. when I came back it was unselected.
Ickie Berleim

User avatar
heretic
Registered User
Posts: 33
Joined: Mon Mar 25, 2002 4:38 am

Print_topic mod

Post by heretic »

DST MOD will not show in the "printable topic" mod

blulegend
Registered User
Posts: 83
Joined: Wed Jan 30, 2002 5:41 pm

Post by blulegend »

I do not have the printable topic mod so I wouldn't know.

ickie
Registered User
Posts: 20
Joined: Fri Apr 05, 2002 1:16 pm
Location: Pensacola Fl.
Contact:

Post by ickie »

lol, i uploaded the bak files was my problem, now that everything is up, I am 1 hour off(as before mod) and when I click yes in DST (profile area) i become 2 hours off (-2 hrs), hummm, .............. I have checked my server clock and all is ok, and in admin/conf , I have central checked, any thoughts on this?? ( I am on central, my server is on central and in admin/conf it is set to central)
Ickie Berleim

blulegend
Registered User
Posts: 83
Joined: Wed Jan 30, 2002 5:41 pm

Post by blulegend »

The only thing I can think of is this:

Code: Select all

if ( $board_config['dstime'] ) $tz++; // DST MOD
Make sure you have added that line and make sure it is ++, NOT --. You might also want to use the following instead though I don't see how it would be any different.

Code: Select all

if ( $board_config['dstime'] ) $tz = $tz + 1; // DST MOD

FunkyDuck
Registered User
Posts: 260
Joined: Sat Apr 20, 2002 11:24 am
Location: Netherlands
Contact:

Post by FunkyDuck »

I did mod my forum with this mod, but I changed it back because I don't like this mod. All people have to change there times twice a year and I think it wont work out.

Does anyone made a better solution (with complete table of dst)

Please Do NOT lock this topic, people want to discuss this issue.
FunkyDuck

Shannado
Registered User
Posts: 303
Joined: Mon Mar 25, 2002 6:54 pm
Location: Drenthe, The Netherlands
Contact:

Post by Shannado »

You can also do the change for your users with a SQL statement.

Code: Select all

UPDATE phpbb_users SET user_timezone='51' WHERE user_timezone='1' AND user_id <> '-1'
if you want to include the guest user:

Code: Select all

UPDATE phpbb_users SET user_timezone='51' WHERE user_timezone='='1'
When you have to change is it back in october you use:

Code: Select all

UPDATE phpbb_users SET user_timezone='51' WHERE user_timezone='1' AND user_id <> '-1'
Greets,
Sven
Cane Corso Forum

FunkyDuck
Registered User
Posts: 260
Joined: Sat Apr 20, 2002 11:24 am
Location: Netherlands
Contact:

Post by FunkyDuck »

Now this is what I mean an exelent work around :):):)

thank you for thinking,.. now there is only one person who changes the time twice a year. and thats me! :)

but where do put this code?
and how do I put it back for quest users?

thank you thank you thank you :):):)
FunkyDuck

Shannado
Registered User
Posts: 303
Joined: Mon Mar 25, 2002 6:54 pm
Location: Drenthe, The Netherlands
Contact:

Post by Shannado »

FunkyDuck wrote: but where do put this code?
and how do I put it back for quest users?

thank you thank you thank you :):):)


You can put the code in phpmyadmin.

And for including the guest user you use

Code: Select all

UPDATE phpbb_users SET user_timezone='1' WHERE user_timezone='='51'
Maybe if I have the time this weekend/tonight I make a separate file, so you dont have to use the program phpmyadmin
Greets,
Sven
Cane Corso Forum

ickie
Registered User
Posts: 20
Joined: Fri Apr 05, 2002 1:16 pm
Location: Pensacola Fl.
Contact:

Post by ickie »

if ( $board_config['dstime'] ) $tz = $tz + 1; // DST MOD

I have made this change as you mentioned, and it works, thanks for the respond.
Ickie Berleim

FunkyDuck
Registered User
Posts: 260
Joined: Sat Apr 20, 2002 11:24 am
Location: Netherlands
Contact:

Post by FunkyDuck »

[quote=Maybe if I have the time this weekend/tonight I make a separate file, so you dont have to use the program phpmyadmin[/quote]

I am looking forward to that :)
FunkyDuck

FunkyDuck
Registered User
Posts: 260
Joined: Sat Apr 20, 2002 11:24 am
Location: Netherlands
Contact:

Post by FunkyDuck »

ickie wrote:
if ( $board_config['dstime'] ) $tz = $tz + 1; // DST MOD

I have made this change as you mentioned, and it works, thanks for the respond.


hey this is a whole other code?
FunkyDuck

TheatreTechie
Registered User
Posts: 15
Joined: Fri Apr 05, 2002 3:44 am

Post by TheatreTechie »

Has there been a final realease of this mod yet?

Suggestion- Have a dropdown menu next to the time in the profile for the dates that DST is for. The user cold select the start and end times. I would do something like this but i know next to nothing about php (going to try and learn some over the summer).

I also saw this
Image
on another board and thats what got me thinking about the dropdown menus with the start and end date so its all automatic and can be changed depending where you live. (could also be turned off if you dont ecperence it)

How hard would it be to do something like that?

Locked

Return to “[2.0.x] MODs in Development”

cron