Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 865)
+++ trunk/CHANGELOG	(revision 866)
@@ -10,7 +10,9 @@
 # = Bugfix
 ! = Update/Change
 
-------------------------------------- 2.7.1 -------------------------------------
+------------------------------------- 2.7.1 -------------------------------------
+29-Oct-2008 Thomas Hornik
+# News: total number of news wasn't calculated correctly
 25-Oct-2008 Christian Sommer
 !	updated basic templates according the template guidelines
 24-Oct-2008 Dietrich Roland Pehlke
Index: trunk/wb/modules/news/view.php
===================================================================
--- trunk/wb/modules/news/view.php	(revision 865)
+++ trunk/wb/modules/news/view.php	(revision 866)
@@ -97,9 +97,11 @@
 		$setting_posts_per_page = '';
 	}
 	
+	$t = time();
 	// Get total number of posts
-	$t = time();
-	$query_total_num = $database->query("SELECT post_id FROM ".TABLE_PREFIX."mod_news_posts WHERE section_id = '$section_id' AND active = '1' AND title != '' $query_extra AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t)");
+	$query_total_num = $database->query("SELECT post_id FROM ".TABLE_PREFIX."mod_news_posts
+		WHERE section_id = '$section_id' AND active = '1' AND title != '' $query_extra 
+		AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t)");
 	$total_num = $query_total_num->numRows();
 
 	// Work-out if we need to add limit code to sql
@@ -110,7 +112,6 @@
 	}
 	
 	// Query posts (for this page)
-	$t = time();
 	$query_posts = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts
 		WHERE section_id = '$section_id' AND active = '1' AND title != ''$query_extra
 		AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t)
@@ -351,4 +352,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
