vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Incorporating search results into vbulletin search (https://vborg.vbsupport.ru/showthread.php?t=213047)

tscargo 05-06-2009 10:29 PM

Incorporating search results into vbulletin search
 
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:

Code:

($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 ....


All times are GMT. The time now is 01:09 AM.

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.00922 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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