PDA

View Full Version : Looking for a hack to modify the search...


12-13-2000, 11:47 PM
What I'd like is for the Search function to work similar to the way UBB is. What I mean is that in UBB, if you start the search from within a forum, the search is auto preset to search within that forum. It looks like vB always is preset to search all forums. Can someone help me with this?

12-14-2000, 01:39 AM
yep that's easy enough - i have it working in my forums as a simple text link to posts within a forum for the past 24 hrs

http://animeboards.net/forums/forumdisplay.php?forumid=3

Here's the thread on it http://vbulletin.com/forum/showthread.php?threadid=2679

all you need to do is put into forumdisplay template -

search.php?getdaily=yes&action=dosearch&searchdate=1&forumchoice=$forumid

or

/forums/search.php?getdaily=yes&action=dosearch&searchdate=1&forumchoice=$forumid

depending where you have vB installed

12-14-2000, 01:47 AM
Thank you. I'm not sure what you meant by this, however: "...i have it working in my forums as a simple text link to posts within a forum for the past 24 hrs". Could you elaborate on that? I can't see an example on your board unless I register, and I'm sure you don't want a superfluous regsistration. :)

If I have my vB installed in a folder named bbs (as a subfolder of the root www folder), should that last bit be "/bbs/search.php?getdaily=yes&action=dosearch&searchdate=1&forumchoice=$forumid"?

12-14-2000, 02:44 AM
Originally posted by JJR512
Thank you. I'm not sure what you meant by this, however: "...i have it working in my forums as a simple text link to posts within a forum for the past 24 hrs". Could you elaborate on that? I can't see an example on your board unless I register, and I'm sure you don't want a superfluous regsistration. :)

If I have my vB installed in a folder named bbs (as a subfolder of the root www folder), should that last bit be "/bbs/search.php?getdaily=yes&action=dosearch&searchdate=1&forumchoice=$forumid"? what i mean is on the above page in forum id = 3 i have a text link on the top right portion of my main table saying forum post in past 24 hrs and the text link points to http://animeboards.net/forums/search.php?getdaily=yes&action=dosearch&searchdate=1&forumchoice=3

which when clicked brings back the posts in the last 24hrs in forum id = 3

and yes if you link would be /bbs/and that code which you would put in your forumdisplay template

12-14-2000, 02:52 AM
That's not exactly what he wants, if you can wait until v2.0 comes out and ask again I will give you a hack.

..oh and eva wants all the registrations he can get :)

12-14-2000, 03:08 AM
Thanks, freddie; I was starting to get the feeling that there was a misunderstanding here somewhere, and you just confirmed where it was!

eva2000, what I was looking for was this. The way vB is by default, whenever you click on the Search button, you get a screen that has a box to type in some keywords to search for, a username to search for posts by, a time period to search for posts during, etc. Also, you can pick what forum to search in. By default, this last thing is always set to search in all forums. It is always set to search all forums, no matter where you were when you clicked on the Search button.

In UBB, if you are in a particular forum, let's call it General, if you click on the Search button while in that forum, the box that lets you pick which forum to search in is already pre-set to General. Of course, you can still change it to any forum you want, it's just that it's preset to whatever forum you were in when you clicked the button.

This is what I'm asking if someone could make for vB. I understand freddie wants to wait, but if anyone else wants to take this on now, why that'd be good too!

Actually, I have an idea for an improvement. Instead of just being able to select one forum to search in from a drop-box, maybe it could be changed so that it is a list of your forums with check-boxes, and you can check the forums you want, more than one if you want. And the search would search in the forums you've selected. That'd be way cool!

[Edited by JJR512 on 12-14-2000 at 12:12 AM]

12-14-2000, 04:16 AM
That could also be done rather easily. Personally I hate the way UBB assumes I only want to search the forum that I am in but I understand it is needed considering how long a search on UBB can take (if the search is even enabled).

12-14-2000, 01:15 PM
Originally posted by JJR512
Actually, I have an idea for an improvement. Instead of just being able to select one forum to search in from a drop-box, maybe it could be changed so that it is a list of your forums with check-boxes, and you can check the forums you want, more than one if you want. And the search would search in the forums you've selected. That'd be way cool!
[Edited by JJR512 on 12-14-2000 at 12:12 AM] [/B]
I'll take that challenge.. that's a kewl idea :)

12-15-2000, 08:51 PM
i had to go yesterday, so i didn't have the time.. but i will try it, now :)

12-16-2000, 04:08 PM
hmm i had no luck yet, but i'll keep ya informed.. the main prob will be, that because my board is all hacked up with my small hacks, that when i finished it, that i can give good instructions on including it on a clean board :D oh well, we'll see by then..

12-17-2000, 05:54 PM
hmm can't get it to work :(
(feels weird, talking to myself :P)

Anyone else up for a shot on this?

12-18-2000, 01:52 AM
This is my theory. I don't have the skills to do this myself, but I think I know enough to at least conceptualize it in my head.

The Search button needs to be modified so that instead of just going to the Search page, it also passes along a variable. The variable would get the forumid of whatever forum you were in when you clicked the button, and pass it to the Search page, possibly through the URL.

The Search page would be modified so that instead of a drop-down selection box, it is a list of check-boxes, one for each forum, with each forum name.

Inside the Search page, with each check-box, there should be a way to check if the variable passed from when you clicked the Search button matches the forumid of the forum associated with the check-box, and if it does, set it to pre-checked.

I hope that makes sense and helps you!

12-18-2000, 02:20 AM
You should be making these requests in the vb 2.0 request forum if you would like them to be considered for v2.0.

12-19-2000, 08:12 AM
Originally posted by freddie
You should be making these requests in the vb 2.0 request forum if you would like them to be considered for v2.0.
Don't want them in 2.0, want them now :)
I'll make another attempt.. Just gotta know how i can get the list dynamically filled with all forumnames..
Dunno if i can get it to worh though..
If i can, i'll post the code, otherwise, sorry :)