vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Exclude forum from New Posts and Today's Posts (https://vborg.vbsupport.ru/showthread.php?t=233594)

Andy 01-19-2010 10:00 PM

Exclude forum from New Posts and Today's Posts
 
1 Attachment(s)
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.

beduino 01-20-2010 10:45 AM

Hi Andy
I suppose works to 4.0.1 too?
Tks in advance

GHC Webmaster 01-20-2010 02:00 PM

Quote:

Originally Posted by beduino (Post 1961060)
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.

gsmph 01-23-2010 04:36 PM

i'll try this one out

thanks
tag

br
gsmph

akvaryumforum 02-02-2010 01:14 PM

Is there a way do this just for todays and new messages. When this hack installed that forums are all exculded from searchs. :(

Andy 02-09-2010 03:28 PM

Quote:

Originally Posted by akvaryumforum (Post 1973052)
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';
}


wolfyman 02-10-2010 07:11 PM

is there a hack that allows members to choose which forums to exclude for themselves?

Paul M 02-10-2010 07:16 PM

Add-ons must be provided as a downloadable file - in this case a text file with the instructions, thanks.

Videx 02-10-2010 11:43 PM

Quote:

Originally Posted by wolfyman (Post 1979382)
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.

wolfyman 02-11-2010 12:35 AM

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 :)


All times are GMT. The time now is 09:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01148 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete