Help with time-based conditionals

I'm in WordPress (don't know if that matters for this particular code) and I'm trying to display various different things between certain dates, and something else outside of those dates.

Here's what I have so far:

<?php $eventheader = getdate() ?>
<?php if ($eventheader[mon] = 2 && $eventheader[mday] > 12 && $eventheader[mday] < 22){ ?>
<?php include (TEMPLATEPATH . '/event-winter.php'); ?> <!-- Winter Cup -->
<?php if ($eventheader[mon] = 3 && $eventheader[mday] > 4 && $eventheader[mday] < 14){ ?>
<?php include (TEMPLATEPATH . '/event-margutti.php'); ?> <!-- Margutti Trophy -->
<?php if ($eventheader[mon] = 3 && $eventheader[mday] > 4 && $eventheader[mday] < 14){ ?>
<?php include (TEMPLATEPATH . '/event-wsk1.php'); ?> <!-- WSK Round 1 -->
<?php } else { ?>
<?php include (TEMPLATEPATH . '/poll.php'); ?> <!-- Any other time -->
<?php } ?>

As anyone familiar with PHP can probably see, it works with just either event-winter.php or poll.php, but I'm the noobiest of noobs and I don't know how to make it choose from a whole list. Does anyone else know or can point me to an informative link?

Leave a Reply




Created by DesignForWeb company. All rights reserved © 2007-2010. Check also the iPhone / iPad developers blog
Disclaimer
The materials collected in this blog were taken from open access sources. We try our best to preserve the copyrights of original authors and clearly state the authorship as well as link to original source website where it's possible. Please leave your comment if you feel offended by any post or if you dispose of any information about breach of copyright law in this blog. We will do our best to resolve the situation immediately.