vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Excluding a forum in ALL search functions (https://vborg.vbsupport.ru/showthread.php?t=49067)

gopherhockey 02-18-2003 03:06 PM

Excluding a forum in ALL search functions
 
I have seen a few threads regarding removing a forum from "view new posts" and have gotten that to work. However, I want to go one step farther and completely ignore a forum from all search functions except searching within the forum itself (at the bottom of the screen in the forum view)

Can someone explain how this could possibly be done?

Again, I have already modified the "get daily" stuff and that works great.

I know I can exclude searching via rights.. but this seems to remove everything, even the forum search itself.

Thanks!

(and I apologize if this was stated elsewhere, but I could only find the new posts part)

sparky2 02-19-2003 08:10 PM

I'm responding to "how it could possibly be done" b/c I'll probably end up doing this for our forums (one subforum alone has 986,000+ posts). I too had searched & haven't seen previous discussion on this.

step 1:
add a new field to the forum table, ala
UPDATE forum ADD COLUMN 'exemptfromsearch' tinyint(4) NOT NULL default '0'

step 2:
manually query to toggle the value of forum.exemptfromsearch for select subforums
update forum set exemptfromsearch='1' where forumid=x

step 3:
since the forumid isn't passed to
function indexpost()
function unindexpost()
within ~admin/functions.php
we'll either have to add code which WILL pass forumid as an argument to these functions and eval its value and conditionally abort

-=OR=-

add conditional code within each calling script
editpost.php
newreply.php
postings.php

surrounding each instance of calls to the indexpost and unindexpost functions, so that the indexing won't ALWAYS occur
if ( $threadinfo['forumid']!='0') {

(I suspect the latter approach would be more efficient)

^---- 1, 2 & 3 cover the functional requirements.
Steps 4, 5, etc. would be a matter of editing ~admin/forum.php to add contols to the AdminCP interface and extend the SQL queries to update forum.exemptfromsearch along with the other column values.


Quote:

In excluding this as a feature, the attitude of the vBulletin developers seems to be "why/when in-the-world would anyone want to do this?"
-=-
In reaction to this, I would ask
"Why would anyone ever want to set a forum INACTIVE?"
(There's a setting for this)
along with
"Doesn't it make sense that if a forum is set INACTIVE, the admin wouldn't want its posts indexed?"
(and yes, I do understand that reindexing would be necessary after toggling this for one or more subforums.)

Logician 02-21-2003 11:37 AM

if you find

PHP Code:

$iforums=$DB_site->query('SELECT forumid,parentid,displayorder,title FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder,forumid'); 

and Replace it as:

PHP Code:

$iforums=$DB_site->query('SELECT forumid,parentid,displayorder,title FROM forum WHERE displayorder<>0 AND active=1 AND forumid!=YY AND forumid!=XX ORDER BY parentid,displayorder,forumid'); 

and replace XX and YY with the forumids of the forums you want to ignore in search page, this will remove the forums name from search page, so it cant be specifically searched in that page.

gotto go now so couldnt have time to hack more, but please bear in mind that you also have to hack the "simplesearch" part of search.php so that when ALL FORUMS are marked, search will ignore your specific forum..


All times are GMT. The time now is 05:11 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.01100 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_php_printable
  • (1)bbcode_quote_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