zB:
PHP-Code:
<?php
// ID of calendar module
$intModuleId = 79;
// current year and month
$actualDate = date('Ym');
// given year and month
if ($inputMonth = \Input::get('month'))
{
$actualDate = $inputMonth;
}
// extract year and month
$currentYear = intval(substr($actualDate, 0, 4));
$currentMonth = intval(substr($actualDate, -2));
// iterate through months
for( $i = 0; $i <= 5; ++$i )
{
$nextYear = $currentYear;
$nextMonth = $currentMonth + $i;
if( $nextMonth > 12 )
{
$nextYear++;
$nextMonth = $nextMonth % 12;
}
// month output
\Input::setGet('month', $nextYear.str_pad($nextMonth, 2, '0', STR_PAD_LEFT));
echo \Controller::getFrontendModule($intModuleId);
}
Lesezeichen