Playa del Carmen, Mexico's virtual guidebook written by locals
 

Go Back   www.Playa.info > Administrative > Feedback
FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools
Old 03-01-2013   #1 (permalink)
aņejo
 
shivors's Avatar
 
Join Date: Aug 2010
Location: Quad Cities (IA/IL)
Posts: 1,558
VAC Counter Issue

Anyone else notice that the vacation counters have the wrong counts? Set mine up to May 2nd 2013 and it is showing 78 days or so.

Apologies if this was covered in a thread somewhere.
shivors is offline   Reply With Quote
Old 03-03-2013   #2 (permalink)
beach geek
admin
 
james's Avatar
 
Join Date: Apr 2001
Location: 10 year Playa resident lost in Sweden
Posts: 12,966
The image will print $remaining_days." days and counting..." for $remaining_days > 1

where:

$remaining_days=ceil(($_GET["arrival"]-time())/86400)

arrival is the Unix timestamp of your arrival date and time() is the current server timestamp.

It's just math. It's been working for over a decade now. Perhaps you selected the wrong date?

This is for March 30th:
__________________
Get your own signature countdown image!

james is offline   Reply With Quote
Old 03-03-2013   #3 (permalink)
aņejo
 
shivors's Avatar
 
Join Date: Aug 2010
Location: Quad Cities (IA/IL)
Posts: 1,558
Edit...just saw the counter is down to 60 days. Guessing it was something wonky client side.

Last edited by shivors; 03-03-2013 at 12:18 PM..
shivors is offline   Reply With Quote
Old 03-03-2013   #4 (permalink)
beach geek
admin
 
james's Avatar
 
Join Date: Apr 2001
Location: 10 year Playa resident lost in Sweden
Posts: 12,966
evil cache perhaps
__________________
Get your own signature countdown image!

james is offline   Reply With Quote
Old 03-03-2013   #5 (permalink)
aņejo
 
shivors's Avatar
 
Join Date: Aug 2010
Location: Quad Cities (IA/IL)
Posts: 1,558
I think it might be something much more nefarious. I think our ISP is doing some DNS redirection and caching. Switched over to Google's DNS servers.
shivors is offline   Reply With Quote
Old 03-05-2013   #6 (permalink)
aņejo
 
shivors's Avatar
 
Join Date: Aug 2010
Location: Quad Cities (IA/IL)
Posts: 1,558
Not our ISP...Was working normally for me and then just saw it is back to 78 days for some reason. Obviously somehting in our area since no one else has the issue. Weird.


shivors is offline   Reply With Quote
Old 03-06-2013   #7 (permalink)
beach geek
admin
 
james's Avatar
 
Join Date: Apr 2001
Location: 10 year Playa resident lost in Sweden
Posts: 12,966
All of those counters are produced in the moment by a script using a PHP extension called Imagemagick. They are also given the following headers to ensure that all 'logical' caches should seek a fresh copy for each request.

Code:
header("Content-type: image/png");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");             // turn off caching
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
If you look at the URI for the image you can see that it's composed of a UNIX timestamp and a background choice.

Code:
http://www.playa.info/countdown1364616000b10.png
When Apache sees that URI it rips it apart and sends the variables to a script that hands you a PNG image.

If you are getting a bad date, we've either had a cataclysmic math failure (alert NASA!) OR, more likely, you have a clog in your intertube somewhere. These clogs are better known as caches. I don't know of anything else I can do on my side to further discourage the clogging.

I've not had this mentioned before. My recommendation: make sure you have a backup calendar so you don't miss your flight due to a cached countdown signature image!
__________________
Get your own signature countdown image!

james is offline   Reply With Quote
Old 03-06-2013   #8 (permalink)
aņejo
 
shivors's Avatar
 
Join Date: Aug 2010
Location: Quad Cities (IA/IL)
Posts: 1,558
Quote:
Originally Posted by james View Post
All of those counters are produced in the moment by a script using a PHP extension called Imagemagick. They are also given the following headers to ensure that all 'logical' caches should seek a fresh copy for each request.

Code:
header("Content-type: image/png");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");             // turn off caching
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
If you look at the URI for the image you can see that it's composed of a UNIX timestamp and a background choice.

Code:
http://www.playa.info/countdown1364616000b10.png
When Apache sees that URI it rips it apart and sends the variables to a script that hands you a PNG image.

If you are getting a bad date, we've either had a cataclysmic math failure (alert NASA!) OR, more likely, you have a clog in your intertube somewhere. These clogs are better known as caches. I don't know of anything else I can do on my side to further discourage the clogging.

I've not had this mentioned before. My recommendation: make sure you have a backup calendar so you don't miss your flight due to a cached countdown signature image!
LOL...not a chance in hell. Oh I just thought it was interesting...no biggie. I originally thought it was a ISP issue here at home but it happened at work too.
shivors is offline   Reply With Quote
Old 03-06-2013   #9 (permalink)
beach geek
admin
 
james's Avatar
 
Join Date: Apr 2001
Location: 10 year Playa resident lost in Sweden
Posts: 12,966
Quote:
Originally Posted by shivors View Post
...but it happened at work too.
now that's an interesting twist. same device by chance?
__________________
Get your own signature countdown image!

james is offline   Reply With Quote
Old 03-06-2013   #10 (permalink)
aņejo
 
shivors's Avatar
 
Join Date: Aug 2010
Location: Quad Cities (IA/IL)
Posts: 1,558
Quote:
Originally Posted by james View Post
now that's an interesting twist. same device by chance?
Geeks find the oddest things interesting.

Different machines, OS's, browsers and internet paths. I work on a US Army facility and our internet connection is routed through a rear proxy, past an IPS and through a front proxy. I expected the issue there as the proxy caching is reedonkulous. I am actually fairly baffled. BTW this morning it is working here at home again. <Shrug>
shivors is offline   Reply With Quote
Old 03-06-2013   #11 (permalink)
Uno
PROUD RANDOMITE

 
Uno's Avatar
 
Join Date: Oct 2008
Location: Western Oregon in the rain
Posts: 23,099
Quote:
Originally Posted by shivors View Post
Anyone else notice that the vacation counters have the wrong counts? Set mine up to May 2nd 2013 and it is showing 78 days or so.

Apologies if this was covered in a thread somewhere.
If have an issue with mine as well. The biggest issue is that I don't have one.
Uno is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 02:04 PM.


Powered by: vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.