View Full Version : exclude forums from @stream
zascok
09-20-2012, 03:42 PM
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
if (in_array($this->info['forum']['forumid'], array(X, Y, Z))){
$this->set_info('skip_activitystream', true);
}
The code is from here
https://www.vbulletin.com/forum/showthread.php/401705-Activity-Stream-Excluding?p=2340532#post2340532
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 1351479572 at 1351479572 ---------------
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:
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,16 2,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);
}
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,16 2,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)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.