miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Re-cycled miniBB Support Forums / Re-cycled /   

Forum and topic bound search

Author Vodicka
Registered
#1 | Posted: 10 Dec 2008 06:15 
I was wondering how difficult it would be to implement seach function directly into 1) forum and 2) topic that would be limited just for the forum and topic respectively.

Please see examples on meebo:

http://forum.meebo.com/viewtopic.php?f=5&t=17282
(search this topic)


http://forum.meebo.com/viewforum.php?f=5
(search this forum)

Author Vodicka
Registered
#2 | Posted: 10 Dec 2008 06:20 
I mean very simple search box, please see the attached picture

Simple search box

Author Vodicka
Registered
#3 | Posted: 10 Dec 2008 06:27 | Edited by: Vodicka 
The first idea that came to my mind was to add hidden input to the search form that would contain forum`s or topic`s ID.

Somethnig like this (example is for searching within forum):

This one out:

<select class="textForm" name="forum"><option value="">{$l_AllForums}</option>{$listForums}</select>

This one in:

<input type="hidden" name="forum" value="forumID" />

When I put forumID as a number, it really worked.

But there are two problems I can see:

1. I dont know the variable I might use for forumID
2. I have no idea whether something similar might work in Topic too (searching just within topic)

Author Paul
Lead Developer
#4 | Posted: 10 Dec 2008 06:38 | Edited by: Paul 
Under Quick search bar HTML topic you will find an example of such form. There is nothing easier... just look at the source of miniBB's Search section and copy necessary parts to your template, making default values as hidden.

Currently miniBB doesn't allow to search within a topic (but I might consider this as a feature request, thanks). Actually, searching within a topic might be a rare operation, only if such topic is split by many pages. On a single page, use "Find" option of your browser ;-) let's say press Ctrl+F in Mozilla and search for a phrase...

Author Vodicka
Registered
#5 | Posted: 10 Dec 2008 06:50 | Edited by: Vodicka 
Paul:
On a single page, use "Find" option of your browser ;-) let's say press Ctrl+F in Mozilla and search for a phrase...

Sure, I know. I am trying to come up with solution for ladies of all ages, though :-)


Are you saying that in this code...:

<form action="http://www.minibb.com/forums/index.php?" method="get" class="formStyle" >

<input name="phrase" type="text" size="15" maxlength="50" class="textForm" value="" />

<input type="hidden" name="searchType" value="0" />
<input type="hidden" name="where" value="0" />
<input type="hidden" name="forum" value="" />
<input type="hidden" name="action" value="search" />
<input type="hidden" name="searchGo" value="1" />

<input type="submit" value="Quick Search" class="inputButton" /> <a href="#">Advanced search</a>

</form>

...where the forum field is not filled with anything it will search in the forum where the search form will be placed?

Author Vodicka
Registered
#6 | Posted: 10 Dec 2008 07:06 
No it does not work.

Let me put it in different words:

I need the form to know in advance (with no hassle on user side) that when it is placed on page that lists topics of forum ID8, it should search only within forum ID8 and nowhere else.

Author Vodicka
Registered
#7 | Posted: 10 Dec 2008 07:13 
It looks that I experimentally found the variable: {$frm}

Author Paul
Lead Developer
#8 | Posted: 10 Dec 2008 08:24 | Edited by: Paul 
I suppose the most correct value would be: {$forum} {$frm} comes for generating forums drop-down box.

But then you should keep in mind this form should appear ONLY on forum listing page. Because on other pages, such variable may not be available (or '0' (zero) would be available only which would lead to improper results).

Author Vodicka
Registered
#9 | Posted: 10 Dec 2008 08:55 
Paul:
form should appear ONLY on forum listing page

Sure, I would put it in the main_topics.html template.

Re-cycled miniBB Support Forums / Re-cycled / Forum and topic bound search Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB