Advertisement:

Author Topic: Time Passed Since Last Reply  (Read 14339 times)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Time Passed Since Last Reply
« on: August 18, 2008, 11:28:21 AM »
Question: Is it possible to display how much time passed from last reply instead of displaying the date of last reply on Board Index?
Original Topic: http://www.simplemachines.org/community/index.php?topic=248091.0

../Sources/BoardIndex.php

Find:

Code: [Select]
// Prepare the subject, and make sure it's not too long.
Replace:

Code: [Select]
$time = 0;
$timeh = 0;
$timem = 0;
$times= 0;

$time = time() - $row_board['posterTime'];
if($time > 60) {
$timem = $time / 60;
$timem = (int) $timem;
$times = $time % 60;
}
else
$times = $time;

if($timem > 60) {
$timeh = $timem / 60;
$timeh = (int) $timeh;
$timem = $timem % 60;
}
$time = (!empty($timeh) ? $timeh . 'H ' : '') . (!empty($timem) ? $timem . 'M ' : '') . $times . 'S';

// Prepare the subject, and make sure it's not too long.

Find:

Code: [Select]
'timestamp' => forum_time(true, $row_board['posterTime']),
Replace:

Code: [Select]
'timestamp' => forum_time(true, $row_board['posterTime']),
'timebefore' => $time,

../Themes/your_theme/BoardIndex.template.php

Find:

Code: [Select]
$board['last_post']['time']
Replace:

Code: [Select]
$board['last_post']['timebefore']
« Last Edit: August 18, 2008, 11:29:04 AM by H »
Former SMF Core Developer | My Mods | SimplePortal