Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Selective Forum Filter Details »»
Selective Forum Filter
Version: 1.1.0, by akanevsky akanevsky is offline
Developer Last Online: Feb 2016 Show Printable Version Email this Page

Category: End-User Options - Version: 3.8.x Rating:
Released: 05-30-2009 Last Update: 05-30-2009 Installs: 214
DB Changes Uses Plugins Auto-Templates
Translations  
No support by the author.

I no longer support my hacks. Please feel free to update them and release new versions elsewhere as long as I get the credit for the original modification.

/*================================================= =====================*\
|| Selective Forum Filter
||
|| Author : Anton Kanevsky
|| Co-Author(s) : Andreas
|| Works on : vBulletin 3.5.x - 3.8.x
|| Released : May 31, 2009
||
|| Time required to install: 30 seconds
|| Difficulty: easy
\*================================================ ======================*/

DESCRIPTION

Ever came across large boards with a huge number of sub forums? Couldn't find your info? Wanted to run away from that huge load of stupid threads? This hack is intended to save your users from having such a horrible experience. It provides them with an opportunity to exclude any number of forums from the forums list (as well as from "get new"/"get daily" searches), which still letting them to access those forums directly and search within them, too.

STATISTICS

Products to Install: 1


INTRODUCTION

To enable "can be excluded" in all forums, run this query:
UPDATE PFXforum SET excludable = 1
To disable "can be excluded" in all forums, run this query:
UPDATE PFXforum SET excludable = 0
In both cases, PFX must be replaced with the actual table prefix that you have defined in config.php.
If you have not defined a prefix, remove PFX from the queries.
After you run either one of these queries, you must then open and save any one forum for the forum cache to be updated.

VERSION HISTORY

1.1.0
[+] The hack is now compatible with vBulletin 3.5.x - 3.8.x.
[+] Eliminated all template edits.

1.0.2
[+] The hack is now compatible with vBulletin 3.6.
[+] Corrected a couple of mistakes in the installation manual.

1.0.1
[+] Added option to set forums as excludable. By default, excludability of all forums is disabled.

1.0.0
First Public Release

The installation manual is contained within the attached file.

IF YOU LIKE MY HACK, PLEASE CLICK INSTALL

Download Now

File Type: zip Selective.Forum.Filter_1.1.0_by.akan.zip (5.7 KB, 869 views)

Screenshots

File Type: png screenshot.png (58.3 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
vijayninel

Comments
  #62  
Old 12-21-2009, 10:58 PM
SledgeHead SledgeHead is offline
 
Join Date: Oct 2006
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this be available for 4.0?
Reply With Quote
  #63  
Old 01-08-2010, 11:03 AM
al_rhar al_rhar is offline
 
Join Date: Dec 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent thanks. My users have been moaning about having this option for ages. works fine on 3.8.4
Reply With Quote
  #64  
Old 01-12-2010, 03:25 PM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SledgeHead View Post
Will this be available for 4.0?
I would be ever so grateful! I stupidly updated my forum to vb4 without realizing I'd break this product.
Reply With Quote
  #65  
Old 01-25-2010, 06:47 AM
Fiel Fiel is offline
 
Join Date: Jul 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was able to get this to work with vB4. The plugin "SFF: User Options" has to be changed to work with the new template engine used with vB4. Learning a little PHP never hurt, right?
Reply With Quote
  #66  
Old 01-28-2010, 04:32 PM
Fiel Fiel is offline
 
Join Date: Jul 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since I've been getting a steady stream of questions regarding the update to vB4, here's how you update to vB4:

The only problem with this hack in vB4 is that it doesn't appear correctly in the UserCP. This is due to vB4 using a new template creation engine (which is much, much easier to use - makes it obvious which variables are available to templates and which are not). As of right now, the templates are using variables that they don't have access to, so it doesn't work. These modifications fixes it to work with vB4:

AdminCP --> Products & Plugins --> Plugin Manager --> "SFF: User Options"

Replace this:

PHP Code:
    else 
    { 
        
$optionselected ''
    } 
    eval(
'$optoutforumbits .= "' fetch_template('option') . '";'); 
}

$find_string '$customfields[other]'
$add_string fetch_template('modifyoptions_excludeforums'); 
$vbulletin->templatecache['modifyoptions'] = str_replace($find_string$find_string $add_string$vbulletin->templatecache['modifyoptions']); 

With this:

PHP Code:
    else 
    { 
        
$optionselected ''
    } 
    
$templater vB_Template::create('option');  
    
$templater->register('optionvalue'$optionvalue);  
    
$templater->register('optiontitle'$optiontitle);  
    
$templater->register('optionclass'$optionclass); 
    
$templater->register('optionselected'$optionselected); 
    
$optoutforumbits .= $templater->render(); 


$templater vB_Template::create('modifyoptions_excludeforums');
$templater->register('optoutforumbits'$optoutforumbits);
$template_hook['usercp_options_other'] .= $templater->render(); 
Make sure you save it.

Then go back into the plugin manager and edit "SFF: Cache Templates". This plugin is trying to access a variable which doesn't exist in vB4.

Change this:

PHP Code:
if (THIS_SCRIPT == 'profile'

    
$globaltemplates array_merge($globaltemplates, array( 
        
'modifyoptions_excludeforums'
    )); 

To this:

PHP Code:
if (THIS_SCRIPT == 'profile')
{
    
$cache array_merge($cache, array(
        
'modifyoptions_excludeforums',
    ));

Now you need to change user options to allow the user to select it. For this hack, the creator included his own template (modifyoptions_excludeforums), but that works with vB3 and needs updating for vB4.

So, go to Styles & Templates --> Style Manager --> YOUR_STYLE_HERE --> "Modify User Template Options" --> "modifyoptions_excludeforums"

Replace the entire template contents with this:

Code:
<div class="blockrow">
        <legend>{vb:rawphrase exclude_forums_title}</legend>
	<p class="description">{vb:rawphrase exclude_forums_desc_1} <br /> <br />{vb:rawphrase exclude_forums_desc_2}</p>
        <div class="group">
	<select style="width: 50%" size="13" name="excludeforumids[]" id="sel_excludeforumids" multiple="multiple">
		<option value="">{vb:rawphrase exclude_none}</option>
		{vb:raw optoutforumbits}
	</select>
        </div>
</div>
And you're done. It should work fine and dandy now.
Reply With Quote
  #67  
Old 01-28-2010, 05:14 PM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!

But I'm still getting

PHP Code:
Warningarray_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bootstrap.php(1146) : eval()'d code on line 5 
at the top of the user profile pages.

In SFF: Cache Templates, do you still have -

PHP Code:
if (THIS_SCRIPT == 'profile')
{
    
$globaltemplates array_merge($globaltemplates, array(
        
'modifyoptions_excludeforums',
    ));

Reply With Quote
  #68  
Old 01-28-2010, 06:20 PM
Fiel Fiel is offline
 
Join Date: Jul 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, my bad. Forgot to say that I did correct that error too.

At that point in the script, $globaltemplates is not defined (nor is it ever). Change it to this:

PHP Code:
if (THIS_SCRIPT == 'profile')
{
    
$cache array_merge($cache, array(
        
'modifyoptions_excludeforums',
    ));

Reply With Quote
  #69  
Old 01-28-2010, 06:34 PM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fiel View Post
At that point in the script, $globaltemplates is not defined ...
Awesome! That made the error go away but (always a but!) the template modifyoptions_excludeforums isn't showing up anywhere in the user profile.

Should it still display on the profile.php?do=editoptions page?
Reply With Quote
  #70  
Old 01-28-2010, 06:39 PM
Fiel Fiel is offline
 
Join Date: Jul 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that's where it displays for me. I know that we've been PMing each other. Make sure you're using the version of the script I posted, not the one I PMed (they are different versions).
Reply With Quote
  #71  
Old 01-28-2010, 07:03 PM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fiel View Post
.. not the one I PMed (they are different versions).
duh! I didn't notice that. Now I have the forum listing under profile.php?do=editoptions. I've successfully tested modifying the forums selected and seeing that the changes are saved ...

but ...

when I do "New Posts", new posts from the exclude forums are still showing.
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 08:51 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.17670 seconds
  • Memory Usage 2,360KB
  • Queries Executed 27 (?)
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
  • (7)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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