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
  #2  
Old 01-20-2010, 10:45 AM
beduino's Avatar
beduino beduino is offline
 
Join Date: Dec 2005
Location: Rio de Janeiro
Posts: 280
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Andy
I suppose works to 4.0.1 too?
Tks in advance
Reply With Quote
  #3  
Old 01-20-2010, 02:00 PM
GHC Webmaster GHC Webmaster is offline
 
Join Date: Aug 2008
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by beduino View Post
Hi Andy
I suppose works to 4.0.1 too?
Tks in advance
I tried and yes it does. Now I can at last remove the vBCMSComments thread from these searches.

So thanks indeed.
Reply With Quote
  #4  
Old 01-23-2010, 04:36 PM
gsmph's Avatar
gsmph gsmph is offline
 
Join Date: Feb 2009
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'll try this one out

thanks
tag

br
gsmph
Reply With Quote
  #5  
Old 02-02-2010, 01:14 PM
akvaryumforum akvaryumforum is offline
 
Join Date: Mar 2007
Location: T?rkiye
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way do this just for todays and new messages. When this hack installed that forums are all exculded from searchs.
Reply With Quote
  #6  
Old 02-09-2010, 03:28 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by akvaryumforum View Post
Is there a way do this just for todays and new messages. When this hack installed that forums are all exculded from searchs.
Try this code instead. I haven't tested it but it should work. It would only exclude forums in the New Posts search.

Code:
$foo = $_GET['do'];
if ($foo == 'getnew' OR $foo == 'getdaily') {
  $vbulletin->GPC['exclude'] .= ',1,2,3,4';
}
Reply With Quote
  #7  
Old 02-10-2010, 07:11 PM
wolfyman's Avatar
wolfyman wolfyman is offline
 
Join Date: Apr 2005
Posts: 719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a hack that allows members to choose which forums to exclude for themselves?
Reply With Quote
  #8  
Old 02-10-2010, 07:16 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add-ons must be provided as a downloadable file - in this case a text file with the instructions, thanks.
Reply With Quote
  #9  
Old 02-10-2010, 11:43 PM
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
is there a hack that allows members to choose which forums to exclude for themselves?
That's easy enough with the default search by adding &exclude=forumnumber1, forumnumber2 . Include works the same way. Of course, they'll probably want to save this search to their browser bar.
Reply With Quote
  #10  
Old 02-11-2010, 12:35 AM
wolfyman's Avatar
wolfyman wolfyman is offline
 
Join Date: Apr 2005
Posts: 719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so... is there a hack that makes it easy for the normal user to do it?

I'm not going to try to explain that to 8000 people lol
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 01:31 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.05312 seconds
  • Memory Usage 2,330KB
  • Queries Executed 24 (?)
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_code
  • (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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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