View Full Version : Incorporating search results into vbulletin search
tscargo
05-06-2009, 10:29 PM
Hi,
I am working on a site in which we 'abuse' a hidden forum as news forum.
The content out of this news forum is read by an external script.
What we like to do is to enable users to search the forum, even though the forum is not accessible by them. The way we plan to do this is to execute a custom search query and add the results to the 'resultset'.
I was wondering if anyone has done something along these lines. I prefer not needing to hack files, but use the plugin facility only.
Thanks,
Taco
Reeve of shinra
05-06-2009, 11:10 PM
I think I understand what you are getting at...
In the forum manager set:
Forum is Active = NO
Forum is Open = YES
Index New Posts in Search Engine = YES
The forum should not appear on the forum list but new posts will show up when they click New Posts.
edit to add:
There are code snippets around here somewhere that will tell you the syntax for having a query search one forum id only. You could add that as a "query form" on your external script but it would pass the request to the forums as if someone decided to enter the url syntax themselves.
tscargo
05-07-2009, 07:10 AM
Reeve of shinra, thanks for your feedback.
We have added two fields to the thread table (pubstart and pubend).
What we want is that non-admins don't see posts that have not been 'published' yet.
What I have now done is using the search_process_fulltext hook:
($thread_query_logic[] = "thread.forumid != 5 or (thread.pubstart < '".date ("Y-m-d H:i:s")."' AND thread.pubend > '".date ("Y-m-d H:i:s")."'))";
Forumid 5 is the news forum. I have temporarily turned off result caching to be sure this works (it does).
This indeed filters the results out of the resultset. I only want to do this for non-admins.
Furthermore I need to override the forumpermission checking, else normal users don't see the correct ones at all (as they don't have access to the forum).
Hope I will be able to fix this ....
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.