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!
This commit is contained in:
parent
50c492c5a6
commit
3ca9093f7a
@ -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
|
$title = htmlentities(ucfirst($month_name)).' '.$year; #note that some locales don't capitalize month and day names
|
||||||
|
|
||||||
#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
|
#Begin calendar. Uses a real <caption>. 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
|
@list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable
|
||||||
if($p) $p = '<span class="calendar-prev">'.($pl ? '<a href="'.($pl).'">'.$p.'</a>' : $p).'</span> ';
|
if($p) $p = '<span class="calendar-prev">'.($pl ? '<a href="'.($pl).'">'.$p.'</a>' : $p).'</span> ';
|
||||||
if($n) $n = ' <span class="calendar-next">'.($nl ? '<a href="'.($nl).'">'.$n.'</a>' : $n).'</span>';
|
if($n) $n = ' <span class="calendar-next">'.($nl ? '<a href="'.($nl).'">'.$n.'</a>' : $n).'</span>';
|
||||||
|
*/
|
||||||
$calendar = '<table class="calendar">'."\n".
|
$calendar = '<table class="calendar">'."\n".
|
||||||
'<caption class="calendar-month">'.$p.($month_href ? '<a href="'.($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";
|
'<caption class="calendar-month">'.$p.($month_href ? '<a href="'.($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";
|
||||||
|
|
||||||
|
@ -159,6 +159,15 @@ if (!defined('MOD_INDEX')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function smarty_search_result($params, $content, &$smarty, &$repeat) {
|
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;
|
global $srchresults, $post;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user