Member feed block where born today pulling early
Submitted Aiwa, Apr 18 2012 09:14 AM | Last updated Apr 18 2012 09:14 AM
[attachment=38831:birthday.png]
This is a members feed block where born today is yes...
The block is cached for 60 minutes, and set to not display if there is no content. My timezone is CST, board default timezone is CST, the server timezone is EST (It's in Orlando).
I don't know exactly when it pulled the data and populated the block... That time is just when I noticed it... I can understand caching keeping it present for a little longer, that's fine... But it shouldn't be pulling early...
I just keep having all of these relative date issues.
This is a members feed block where born today is yes...
The block is cached for 60 minutes, and set to not display if there is no content. My timezone is CST, board default timezone is CST, the server timezone is EST (It's in Orlando).
I don't know exactly when it pulled the data and populated the block... That time is just when I noticed it... I can understand caching keeping it present for a little longer, that's fine... But it shouldn't be pulling early...
I just keep having all of these relative date issues.
| Status: | Fixed |
| Version: | 2.3.1 |
| Fixed In: | 2.3.2 |











5 Comments
admin/applications/members/extensions/content/feed_blocks/members.php
Find
if( $config['filters']['filter_bday_day'] ) { $_whereMembers[] = "m.bday_day=" . date('j') . " AND m.bday_month=" . date('n'); } if( $config['filters']['filter_bday_mon'] ) { $_whereMembers[] = "m.bday_month=" . date('n'); }change to
if( $config['filters']['filter_bday_day'] ) { $_whereMembers[] = "m.bday_day=" . date('j', IPS_UNIX_TIME_NOW + $this->registry->class_localization->getTimeOffset() ) . " AND m.bday_month=" . date('n', IPS_UNIX_TIME_NOW + $this->registry->class_localization->getTimeOffset() ); } if( $config['filters']['filter_bday_mon'] ) { $_whereMembers[] = "m.bday_month=" . date('n', IPS_UNIX_TIME_NOW + $this->registry->class_localization->getTimeOffset() ); }That should apply your local (or, for guests, the board default) time zone offset to the current time when determining what day/month it is for this purpose.
If you test the patch, let me know if it resolves the issue for you.
Applying the patch now... I'll set up a test account with a birthday tomorrow and let you know what I find this evening.
Did some further testing too... Changed my timezone back a couple hours to make it 'yesterday' again and it switched back to 4/18 members as it should.
Thanks Brandon!