How can I exclude certain forums from "Today Posts"?
Exclude forums from search results
Collapse
X
-
Tags: None
-
You can exclude channels by editing the search JSON used.
exclude- array - list of node ids that need to be excluded from the results.
- number - the id of the node that needs to be excluded from the results.
{ "exclude":[1,2,3,4] } { "exclude":"24" }
https://www.vbulletin.com/forum/arti...he-search-jsonTranslations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API -
The one I have there now for "Today's Posts" is this
Code:search?searchJSON=%7B%22last%22%3A%7B%22from%22%3A%22lastDay%22%7D%2C%22view%22%3A%22topic%22%2C%22starter_only%22%3A+1%2C%22sort%22%3A%7B%22lastcontent%22%3A%22desc%22%7D%2C%22exclude_type%22%3A%5B%22vBForum_PrivateMessage%22%5D%7D
Comment
-
PS I'd like to exclude category which would exclude all channels within a category if that is possible?
E.g
- - - - Advertising Forums (Node ID: 35)
- - - - - - Hosting Offers (Node ID: 20)
- - - - - - - - Web Hosting Offers (Node ID: 31)
- - - - - - - - Reseller Hosting Offers (Node ID: 22)
- - - - - - - - VPS Hosting Offers (Node ID: 23)
- - - - - - - - Dedicated Server Hosting Offers (Node ID: 24)
- - - - - - - - Cloud Hosting Offers (Node ID: 25)
- - - - - - - - Colo Hosting Offers (Node ID: 26)
- - - - - - - - Backup Hosting Offers (Node ID: 41)
- - - - - - - - Email Hosting Offers (Node ID: 42)
- - - - - - - - Other Hosting Offers (Node ID: 43)
- - - - - - Other Offers (Node ID: 57)
- - - - - - - - Server Management (Node ID: 58)
- - - - - - - - Domain Names (Node ID: 59)
- - - - - - - - Employment (Node ID: 60)
- - - - - - - - Web Design (Node ID: 61)
- - - - - - - - Software & Scripts (Node ID: 62)
- - - - - - - - Marketing (Node ID: 63)
- - - - - - - - SEO (Node ID: 64)
- - - - - - - - SEM (Node ID: 65)
- - - - - - - - Affiliate Programs (Node ID: 69)
I don't need any of those to be included in the results when a visitor or member uses the "Today's Posts" link in the navigation menu.Comment
-
Should be able to create your array based on the category parent nodes and add it right before the closing brace:
Code:search?searchJSON={"date":{"from":"lastDay"},"view":"topic","sort":{"lastcontent":"desc"},"exclude":[35],"exclude_type":["vBForum_PrivateMessage","vBForum_VisitorMessage","vBForum_Report","vBForum_Redirect"]}
Code:search?searchJSON={"date":{"from":"lastDay"},"view":"topic","sort":{"lastcontent":"desc"},"exclude":[35],"exclude_type":["vBForum_PrivateMessage","vBForum_VisitorMessage","vBForum_Report","vBForum_Redirect"]}
Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API👍 1Comment
-
Should be able to create your array based on the category parent nodes and add it right before the closing brace:
Code:search?searchJSON={"date":{"from":"lastDay"},"view":"topic","sort":{"lastcontent":"desc"},"exclude":[35],"exclude_type":["vBForum_PrivateMessage","vBForum_VisitorMessage","vBForum_Report","vBForum_Redirect"]}
Code:search?searchJSON={"date":{"from":"lastDay"},"view":"topic","sort":{"lastcontent":"desc"},"exclude":[35],"exclude_type":["vBForum_PrivateMessage","vBForum_VisitorMessage","vBForum_Report","vBForum_Redirect"]}
Comment
-
I figured it now. When using site builder I had to use encoded code from last the line. Encoded code is needed for it to work.Comment
-
Comment
-
You're welcome.Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API👍 1Comment
-
Edit: because I finally found where to edit the search
However this is our search string:
search?searchJSON=%7B%22last%22%3A%7B%22from%22%3A%22lastDay%22%7D%2C%22view%22%3A%22topic %22%2C%22starter_only%22%3A+1%2C%22sort%22%3A%7B%22lastcontent%22%3A%22desc%22%7D%2C%22exc lude_type%22%3A%5B%22vBForum_PrivateMessage%22%5D%7D
it looks nothing like the previous posts. Do I just add %nodeid% to it?Last edited by Mrs.T; Tue 10 Jul '18, 5:00am.Comment
-
,"exclude":[35],"exclude_type":["vBForum_PrivateMessage","vBForum_VisitorMessage","vBForum_Report","vBForum_Redirect"
The number (or numbers, separated by commas) in the first bracket would be any individual nodes you want to exclude.
The types are, of course, to exclude certain types of content from the search.Comment
-
Depending on what you want to exclude you should be able to add something like the following right before the closing bracket ] and parenthesis )
,"exclude":[35],"exclude_type":["vBForum_PrivateMessage","vBForum_VisitorMessage","vBForum_Report","vBForum_Redirect"
The number (or numbers, separated by commas) in the first bracket would be any individual nodes you want to exclude.
The types are, of course, to exclude certain types of content from the search.
search?searchJSON=%7B%22last%22%3A%7B%22from%22%3A%22lastDay%22%7D%2C%22view%22%3A%22topic %22%2C%22starter_only%22%3A+1%2C%22sort%22%3A%7B%22lastcontent%22%3A%22desc%22%7D%2C%22exc lude_type%22%3A%5B%22vBForum_PrivateMessage%22%5D%7D
All we want to do is exclude one forum node id 282739Comment
-
In current versions the strings I posted above should work. The difference is that the string you have is fully encoded and that isn't necessary.Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 APIComment
-
I will try your version with an addition to exclude the one we want.Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment