Project

General

Profile

« Previous | Next » 

Revision 663

Added by thorn almost 17 years ago

out-of-date default page isn't shown anymore, instead shows next public page

View differences:

trunk/CHANGELOG
10 10
# = Bugfix
11 11
! = Update/Change
12 12

  
13
------------------------------------- 2.7.0 -------------------------------------
13
------------------------------------- 2.7.0 -------------------------------------
14
03-Feb-2008 Thomas Hornik
15
#	out-of-date default page isn't shown anymore, instead shows next public page.
14 16
03-Feb-2008 Matthias Gallas
15 17
+	added kewyword id to all new files
16 18
02-Feb-2008 Christian Sommer
trunk/wb/framework/class.frontend.php
84 84
		}
85 85
		// Get default page
86 86
		// Check for a page id
87
		$query_default = "SELECT page_id,link FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND visibility = 'public'$this->sql_where_language ORDER BY position ASC LIMIT 1";
87
		$table_p = TABLE_PREFIX.'pages';
88
		$table_s = TABLE_PREFIX.'sections';
89
		$now = time();
90
		$query_default = "
91
			SELECT p.page_id, p.link
92
			FROM $table_p AS p, $table_s AS s
93
			WHERE p.page_id=s.page_id
94
			AND p.parent = '0' AND p.visibility = 'public'
95
			AND (($now>=s.publ_start OR s.publ_start=0) AND ($now<=s.publ_end OR s.publ_end=0))
96
			$this->sql_where_language
97
			ORDER BY p.position ASC LIMIT 1";
88 98
		$get_default = $database->query($query_default);
89 99
		$default_num_rows = $get_default->numRows();
90 100
		if(!isset($page_id) OR !is_numeric($page_id)){
trunk/wb/framework/frontend.functions.php
209 209
			while($section = $query_sections->fetchRow()) {
210 210
				// skip this section if it is out of publication-date
211 211
				$now = time();
212
				if( !( $now<$section['publ_end'] && ($now>$section['publ_start'] || $section['publ_start']==0) ||
213
					$now>$section['publ_start'] && $section['publ_end']==0) ) {
212
				if( !(($now<=$section['publ_end'] || $section['publ_end']==0) && ($now>=$section['publ_start'] || $section['publ_start']==0)) ) {
214 213
					continue;
215 214
				}
216 215
				$section_id = $section['section_id'];

Also available in: Unified diff