vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Omitting a specific forums posts in *New Topics* search? (https://vborg.vbsupport.ru/showthread.php?t=40164)

Sweet Cheeks 06-23-2002 12:16 AM

Omitting a specific forums posts in *New Topics* search?
 
Sorry if that didnt make sense LMAO but I couldnt think of any better way to say it :dead:

I have one forum that I want to add some sort of setting to to where when someone posts in it, it wont be included in the users search results when they click on the *New posts* button.

Thanks in advance :smoke: :smoke: :smoke:

Logician 06-23-2002 08:16 AM

Without hack:

You can disable access of the forum to some usergroups. Their search will automatically exclude this forum then.

With hack:

Edit search.php, find:
PHP Code:

if ($action=="getdaily") {
  
// get allowable forums:
  
$forumsql=getallforumsql();

    if (isset(
$forumid)) {
        
$forums=$DB_site->query("SELECT forumid FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',".addslashes($forumid).",')>0");
        
$forumsql.=" AND forumid IN (0";
        while (
$forum=$DB_site->fetch_array($forums)) {
            
$forumsql.=",$forum[forumid]";
        }
        
$forumsql.=") ";
    } 

Replace line
PHP Code:

$forumsql.=",$forum[forumid]"

As:
PHP Code:

if ($forum[forumid]!=X) {$forumsql.=",$forum[forumid]";} 

Replace X with the forumid that will be excluded.

Not tested but should work..
Logician

Sweet Cheeks 06-23-2002 02:11 PM

Oh you are too awesome. I will try this and let you know how it works. Thanks a bunch! :cool:

DudeSicko 08-23-2002 10:35 PM

I have tryed to include it in the search.php but i dident get that result i had hoped for :)

The one i could use would be the one that calls the action

http://www.xxxxxxx.dk/forum/search.php?action=getnew

How do i modify it for that one ?

NTLDR 08-23-2002 11:27 PM

Should be the same modification that Logican posted, just searcg for getnew in search.php and you will see the code to change just under it ;)

DudeSicko 08-24-2002 11:44 AM

Yep have found it, but when i modify it, nothing happens, i still get the page ;( SNIFF

Logician 08-25-2002 11:06 AM

Quote:

Originally posted by DudeSicko
Yep have found it, but when i modify it, nothing happens, i still get the page ;( SNIFF
To make sure you are doing the correct change:

Find:
PHP Code:

// ###################### Start get new #######################
if ($action=="getnew") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=or $bbuserinfo[lastvisit]!=0) {
    
$forumsql=getallforumsql();
        if (isset(
$forumid)) {
            
$forums=$DB_site->query("SELECT forumid FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',".addslashes($forumid).",')>0");
            
$forumsql.=" AND forumid IN (0";
            while (
$forum=$DB_site->fetch_array($forums)) {
                
$forumsql.=",$forum[forumid]";
            }
            
$forumsql.=") ";
        } 

Replace line

PHP Code:

$forumsql.=",$forum[forumid]"

As:

PHP Code:

if ($forum[forumid]!=X) {$forumsql.=",$forum[forumid]";} 

Replace X with the forumid that will be excluded.

Is it exactly what you did?

Attention: This change will exclude the forum for GUESTS ONLY! If you logged in as a member, you have to make the change I referred for ~*Julie*~ above. In other words if you want to exlude the forum for BOTH guests and members apply BOTH changes..

DudeSicko 09-03-2002 01:47 PM

This is the change i maid.

I got the 16 from this:

http://www.mor-far.dk/vbulletin01.gif

PHP Code:

// ###################### Start get new #######################
if ($action=="getnew") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=or $bbuserinfo[lastvisit]!=0) {
    
$forumsql=getallforumsql();

        if (isset(
$forumid)) {
            
$forums=$DB_site->query("SELECT forumid FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',".addslashes($forumid).",')>0");
            
$forumsql.=" AND forumid IN (0";
            while (
$forum=$DB_site->fetch_array($forums)) {
                
//$forumsql.=",$forum[forumid]";
                
if ($forum[forumid]!=16) {$forumsql.=",$forum[forumid]";}
            }
            
$forumsql.=") ";
        } 


heynurse 09-15-2002 01:53 AM

Logician,

Thanks for your assistance with the hack.

I have followed your instructions exactly, and the forum I do not want to show up in the "Todays Active Threads" still shows up? Any other ideas or suggestions? Thanks

BTW, my original post was at: https://vborg.vbsupport.ru/showthrea...threadid=43531

Sweet Cheeks 09-15-2002 03:06 AM

Oh I'm sorry I never replied back :( Thanks again, this has helped me alot, it woks awesome :banana: You rock!

Logician 09-16-2002 11:17 AM

Quote:

Originally posted by heynurse
I have followed your instructions exactly, and the forum I do not want to show up in the "Todays Active Threads" still shows up? Any other ideas or suggestions? Thanks
[/url]

There are 2 codes in this thread. Have you applied either one or both? One code is for guests and the other is for members so you have to apply BOTH if you want to exclude the forum for both usergroups..

ryancooper 11-24-2002 02:08 PM

Awesome Work Thanks;

To anyone that this dosn't work for see
https://vborg.vbsupport.ru/showthrea...threadid=43531 :bunny:

JustAskJulie 06-10-2003 06:59 PM

Any way that someone could merge this with the other topic linked above?

The fix on the other topic worked for me.

Fuzzy Orange 01-10-2006 03:29 PM

Any way to do this in vb 3.5?

Logician 01-14-2006 05:38 PM

Quote:

Originally Posted by Fuzzy Orange
Any way to do this in vb 3.5?

This is built-in in 3.5 :

add : &exclude=FORUMID_TO_EXCLUDE to your search url. Eg.

http://www.vbulletin.com/forum/search.php?do=getdaily&exclude=106
http://www.vbulletin.com/forum/search.php?do=getnew&exclude=106

tuga-gsm 01-15-2006 07:55 PM

is it possible to use a category ID instead of a forum id?

or maybe several forum ids?

eXtremeTim 01-16-2006 04:37 PM

Just pass it a comma delimited list &exclude=4,6,7,3,5,7,54,3,23

It will exclude all of them. If your inquiring about the 3.5 method.

tuga-gsm 01-16-2006 09:30 PM

yes.

thats it

thank you ;)

thank you!

wored.

thanks :D:D:D

bondjetta 01-19-2006 07:45 PM

Quote:

Originally Posted by Logician
This is built-in in 3.5 :

add : &exclude=FORUMID_TO_EXCLUDE to your search url. Eg.

http://www.vbulletin.com/forum/searc...ly&exclude=106
http://www.vbulletin.com/forum/searc...ew&exclude=106

thank you for that :) Just what i needed :)


All times are GMT. The time now is 10:51 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.01152 seconds
  • Memory Usage 1,783KB
  • 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
  • (7)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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