Skip to content

Instantly share code, notes, and snippets.

@joshuaadickerson
Created April 5, 2013 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuaadickerson/5319926 to your computer and use it in GitHub Desktop.
Save joshuaadickerson/5319926 to your computer and use it in GitHub Desktop.
<?php
// When was the last time this topic was replied to? Should we warn them about it?
$request = $smcFunc['db_query']('', '
SELECT poster_time
FROM {db_prefix}messages
WHERE id_msg = {int:id_last_msg}
LIMIT 1',
array(
'id_last_msg' => $topicinfo['id_last_msg'],
)
);
list ($lastPostTime) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$context['oldTopicError'] = !empty($modSettings['oldTopicDays']) && $lastPostTime + $modSettings['oldTopicDays'] * 86400 < time() && empty($topicinfo['is_sticky']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment