Extend your miniBB-forums, attaching the images and files,
get the Files Upload addon! Click here to read more.
Galleries / Attachments Addon for miniBB
miniBB ®
 
miniBB Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Re-cycled miniBB Community Forum / Re-cycled /
Short link for this topic:

Forum and topic bound search

 
Author Vodicka
Forums Member
#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
Forums Member
#2 | Posted: 10 Dec 2008 06:20
I mean very simple search box, please see the attached picture

Simple search box
Author Vodicka
Forums Member
#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
CEO
#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
Forums Member
#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
Forums Member
#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
Forums Member
#7 | Posted: 10 Dec 2008 07:13
It looks that I experimentally found the variable: {$frm}
Author Paul
CEO
#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
Forums Member
#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 Community Forum / Re-cycled / Forum and topic bound search Top
Your Reply Click this icon to move up to the quoted message

» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership 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 Community Forum Powered by Free Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts