Back to vBulletin 4.x Add-ons

Exclude forum from New Posts and Today's Posts
Mod Version: 1.00, by Andy

vB Version: 4.0.0 Rating: (4 votes - 4.75 average) Installs: 43
Released: 20 Jan 2010 Last Update: 13 Feb 2010 Downloads: 147
Not Supported  

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

File Type: %1$s exclude_hack.txt (1.4 KB, 159 downloads)


vblts.ru supports vBulletin®, 2022-2024