Calendar HELP Really Bad Future and Past Years

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Calendar HELP Really Bad Future and Past Years

Post 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!!!!
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: Calendar HELP Really Bad Future and Past Years

Post by carasmo »

Bump
cyberman

Re: Calendar HELP Really Bad Future and Past Years

Post 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".
Post Reply

Return to “CMSMS Core”