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
  #12  
Old 02-11-2010, 01:20 AM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wolfyman View Post
so... is there a hack that makes it easy for the normal user to do it?
Are you imagining a page that lists all your forums with a checkbox beside them and users may check the ones they don't want in their search query? Then they can press a button to get the code to add to their browser bar?

No, I am unaware of such a mod. Seems like an awful lot of trouble to go to just for a few brain-dead people that probably wouldn't use it anyway.
Reply With Quote
  #13  
Old 02-11-2010, 10:19 AM
wolfyman's Avatar
wolfyman wolfyman is offline
 
Join Date: Apr 2005
Posts: 719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

investorsiraq.com has it, and the users love it.
Reply With Quote
  #14  
Old 02-13-2010, 06:14 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wolfyman View Post
is there a hack that allows members to choose which forums to exclude for themselves?
I made a a hack that did that on my forum, but only a handful of members used it.
Reply With Quote
  #15  
Old 02-13-2010, 12:15 PM
kofoid kofoid is offline
 
Join Date: Dec 2005
Location: Colorado
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where do you make this edit? This would be a smokin' add on with instructions
Reply With Quote
  #16  
Old 02-13-2010, 12:34 PM
wolfyman's Avatar
wolfyman wolfyman is offline
 
Join Date: Apr 2005
Posts: 719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andy View Post
I made a a hack that did that on my forum, but only a handful of members used it.
All communities are different, but thank you for your comment. Would you be willing to share your work?
Reply With Quote
  #17  
Old 02-13-2010, 12:48 PM
kofoid kofoid is offline
 
Join Date: Dec 2005
Location: Colorado
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found this on vb.com. Super easy.....
http://www.vbulletin.com/forum/showt...+forums+search
Reply With Quote
  #18  
Old 02-13-2010, 02:42 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 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?
The code uses an external database so that I don't modify the vBulletin database. It's more works this way but less problematic during upgrades. For this reason it's not something I'm willing to share or support.
Reply With Quote
  #19  
Old 02-13-2010, 03:49 PM
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Posts: 1,128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As said, this needs to be a mod for users to be able to do.
Reply With Quote
  #20  
Old 02-13-2010, 04:23 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #21  
Old 03-13-2010, 04:46 AM
burntire burntire is offline
 
Join Date: Jun 2006
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the code. Installed.
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 06:58 PM.


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.09780 seconds
  • Memory Usage 2,336KB
  • Queries Executed 26 (?)
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
  • (4)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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