Back to top

Autore Topic: Modulo Latest Events corretto  (Letto 2312 volte)

Offline lucapan

  • Nuovo arrivato
  • *
  • Post: 2
    • Mostra profilo
Modulo Latest Events corretto
« il: 03 Mag 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 è:

Codice: [Seleziona]
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  ;)

 



Web Design Bolzano Kreatif