Page 2 of 5

Posted: Sat Apr 20, 2002 12:46 am
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.

RE: complexity & breaking last visit mod

Posted: Sat Apr 20, 2002 2:53 pm
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.

Posted: Mon Apr 22, 2002 1:06 pm
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.

Print_topic mod

Posted: Mon Apr 22, 2002 5:54 pm
by heretic
DST MOD will not show in the "printable topic" mod

Posted: Mon Apr 22, 2002 7:13 pm
by blulegend
I do not have the printable topic mod so I wouldn't know.

Posted: Tue Apr 23, 2002 9:57 pm
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)

Posted: Fri Apr 26, 2002 11:15 am
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

Posted: Fri May 03, 2002 11:24 am
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.

Posted: Fri May 03, 2002 11:31 am
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'

Posted: Fri May 03, 2002 12:51 pm
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 :):):)

Posted: Fri May 03, 2002 1:04 pm
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

Posted: Fri May 03, 2002 9:51 pm
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.

Posted: Sat May 04, 2002 2:36 pm
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 :)

Posted: Sat May 04, 2002 2:37 pm
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?

Posted: Sat May 04, 2002 4:11 pm
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?