Just be aware that 'user_lastpost_time' also includes PM-messages, so this may reflect either a posts or a private message and may be inappropriate under some circumstancesIPB_Refugee wrote:that shouldn't be difficult to code as there is a column called user_lastpost_time in USERS_TABLE. Maybe even
$user->data['user_lastpost_time']
would work in an appropriate IF statement (e.g. placed in function page_header)
Code: Select all
// Generate logged in/logged out status
Code: Select all
//-- mod: warning for lazy posters by IPB_Refugee --------------------------//
if ($user->data['user_id'] != ANONYMOUS)
{
$warning_after_days = 30;
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
WHERE poster_id = " . $db->sql_escape($user->data['user_id']);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$last_post_time = (int) $row['last_post_time'];
if ((time() - $last_post_time) > ($warning_after_days * 86400))
{
$template->assign_vars(array(
'SHOW_LAZY_WARNING' => true,
));
}
}
//-- end: warning for lazy posters by IPB_Refugee --------------------------//
Code: Select all
$warning_after_days = 30;
Code: Select all
$warning_after_days = 14;
Code: Select all
<!-- IF SHOW_LAZY_WARNING -->
your HTML code here
<!-- ENDIF -->
Code: Select all
<!-- IF SHOW_LAZY_WARNING -->
<h2>Hi, {S_USERNAME}!</h2>
<p>Please start posting immediately! Thanks.</p>
<!-- ENDIF -->