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 Forums from What's New & FORUMHOME (https://vborg.vbsupport.ru/showthread.php?t=256264)

craigvm 05-25-2013 09:50 AM

how do i set it to exclude a forum from whats new for all users

tehbasmentdwell 01-18-2014 07:08 AM

Installed and working thanks :)

HolyKiller 04-26-2014 03:46 PM

I can confirm that the mod works fine on 4.2.2 PL1


Also following hack could be useful for someone who want to exclude some forums for new users by default :]

- If new registrations needs to be confirmed via email follow "A"
- If NO email confirmation is required to registration then follow "B"

A: Go to AdminCP -> Plugins & Products -> Plugin Manager and "[Add New Plugin]"
Product: vBulletin
Hook Location: register_addmember_complete
Title: <whatever you want>
Execution Order: 5
Plugin PHP Code:

1] For having the "Hide Forums from Forumhome" checked for all new registered users by default
PHP Code:

if (!empty($_POST)){
  if(
$vbulletin->options['verifyemail']){
    
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "usertextfield SET excludeforumhome = '1' WHERE userid = '".$userid."' LIMIT 1 ");
  }


2] For excluding some forums from what's new by default
PHP Code:

$forumhide = <list_of_the_forum_IDs>; //example: $forumhide = '487,496,503,504,647';
if (!empty($_POST)){
  if(
$vbulletin->options['verifyemail']){
    
$vbulletin->input->clean_gpc('p''forumhide',TYPE_STR);
    if (
$forumhide == !NULL){
      
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "usertextfield SET excludeforums = '".$forumhide."' WHERE userid = '".$userid."' LIMIT 1 ");
    }
  }


3] For combination of BOTH of the things above (Exclude specific forums AND hide from forumhome by default)
PHP Code:

$forumhide = <list_of_the_forum_IDs>; //example: $forumhide = '487,496,503,504,647';
if (!empty($_POST)){
  if(
$vbulletin->options['verifyemail']){
    
$vbulletin->input->clean_gpc('p''forumhide',TYPE_STR);
    if (
$forumhide == !NULL){
      
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "usertextfield SET excludeforums = '".$forumhide."', excludeforumhome = '1' WHERE userid = '".$userid."' LIMIT 1 ");
    }
  }



B: Go to AdminCP -> Plugins & Products -> Plugin Manager and "[Add New Plugin]"
Product: vBulletin
Hook Location: register_addmember_process
Title: <whatever you want>
Execution Order: 5
Plugin PHP Code:

1] For having the "Hide Forums from Forumhome" checked for all new registered users by default
PHP Code:

if (!empty($_POST)){
  if(!
$vbulletin->options['verifyemail']){
      
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "usertextfield SET excludeforumhome = '1' WHERE userid = '".$userid."' LIMIT 1 ");
  }


2] For excluding some forums from what's new by default
PHP Code:

$forumhide = <list_of_the_forum_IDs>; //example: $forumhide = '487,496,503,504,647';
if (!empty($_POST)){
  if(!
$vbulletin->options['verifyemail']){
    
$vbulletin->input->clean_gpc('p''forumhide',TYPE_STR);
    if (
$forumhide == !NULL){
      
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "usertextfield SET excludeforums = '".$forumhide."' WHERE userid = '".$userid."' LIMIT 1 ");
    }
  }


3] For combination of BOTH of the things above (Exclude specific forums AND hide from forumhome by default)
PHP Code:

$forumhide = <list_of_the_forum_IDs>; //example: $forumhide = '487,496,503,504,647';
if (!empty($_POST)){
  if(!
$vbulletin->options['verifyemail']){
    
$vbulletin->input->clean_gpc('p''forumhide',TYPE_STR);
    if (
$forumhide == !NULL){
      
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "usertextfield SET excludeforums = '".$forumhide."', excludeforumhome = '1' WHERE userid = '".$userid."' LIMIT 1 ");
    }
  }




All times are GMT. The time now is 09:13 PM.

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.01030 seconds
  • Memory Usage 1,750KB
  • 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
  • (6)bbcode_php_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
  • (3)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