Skip to content

Instantly share code, notes, and snippets.

@seanmcn
Created December 3, 2014 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanmcn/340eb2ed8f04156932a3 to your computer and use it in GitHub Desktop.
Save seanmcn/340eb2ed8f04156932a3 to your computer and use it in GitHub Desktop.
Some legacy code from OTS
<?php
/*
* Author: Sean McNamara
* Some legacy code from OTS
*/
$tr_date = strtotime($options['tr_date']);
$fest_date = strtotime($options['fest_date']);
$games_date = strtotime($options['games_date']);
$now = strtotime("now");
$difference = $tr_date - $now;
if ($difference < 0) { $difference = 0; }
echo "<div class=\"countdown_container\"><div class=\"countdown_days\"><h2>Torch Relay</h2>". ceil($difference/60/60/24)."<em>days</em><br /><date>18th May 2012</date></div></div>";
$difference = $fest_date - $now;
if ($difference < 0) { $difference = 0; }
echo "<div class=\"countdown_container\"><div class=\"countdown_days\"><h2>Festival Date</h2>". ceil($difference/60/60/24)."<em>days</em><br /><date>21st June 2012</date></div></div>";
$difference = $games_date - $now;
if ($difference < 0) { $difference = 0; }
echo "<div class=\"countdown_container\"><div class=\"countdown_days\"><h2>Olympic Games</h2>". ceil($difference/60/60/24)."<em>days</em><br /><date>27th July 2012</date></div></div>";
?>
<div class="olympic_date">Olympic Games {pyro:theme:image file="torch_icon.png"} <date>27th July - 12th August 2012</date></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment