PDA

View Full Version : Omitting a specific forums posts in *New Topics* search?


Sweet Cheeks
06-23-2002, 12:16 AM
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:

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

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


As:

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
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:

// ###################### Start get new #######################
if ($action=="getnew") {
// generate query
// do it!
if ($bbuserinfo[userid]!=0 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


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

As:

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


// ###################### Start get new #######################
if ($action=="getnew") {
// generate query
// do it!
if ($bbuserinfo[userid]!=0 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/showthread.php?s=&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
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/showthread.php?s=&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
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
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

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