WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 16.09.2026 13:01:38

blitzlicht12
Mitglied

procalendar

Hallo,
wie kann ich beim procalendar die vergangenen Monate und Jahre für die Besucher "unzugänglich" machen, bzw. ausblenden? - Eventuell (Luxusversion) nur 1 oder 2 Monate rückläufig zugänglich machen? Komme da jetzt nicht weiter...

VG und herzlichen Dank im Voraus!

Offline

#2 19.09.2026 08:44:17

florian
Administrator

Re: procalendar

Um zurückliegende Monate unerreichbar zu machen, ändere die /modules/procalendar/view.php wie folgt:
Füge ganz unten vor

ShowCalendar($month,$year,$actions,$section_id,false);

ein:

if ($month < date("n") && $year <= date("Y")) {
		$month = date("n");
		$year = date("Y");
	}

Ändere in der functions.php, Zeile 254ff

 $output = '<div class="show_calendar">';
  $output .= '<table border="0" cellpadding="0" cellspacing="0" class="calendarmod" >';
  $output .= '  <tr class="calendarmod-header">';
  $output .= '    <td><span class="arrows"><a href="?page_id=' . $page_id . '&amp;month=' . $month . '&amp;year=' . ($year-1)  . '" title="' . ($year-1). '">&laquo;</a></span>';
  $output .= '    <span><a href="?page_id=' . $page_id . '&amp;month=' . $prevmonth . '&amp;year=' . $prevyear . '" title="' . $monthnames[$prevmonth] . '">&lsaquo;</a></span></td>';
  $output .= '    <td colspan="5" width="150">' . $monthnames[$month] . '&nbsp;' . $year . '</td>';
  $output .= '    <td><span class="arrows"><a href="?page_id=' . $page_id . '&amp;month=' . $nextmonth . '&amp;year=' . $nextyear . '" title="' . $monthnames[$nextmonth] . '">&rsaquo;</a></span>';
  $output .= '    <span><a href="?page_id=' . $page_id . '&amp;month=' . $month . '&amp;year=' . ($year+1)  . '" title="' . ($year+1). '">&raquo;</a></span></td>';
  $output .= ' </tr>';

zu

$output = '<div class="show_calendar">';
  $output .= '<table border="0" cellpadding="0" cellspacing="0" class="calendarmod" >';
  $output .= '  <tr class="calendarmod-header">';
  if ($month > date("n") || $year > date("Y")) {
	$output .= '	  <td>';
	$output .= '    <span><a href="?page_id=' . $page_id . '&amp;month=' . $prevmonth . '&amp;year=' . $prevyear . '" title="' . $monthnames[$prevmonth] . '">&lsaquo;</a></span></td>';
  } else {
	$output .= '	  <td>&nbsp;</td>';
  }
  $output .= '    <td colspan="5" width="150">' . $monthnames[$month] . '&nbsp;' . $year . '</td>';
  $output .= '    <td><span class="arrows"><a href="?page_id=' . $page_id . '&amp;month=' . $nextmonth . '&amp;year=' . $nextyear . '" title="' . $monthnames[$nextmonth] . '">&rsaquo;</a></span>';
  $output .= '    <span><a href="?page_id=' . $page_id . '&amp;month=' . $month . '&amp;year=' . ($year+1)  . '" title="' . ($year+1). '">&raquo;</a></span></td>';
  $output .= ' </tr>';

Das Ergebnis ist dann, dass der Jahr-Zurück-Button generell nicht angezeigt wird und der MonatZurück-Button nur in den Folgemonaten.
Deer direkte Aufruf vergangener Monate über die URL-Paramater &month=8&year=2025 o.ä. führt dann auch immer nur auf die Anzeige des aktuellen Monats.


Wir Benötigen: Cents, Euros... jetzt spenden!

Offline

Fußzeile des Forums

up