Pre-Release: fixed bug in archive system for announcements: we have to take "Number of days to display the announcement" into account too.

This commit is contained in:
Kevin
2008-05-02 14:42:06 +00:00
parent fd109896ea
commit d0a9090aa5

View File

@@ -50,9 +50,11 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_foru
{ {
$permissions = $portal_config['portal_announcements_permissions']; $permissions = $portal_config['portal_announcements_permissions'];
$forum_from = $portal_config['portal_global_announcements_forum']; $forum_from = $portal_config['portal_global_announcements_forum'];
$forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array()); $forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
$time = ( $portal_config['portal_announcements_day'] == 0 ) ? 0 : $portal_config['portal_announcements_day'];
$post_time = ($time == 0) ? '' : 'AND topic_last_post_time > ' . (time() - $time * 86400);
$str_where = ''; $str_where = '';
if( $permissions == TRUE ) if( $permissions == TRUE )
@@ -99,6 +101,7 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_foru
OR topic_type = ' . POST_ANNOUNCE . ') OR topic_type = ' . POST_ANNOUNCE . ')
AND topic_approved = 1 AND topic_approved = 1
AND topic_moved_id = 0 AND topic_moved_id = 0
' . $post_time . '
' . $str_where; ' . $str_where;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$total_announcements = (int) $db->sql_fetchfield('num_topics'); $total_announcements = (int) $db->sql_fetchfield('num_topics');