I've massively rewritten the module and I through that I would share.
This version is configurable for:
Block action - keystroke on / off, optional submit button (action is ajax + same page with JScript disabled or faq page submit action [useless by itself but I needed the filter on the FAQ page too - a much messier job including menu alter hooks & faq_page rewrite]
Limit on results returned from 1 to 25 results
Format display options on the results - links, Q & A, Q as link & A
An optional view all link on the block
Also found a couple security issues, the body should now be run through the check_markup() function and the title / question needs to be run through check_plain() or l().
Also hopefully made it domain independent, so the base path can be something other than just '/'.
Moved includes to a hook_init to help avoid caching issues. Also made the block non-caching as it is a trivial block and caching could cause unpredictable results.
Minor coding issues
Sorry for the massive hit rather than multiple independent feature requests, but the project is already overdue and I'm going hard out to meet the requirements.
Hope you enjoy
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | faq_search.zip | 15.92 KB | alan d. |
| #2 | faq_search.zip | 15.36 KB | alan d. |
| #1 | faq_search.zip | 15.1 KB | alan d. |
Comments
Comment #1
alan d. commentedForgot the zip :)
Comment #2
alan d. commentedAdded prefix options to both Q & A and theming functions for each to handle these and sensitization issues.
Comment #3
alan d. commentedDuh: "sensitization" was meant to be "sanitation".
Couple more features / bug fixes
Ordering now mimics FAQ module
Query uses db_rewrite_sql()
Option to show top xxx results when an empty string is added
Option to show top xxx results when the block is loaded
Happy to help maintain if you are interested, but after a couple solid weeks work here in Springsdale, Utah, USA, I'm back on the road towards Central & South America
Comment #4
alan d. commentedComment #5
mstrelan commentedAlan - in the function
faq_search_query()you call db_query_range but without the $count and $from parameters, therefore it only ever returns 1 result.Updated code as follows:
Comment #6
bensnyder commentedadmin, please grant Alan D. co-maintainership of this module.
Alan, thank you for your efforts and I apologize for being so delinquent. Just point an admin to this post and they'll do the rest.
Comment #7
alan d. commentedCool, thanks, but I'm traveling in the Americas for another 7 months, so I really will not have the time at the moment. Great to know that you like the new features.
Cheers
Alan
Comment #8
bensnyder commentedCOMMITTED #4 & #5. Thanks guys!