Ignore:
Timestamp:
08/19/08 17:20:13 (4 years ago)
Author:
hverton
Message:

updated the forums theads side panel to use the new forum setting to limit forum message visibility for guests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/common/forum_threads_panel/php-files/modules/forum_threads_panel/forum_threads_panel.php

    r865 r1658  
    2121$variables = array(); 
    2222 
    23 // newest threads 
     23// check if there is a thread time limit defined for guests 
     24$thread_limit = iMEMBER ? 0 : (time() - $settings['forum_guest_limit'] * 86400); 
    2425 
    2526$result = dbquery(" 
    2627    SELECT * FROM ".$db_prefix."threads 
    2728    INNER JOIN ".$db_prefix."forums ON ".$db_prefix."threads.forum_id=".$db_prefix."forums.forum_id 
    28     WHERE ".groupaccess('forum_access')." ORDER BY thread_lastpost DESC LIMIT ".NEWEST_THREADS); 
     29    WHERE ".groupaccess('forum_access').($thread_limit==0?"":" AND thread_lastpost > ".$thread_limit)." 
     30    ORDER BY thread_lastpost DESC LIMIT ".NEWEST_THREADS); 
    2931 
    3032$variables['new_threads'] = array(); 
     
    4042    INNER JOIN ".$db_prefix."threads tt USING(forum_id) 
    4143    INNER JOIN ".$db_prefix."posts tp USING(thread_id) 
    42     WHERE ".groupaccess('forum_access')." GROUP BY thread_id ORDER BY count_posts DESC, thread_lastpost DESC LIMIT ".HOTTEST_THREADS); 
     44    WHERE ".groupaccess('forum_access').($thread_limit==0?"":" AND thread_lastpost > ".$thread_limit)." 
     45    GROUP BY thread_id 
     46    ORDER BY count_posts DESC, thread_lastpost DESC LIMIT ".HOTTEST_THREADS); 
    4347 
    4448$variables['hot_threads'] = array(); 
Note: See TracChangeset for help on using the changeset viewer.