Revision 866
Added by thorn almost 17 years ago
| view.php | ||
|---|---|---|
| 97 | 97 |
$setting_posts_per_page = ''; |
| 98 | 98 |
} |
| 99 | 99 |
|
| 100 |
$t = time(); |
|
| 100 | 101 |
// Get total number of posts |
| 101 |
$t = time(); |
|
| 102 |
$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)");
|
|
| 102 |
$query_total_num = $database->query("SELECT post_id FROM ".TABLE_PREFIX."mod_news_posts
|
|
| 103 |
WHERE section_id = '$section_id' AND active = '1' AND title != '' $query_extra |
|
| 104 |
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t)"); |
|
| 103 | 105 |
$total_num = $query_total_num->numRows(); |
| 104 | 106 |
|
| 105 | 107 |
// Work-out if we need to add limit code to sql |
| ... | ... | |
| 110 | 112 |
} |
| 111 | 113 |
|
| 112 | 114 |
// Query posts (for this page) |
| 113 |
$t = time(); |
|
| 114 | 115 |
$query_posts = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts
|
| 115 | 116 |
WHERE section_id = '$section_id' AND active = '1' AND title != ''$query_extra |
| 116 | 117 |
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) |
| ... | ... | |
| 351 | 352 |
} |
| 352 | 353 |
} |
| 353 | 354 |
|
| 354 |
?> |
|
| 355 |
?> |
|
Also available in: Unified diff
News: total number of news wasn't calculated correctly