I tried to add the popular Today At/Yesterday Mod to a site of mine running PNphpBB2 and all the posts dates became "Today at" with blank following those two words, even for posts that were not made today. After some troubleshooting I got it to work- basically instead of adding these lines to includes/page_header.php:
//
// MOD - TODAY AT - BEGIN
// PARSE DATEFORMAT TO GET TIME FORMAT
//
$time_reg = '([gh][[:punct:][:space:]]{1,2}[i][[:punct:][:space:]]{0,2}[a]?[[:punct:][:space:]]{0,2}[S]?)';
eregi($time_reg, $board_config['default_dateformat'], $regs);
$board_config['default_timeformat'] = $regs[1];
unset($time_reg);
unset($regs);
//
// GET THE TIME TODAY AND YESTERDAY
//
$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));
$board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['dstime'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]);
$board_config['time_yesterday'] = $board_config['time_today'] - 86400;
unset($today_ary);
// MOD - TODAY AT - END
I changed them to:
//
// MOD - TODAY AT - BEGIN
// PARSE DATEFORMAT TO GET TIME FORMAT
//
$board_config['default_timeformat'] = '%I:%M %p';
//
// GET THE TIME TODAY AND YESTERDAY
//
$board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['dstime'],0,0,date('n'),date('j'),date('Y'));
$board_config['time_yesterday'] = $board_config['time_today'] - 86400;
// MOD - TODAY AT - END
I'm not sure if this fix only applies to PNphpBB2 or also newer versions of phpBB also, but hope it helps anyone else out there!
UPDATE: This "fix" doesn't exactly work all the time either. For now I don't have further time to spend on this issue so I've removed the mod altogether.
Subscribe to:
Posts (Atom)