Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Exclude forum from New Posts and Today's Posts Details »»
Exclude forum from New Posts and Today's Posts
Version: 1.00, by Andy Andy is offline
Developer Last Online: May 2019 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.0 Rating:
Released: 01-19-2010 Last Update: 02-12-2010 Installs: 43
 
No support by the author.

Here is an easy way to exclude forums from New Posts and Today's Posts.

Edit the search.php file.

PHP Code:
function set_newitem_forums($criteria)
{
    global 
$vbulletin;

    
//figure out forums
    //This follows the logic of the original search.  If a forum is specified then use it and its
    //children.  If an include list is specified, then use it without its children.
    //Do not honor the exclude list if we are using the provided forumid
    
if ($vbulletin->GPC['f'])
    {
        
$criteria->add_forumid_filter($vbulletin->GPC['f'], true);
    }
    else
    {
        if (
$vbulletin->GPC['include'])
        {
            
$list explode(','$vbulletin->GPC['include']);

            if (
is_array($list))
            {
                
$list array_map('intval'$list);
                
$criteria->add_forumid_filter($listfalse);
            }
        }
        
        
// start hack
        
$vbulletin->GPC['exclude'] .= ',1,2,3,4';
        
// end hack
        
        
if ($vbulletin->GPC['exclude'])
        {
            
$list explode(','$vbulletin->GPC['exclude']);

            if (
is_array($list))
            {
                
$list array_map('intval'$list);
                
$criteria->add_excludeforumid_filter($list);
            }
        }
    }

Replace the numbers 1,2,4, and 4 with the forum numbers you want to exclude.

Download Now

File Type: txt exclude_hack.txt (1.4 KB, 157 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 03-18-2014, 03:45 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wolfyman View Post
All communities are different, but thank you for your comment. Would you be willing to share your work?
You do realize you replied to a post that is over 4 years old, and that member has not been on in almost a year.
Reply With Quote
  #33  
Old 03-18-2014, 03:45 AM
dobberhockey dobberhockey is offline
 
Join Date: Feb 2014
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andy View Post
One of the problems with allowing the members to exclude the forums they choose is that if they choose lets say a dozen forums, under the breadcrumb where is says "Excluded Forums" becomes very long. To do it right you would want to make the excluded links message a link.

Also some would only want the excluded forums from being displayed when doing a New Posts or Today's Posts and not when using Advanced Search. So to do it right becomes very complex.
Not an issue with me - hockey fans would just exclude baseball and football, baseball fans would exclude hockey and football, etc.
Reply With Quote
  #34  
Old 03-18-2014, 04:14 AM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
You do realize you replied to a post that is over 4 years old, and that member has not been on in almost a year.
Confusing as all heck. Is it me that hasn't been on for over a year? Then who the heck has been posting as me?
Reply With Quote
  #35  
Old 03-18-2014, 09:53 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Never mind me, I just quoted the wrong post,
Reply With Quote
  #36  
Old 11-30-2014, 01:00 PM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for this. Works perfectly and was much needed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04237 seconds
  • Memory Usage 2,292KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete