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
  #22  
Old 06-02-2010, 05:54 AM
Scalemotorcars's Avatar
Scalemotorcars Scalemotorcars is offline
 
Join Date: Mar 2006
Location: NC
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any ideal if this could shut down a cron task? For some reason as soon as I made this change my cron stopped working.
Reply With Quote
  #23  
Old 06-21-2010, 10:44 AM
RaSa RaSa is offline
 
Join Date: Jan 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like it, but it does not exclude Forums from RSS, right?
But what I need too, is a possibility to exclude Forums from RSS feed.
Reply With Quote
  #24  
Old 06-21-2010, 11:32 AM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This can be do so much easier

Enter a new replacement variable in your Styles and Template menu

Search for Text: do=getnew&

Replace with: do=getnew&exclude=xx,xx,xx

Where xx is the forum you want to exclude
Reply With Quote
  #25  
Old 08-14-2010, 09:34 PM
VonDoom's Avatar
VonDoom VonDoom is offline
 
Join Date: Dec 2008
Location: USA
Posts: 494
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xug View Post
This can be do so much easier

Enter a new replacement variable in your Styles and Template menu

Search for Text: do=getnew&

Replace with: do=getnew&exclude=xx,xx,xx

Where xx is the forum you want to exclude
+1 Thanks
Reply With Quote
  #26  
Old 08-15-2010, 01:38 AM
Bigj85 Bigj85 is offline
 
Join Date: Jan 2009
Location: Guelph,Ontario,Canada
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just what I needed thanks ^^^
Reply With Quote
  #27  
Old 08-15-2010, 01:58 AM
Trek Trek is offline
 
Join Date: Sep 2003
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use this on my vB4 forum: https://vborg.vbsupport.ru/showthrea...elective+forum

Still works fine, make sure you read the thread though.

Anyway, nicely done and let's people choose for themselves. Also lets the admin choose which forums CANNOT be excluded, etc.
Reply With Quote
  #28  
Old 03-07-2011, 06:58 AM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how about excluding the forums from the sidebar blocks ?

This doesn't affect those
Reply With Quote
  #29  
Old 05-25-2013, 10:12 AM
craigvm's Avatar
craigvm craigvm is offline
 
Join Date: Aug 2012
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where do i add that code in the search.php files start or end ?
Reply With Quote
  #30  
Old 06-17-2013, 01:53 PM
Mechislav Mechislav is offline
 
Join Date: Jun 2013
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found it easier to edit Navigation links and to add:
Code:
&exclude='1,2,3,4,5'
or
Code:
&include='6,7,8,9'
nj the links for new or daily posts
Reply With Quote
  #31  
Old 03-18-2014, 03:42 AM
dobberhockey dobberhockey is offline
 
Join Date: Feb 2014
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Videx View Post
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.
I had it in Vb3 but now in Vb4 I want it. All users are demanding it. It's a large active sports forum and hockey fans don't want to see baseball posts, and vice-versa.

In user settings they would simply highlight the forums they don't want to see, save it, and it's done.
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:45 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.05183 seconds
  • Memory Usage 2,338KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)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