Page 1 of 1

Calendar HELP Really Bad Future and Past Years

Posted: Thu Dec 13, 2007 6:48 pm
by carasmo
Hello,

On the admin side, I can set how many years in the past and in the future that the administrator can choose from in the drop down menu. My need is that on the front end side, I only want to show 1 year in the past and 1 year in the future when someone clicks the next link and previous link, it goes back many, many years and it looks odd for all those "pages" to be blank.

Please help me.

Thank you!!!!

Re: Calendar HELP Really Bad Future and Past Years

Posted: Fri Dec 14, 2007 4:48 am
by carasmo
Bump

Re: Calendar HELP Really Bad Future and Past Years

Posted: Tue Jan 01, 2008 9:37 pm
by cyberman
Try this:

1. Create an udt

Code: Select all

$current = date('Y');
$past = $current - 1;
$future = $current + 1;
$smarty->assign('current', $current);
$smarty->assign('past', $past);
$smarty->assign('future', $future);
2. Insert this udt in your template (after body tag)

3. Create three pages (for past, current and next year)

4. Go to calendar template and change the next/previous links to links to future / past pages

5. Add something like the following to the pages

current

Code: Select all

{calendar year=$current}
past

Code: Select all

{calendar year=$past}
future
{calendar year=$future}
6. Go to pages last / next year and deactivate option "show in menu".