Project

General

Profile

« Previous | Next » 

Revision 600

Added by thorn almost 17 years ago

module news: added publish_until field to control the visibility of a news-posting by date and time

View differences:

search.php
34 34
	$result = false;
35 35

  
36 36
	// fetch all active news-posts (from active groups) in this section.
37
	$t = time();
37 38
	$table_posts = TABLE_PREFIX."mod_news_posts";
38 39
	$table_groups = TABLE_PREFIX."mod_news_groups";
39 40
	$query = $func_database->query("
40 41
		SELECT p.post_id, p.title, p.content_short, p.content_long, p.link, p.posted_when, p.posted_by
41 42
		FROM $table_posts AS p LEFT OUTER JOIN $table_groups AS g ON p.group_id = g.group_id
42 43
		WHERE p.section_id='$func_section_id' AND p.active = '1' AND ( g.active IS NULL OR g.active = '1' )
44
		AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t)
43 45
		ORDER BY p.post_id DESC
44 46
	");
45 47
	// now call print_excerpt() for every single post

Also available in: Unified diff