Joomla.it Forum

Joomla! 1.0.x (versione con supporto terminato) => Le voci di Joomla.it (solo per versione Joomla 1.0.x) => Segnalazione Bug Joomla 1.0.x => : lucapan 03 May 2007, 12:38:21

: Modulo Latest Events corretto
: lucapan 03 May 2007, 12:38:21
Ho corretto un bug nel modulo latest events per cui gli eventi venivano visualizzati in ordine inverso e comunque nell'ordine sbagliato per eventi con date diverse.

Il problema è nella funzione cmpByStartTime del file /modules/mod_events_latest.php.

La funzione corretta è:

:
function cmpByStartTime (&$a, &$b) {
// this custom sort compare function compares the start times of events that are refernced by the a & b vars
  list($aDate, $aStrtTime) = split(" ",$a->publish_up);
    list($bDate, $bStrtTime) = split(" ",$b->publish_up);
if ($aDate == $bDate) {
    if ($aStrtTime == $bStrtTime) return 0;
    return ($aStrtTime < $bStrtTime) ? -1 : 1;
}
else {
return ($aDate < $bDate) ? -1 : 1;
}
}

Spero di essere stato di aiuto  ;)