Revision 600
Added by thorn almost 17 years ago
comment.php | ||
---|---|---|
50 | 50 |
define('POST_TITLE', $post_title); |
51 | 51 |
|
52 | 52 |
// don't allow commenting if its disabled, or if post or group is inactive |
53 |
$t = time(); |
|
53 | 54 |
$table_posts = TABLE_PREFIX."mod_news_posts"; |
54 | 55 |
$table_groups = TABLE_PREFIX."mod_news_groups"; |
55 | 56 |
$query = $database->query(" |
56 | 57 |
SELECT p.post_id |
57 | 58 |
FROM $table_posts AS p LEFT OUTER JOIN $table_groups AS g ON p.group_id = g.group_id |
58 | 59 |
WHERE p.post_id='$post_id' AND p.commenting != 'none' AND p.active = '1' AND ( g.active IS NULL OR g.active = '1' ) |
60 |
AND (p.published_when = '0' OR p.published_when <= $t) AND (p.published_until = 0 OR p.published_until >= $t) |
|
59 | 61 |
"); |
60 | 62 |
if($query->numRows() == 0) { |
61 | 63 |
header("Location: ".WB_URL.PAGES_DIRECTORY.""); |
Also available in: Unified diff
module news: added publish_until field to control the visibility of a news-posting by date and time