Hallo!
Sämtliche Götter des phpBB mögen mir für meine grobe Mißachtung aller Coding-Guidlines gnädig sein:
Öffne includes/functions_display.php + Finde:
Code: Alles auswählen
$last_post_time = $user->format_date($row['forum_last_post_time']);
Ersetze mit:
Code: Alles auswählen
$last_post_time = $user->format_date($row['forum_last_post_time'], false, false, true);
Öffne includes/sessions.php + Finde:
Code: Alles auswählen
function format_date($gmepoch, $format = false, $forcedate = false)
Ersetze mit:
Code: Alles auswählen
function format_date($gmepoch, $format = false, $forcedate = false, $colored = false)
Finde:
Code: Alles auswählen
else if ($gmepoch > $midnight && !$forcedate)
{
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
return str_replace('||', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
}
else if ($gmepoch > $midnight - 86400 && !$forcedate)
{
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
}
Ersetze mit:
Code: Alles auswählen
else if ($gmepoch > $midnight && !$forcedate)
{
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
$colorcode = $colored ? '<span style="color: #ff0000;display: inline; font-weight: bold; padding: 0;">'.$this->lang['datetime']['TODAY'].'</span>' : $this->lang['datetime']['TODAY'];
return str_replace('||', $colorcode, strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
}
else if ($gmepoch > $midnight - 86400 && !$forcedate)
{
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
$colorcode = $colored ? '<span style="color: #32CD32;display: inline; font-weight: bold; padding: 0;">'.$this->lang['datetime']['YESTERDAY'].'</span>' : $this->lang['datetime']['YESTERDAY'];
return str_replace('||', $colorcode, strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
}
Das könnte man jetzt hübsch in einen MOD verpacken. Bitte gib erstmal Bescheid, ob es tut, ich konnte es nur mit "Heute" testen. Der ganze Kram ist nur notwenid, weil ja nicht alle Datums-Vorkommen von "Heute" und Gestern ersetzt werden sollen, sondern nur das im Index.
EDIT: Im viewforum habe ich es auch gesehen. Wo brauchst du die Färberei überall?
Viele Grüße,
Bálint