Changing the Year.

In all my year options like site news, coupons, etc. The maximum year is 2009. Is there a way to extend it that I just cant find? Thanks so much!

I “think” it looks like the options are generated in fn_common.php



unfortunately, I am not smart enough to tell you how to change what it generates

:confused:



(it took me forever to find where it comes from) LOL



Part 1


function fn_this_day_begin()
{
$current_date = 0;
$current_date = time();
$_date_year = strftime("%Y", $current_date);
$_date_month = strftime("%m", $current_date);
$_date_day = strftime("%d", $current_date);
return mktime(0, 0, 0, $_date_month, $_date_day, $_date_year);






Part 2



Each different condition returns a different format




function fn_create_periods($period, $time_from, $time_to)
{
global $smarty;

$today = getdate(TIME);

if (is_array($time_from) && !fn_is_empty($time_from)) {
$time_from = mktime(0, 0, 0, $time_from[0], $time_from[1], $time_from[2]);
}
if (is_array($time_to) && !fn_is_empty($time_to)) {
$time_to = mktime(0, 0, 0, $time_to[0], $time_to[1], $time_to[2]);
}

if ($period != 'C' || empty($time_to)) {
$time_to = TIME;
}

$tto = getdate($time_to);
$time_to = mktime(23, 59, 59, $tto['mon'], $tto['mday'], $tto['year']);

if ($period == 'D') {
$time_from = mktime(0, 0, 0, $today['mon'], $today['mday'], $today['year']);
} elseif ($period == 'W') {
$wday = empty($today['wday']) ? "6" : (($today['wday'] == 1) ? "0" : $today['wday'] - 1);
$wstart = getdate(strtotime("-$wday day"));
$time_from = mktime(0, 0, 0, $wstart['mon'], $wstart['mday'], $wstart['year']);
} elseif ($period == 'M') {
$time_from = mktime(0, 0, 0, $today['mon'], 1, $today['year']);
}

$smarty->assign('time_from', $time_from);
$smarty->assign('time_to', $time_to);

return array($time_from, $time_to);
}

sometimes I just have to figure something out for the fun of it…

anyways, here’s how it works…the dropdowns are generated from a smarty plugin.



each template that utilizes a drop down option selectbox has its own parameters defined in the smarty statement on the template page.

MOST of them look like this:


{html_select_date field_array="ads[`$ad.ad_id`][timestamp]" time=$ad.timestamp|default:$smarty.const.TIME start_year=$settings.Company.company_start_year}




The default setting for smarty is to show the current year as the “end_year”



I would guess there is an easier way to do it for ALL the dropdowns, but to do specific templates simply add [COLOR=“Red”]end_year=“+5”[/COLOR] (I am using 5, you can use any number) to the end of the “html_select_date” variable

like this:




{html_select_date field_array="ads[`$ad.ad_id`][timestamp]" time=$ad.timestamp|default:$smarty.const.TIME start_year=$settings.Company.company_start_year[COLOR="Red"][B] end_year="+5"[/B][/COLOR]}




Here is a link of all the variables for this code:



[URL=“http://smarty.activeventure.org/language.function.html.select.date.html”]http://smarty.activeventure.org/language.function.html.select.date.html[/URL]



Like I said, I suspect you can change it globally, but I am not sure how.

How are you so smart lol. Thank you.