View Single Post
  #171  
Old 11-21-2006, 01:48 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IrPr View Post
Thanks Paul !

I'm using this plugin with "Opt-Out Forums from Get New Posts" by Andreas and i had trouble when i exclude some forums from Get New Posts, then i had modified Paul's Hack to make integration with

Find:
PHP Code:
$xforum_ids array_keys($vbulletin->forumcache); 
Below that, Add:
PHP Code:
$exclude explode(",",$vbulletin->userinfo['excludeforumsgnp']); 
Now Find:
PHP Code:
if ( !($xfperms $vbulletin->bf_ugp_forumpermissions['canview']) OR !($xfperms $vbulletin->bf_ugp_forumpermissions['cansearch'])) 
Replace with:
PHP Code:
if ( !($xfperms $vbulletin->bf_ugp_forumpermissions['canview']) OR !($xfperms $vbulletin->bf_ugp_forumpermissions['cansearch']) OR (in_array($xforum_id$exclude))) 
Thats great IrPr
I added your code to our own forum and it works maginificently.
I tried to take it a bit futher by modifying Andreas's Opt-Out Forums from Get New/Get Daily MOD with default forum exclusions. Which works however the Display count of unread posts in welcome box still picks up new posts, although it will not list them.

I was hoping perhaps someone here could help figure out what changes need to be done for it to work fully with the modifications.


Code:
PHP Code:
$xforum_ids = array_keys($vbulletin->forumcache); 

Below that, Add:

PHP Code:
$exclude = explode(",",$vbulletin->userinfo['excludeforumsgnp']); 

Now Find:

PHP Code:
if ( !($xfperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($xfperms & 

$vbulletin->bf_ugp_forumpermissions['cansearch'])) 

Replace with:

PHP Code:
if ( !($xfperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($xfperms & 

$vbulletin->bf_ugp_forumpermissions['cansearch']) OR (in_array($xforum_id, $exclude)))
Opt-Out Forums from Get New Daily changes:
To have one specific forum thats will not show up at all in new posts
ACP / Plugin System / Plugin Manager. Locate the Plugin on Hook search_getnew_start for this Hack, click edit.

Find and edit
Code:
The comma-separated list of excluded forums - add your ID to it.
$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' . $vbulletin->userinfo['excludeforumsgnp']) . ',8';
With the forum id being 8

This only kicks in if the user has defined custom excludes as well.
If you want it to be always active, undo the edit and place

Code:
$vbulletin->GPC['exclude'] .= ',8';
below the }

*** all of these changes work nicely however the Display unread will only filter out excluded forums completely if it is done via the user control panel. Otherwise(this method) it partially filters out the new posts. ex: it shows a new post(no.) but will not display them when clicked on.

Anyone know what needs to be done to get the Display to filter out the excluded forums completely?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02329 seconds
  • Memory Usage 1,793KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete