Ticket #279 (fixed enhancement)
Search in severals forums - backport from 1.3
- Created: 2011-02-07 16:42:00
- Reported by: adaur
- Assigned to: Franz
- Milestone: 1.4.6
- Component: search
- Priority: low
Hello
Chosing the forums where you want to search is a good idea, like FluxBB/PunBB 1.3 do. It could be easily done with search.php's 1.3 file: https://github.com/fluxbb/fluxbb/blob/f … search.php
You only have to add the forum's list, then change the forum_id=x to forum id in (x) (I think).
History
adaur 2011-02-12 16:48:35

- Uploaded patch search.txt. (view)
I joined a txt file: search from 1.4.4 patched with this feature. It works, but there is no style for that feature, so I think you will have to do it, I'm sooo bad in CSS
Edit: ok, it works but a strange thing is happening when you select the 2nd forum...
Reines 2011-02-16 14:56:21

Should this be considered for 1.4.5 or 2.0? Technically it is a new feature, but it is also a backport from 1.3.
adaur 2011-02-19 18:06:35

The checkboxes work better with
while ($cur_forum = $db->fetch_assoc($result))
{
if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
{
if ($cur_category)
echo "\t\t\t\t\t\t\t".'</fieldset>'."\n";
echo "\t\t\t\t\t\t\t".'<fieldset>'."\n\t\t\t\t\t\t\t\t".'<legend><span>'.pun_htmlspecialchars($cur_forum['cat_name']).':</span></legend>'."\n";
$cur_category = $cur_forum['cid'];
}
echo "\t\t\t\t\t\t\t\t".'<div class="checklist-item"><input type="checkbox" name="forum[]" id="f'.$cur_forum['fid'].'" value="'.$cur_forum['fid'].'" /><label for="f'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</label></div>'."\n";
}
The real last problem is: how to integrate it properly to the search page?

FYI: If displaying it as scrollable checkboxes like PunBB, keep in mind that the scrollbar is not visible on the iPhone. See screenshot.
http://dl.dropbox.com/u/4284608/iPhoto.png
adaur 2011-06-30 09:00:39

Is it a problem? If nothing is checked, the search will be done for all forums.

Yes. When "Search all forums" is disabled, then you won't be able to scroll to view the other forums to select.
Franz 2011-08-02 21:33:35

I could solve that problem by simply showing the old selector when users are not allowed to search all forums. This way we also avoid unexpected error messages about having to select a forum - which would be quite a usability issue in my eyes.
One could now argue about whether selecting a few forums should be allowed for people who are not allowed to search the whole board. But I would actually tend to think that this way we also avoid people trying to get around avoiding the limitation by selecting all forums but one.
To keep the design consistent, we could, of course, simply replace the list of checkboxes with radio buttons in that case.
Comments?
Franz 2011-08-02 23:10:39

That commit is the implementation and markup. Now for the styling, which will hopefully be done tomorrow...