Relics
04-06-2010, 05:42 AM
I have a problem that I need someone who knows PHP to help me with.
I am creating a theme for Wordpress and I've created a admin options panel where you can set up some options on the theme. I have a php script on a page that displays only when certain dates are entered in the "$start" declaration. I need to change to month and day choices from the numbers to the declarations from the options panel. I've included the script below. If someone could show me the correct code to replace the "-04-04" in the "$start" declaration to use the "$tohh_month_start" and the "$tohh_day_start" instead of the numbers, I would greatly appreciate it.
<?php
$tohh_timezone = get_option('tohh_ticketbuy_timezone');
$tohh_month_start = get_option('tohh_ticketbuy_month_start');
$tohh_day_start = get_option('tohh_ticketbuy_day_start');
$tohh_month_stop = get_option('tohh_ticketbuy_month_stop');
$tohh_day_stop = get_option('tohh_ticketbuy_day_stop');
date_default_timezone_set('$tohh_timezone');
$today = strtotime(date('Y-m-d'));
$start = strtotime(date('Y') . '-04-04');
$end = strtotime(date('Y') . '-04-20');
if($today >= $start && $today <= $end) { ?>
<!-- START -->
It works!
<!-- END -->
<?php } ?>
I am creating a theme for Wordpress and I've created a admin options panel where you can set up some options on the theme. I have a php script on a page that displays only when certain dates are entered in the "$start" declaration. I need to change to month and day choices from the numbers to the declarations from the options panel. I've included the script below. If someone could show me the correct code to replace the "-04-04" in the "$start" declaration to use the "$tohh_month_start" and the "$tohh_day_start" instead of the numbers, I would greatly appreciate it.
<?php
$tohh_timezone = get_option('tohh_ticketbuy_timezone');
$tohh_month_start = get_option('tohh_ticketbuy_month_start');
$tohh_day_start = get_option('tohh_ticketbuy_day_start');
$tohh_month_stop = get_option('tohh_ticketbuy_month_stop');
$tohh_day_stop = get_option('tohh_ticketbuy_day_stop');
date_default_timezone_set('$tohh_timezone');
$today = strtotime(date('Y-m-d'));
$start = strtotime(date('Y') . '-04-04');
$end = strtotime(date('Y') . '-04-20');
if($today >= $start && $today <= $end) { ?>
<!-- START -->
It works!
<!-- END -->
<?php } ?>