vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   exclude forums from @stream (https://vborg.vbsupport.ru/showthread.php?t=288086)

zascok 09-20-2012 03:42 PM

exclude forums from @stream
 
I was searching for a possibility to exclude couple of forums from being published into activity stream

Here is the code that was working before but it doesn't anymore on 4.2.pl2. Maybe someone can help and fix it please

plugin at hook postdata_presave

PHP Code:

if (in_array($this->info['forum']['forumid'], array(XYZ))){  
           
$this->set_info('skip_activitystream'true);  
     } 

The code is from here

https://www.vbulletin.com/forum/show...32#post2340532

kh99 09-21-2012 12:08 PM

That code works, but only when replying to an existing thread. If you want to stop new threads from going in the activity stream, you can use the same code in an additional plugin on hook threadfpdata_presave.

zascok 09-21-2012 12:42 PM

Thanks, I'll give it a try

JMEWLS` 10-29-2012 02:55 AM

Using this code I've got 2 parse errors:

Parse error: syntax error, unexpected ',', expecting ')' in /***/forums/includes/class_dm_threadpost.php(1827) : eval()'d code on line 1

Parse error: syntax error, unexpected ',', expecting ')' in /***/forums/includes/class_dm_threadpost.php(1827) : eval()'d code on line 1

Any ideas?

--------------- Added [DATE]1351479572[/DATE] at [TIME]1351479572[/TIME] ---------------

Put them in two hooks to remove posts and threads....

First:
Hook: postdata_presave
Second:
Hook: threadfpdata_presave

Code I've been using in both:

Code:

if (in_array($this->info['forum']['forumid'], array(138,139,140,141,142,143,144,145,146,193,199,184,148,12,14,154,155,156,157,158,159,,160,,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183))){ 
          $this->set_info('skip_activitystream', true); 
    }


kh99 10-29-2012 11:19 AM

Quote:

Originally Posted by JMEWLS` (Post 2376732)
Code:

if (in_array($this->info['forum']['forumid'], array(138,139,140,141,142,143,144,145,146,193,199,184,148,12,14,154,155,156,157,158,159,,160,,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183))){ 
          $this->set_info('skip_activitystream', true); 
    }


You've got two commas in a row in two places in the middle of your list of forum ids (highlighted in red)


All times are GMT. The time now is 06:03 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.01070 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete