From 3ca9093f7a4ca14b3567d8da8f6bfa42034c58dc Mon Sep 17 00:00:00 2001 From: azett Date: Wed, 3 Oct 2018 15:33:38 +0200 Subject: [PATCH] Calendar plugin: Deprecated each() is useless - commented out. Search: That shit drives me crazy. Not fixed yet, just commented my findings so far. Way to go! --- fp-plugins/calendar/plugin.calendar.php | 6 ++++++ search.php | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/fp-plugins/calendar/plugin.calendar.php b/fp-plugins/calendar/plugin.calendar.php index c9c0a09..4e36596 100755 --- a/fp-plugins/calendar/plugin.calendar.php +++ b/fp-plugins/calendar/plugin.calendar.php @@ -30,9 +30,15 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3, $title = htmlentities(ucfirst($month_name)).' '.$year; #note that some locales don't capitalize month and day names #Begin calendar. Uses a real . See http://diveintomark.org/archives/2002/07/03 + // PHP7 compatibility: Since $pn is never passed, we do not need to create "previous" and "next" elements. + // Commented out to prevent deprecated each() function from being executed. + $p = ''; + $n = ''; +/* @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable if($p) $p = ''.($pl ? ''.$p.'' : $p).' '; if($n) $n = ' '.($nl ? ''.$n.'' : $n).''; +*/ $calendar = ''."\n". '\n"; diff --git a/search.php b/search.php index e1d626e..3007b08 100755 --- a/search.php +++ b/search.php @@ -159,6 +159,15 @@ if (!defined('MOD_INDEX')) { } function smarty_search_result($params, $content, &$smarty, &$repeat) { + /* + // FIXME AZI: each() ersetzen. + Gelernt bisher: + - Diese Funktion wird für jedes Suchergebnis aufgerufen. + - $srchresults ist global und wird vom each() durchlaufen - bei jedem Aufruf geht der Zeiger ein Element weiter + - Frage: Wie kann man das emulieren? Globale Counter-Variable einführen? Oder mit next() das nächste Element von $srchresults holen? + + siehe https://secure.php.net/manual/en/function.each.php + */ global $srchresults, $post;
'.$p.($month_href ? ''.$title.'' : $title).$n."