Rah's File Search
Simple public file search; combines the power of an article and a file_download_list. Searches matching results from files’ descriptions and filenames, and retunes the results as nicely formatted list.
Version 0.7 Mar 24, 2011
Other versions...
A cup of coffee
via PayPal
List of features
- Customize search results with Textpattern file forms and various attributes.
- A simple tag,
<txp:rah_file_search />
. The tag shows search results. - The search works with the standard core search. Core conditionals and forms can work too, including
<txp:if_search />
.
Requirements
- PHP 4.3.0+
- Textpattern 4.2.0 or newer.
Installation and usage
The general behavior stands: paste the plugin code to the plugin installer textarea and run the automatic setup. Then just activate the plugin and you are ready to use new tags that plugin includes like others.
For usage, basically use <txp:rah_file_search />
to display the search results. Works kinda identically as <txp:article />
.
Attributes
The tag is <txp:rah_file_search />
and it has the same attributes as <txp:file_download_list />
(and one additional). See file_download_list for the list of attributes. In addition to, the tag has:
grand_total
Omit setting result count. If the attribute is set to "0"
(zero), search_result_count won’t be updated with the number of results. This attribute could be helpful if rah_file_search is used in conjunction with article tags, as article tags won’t update the count once it’s already set.
Default: grand_total="1"
Example: "0"
.
Example
Outputs search form and results (if any).
<txp:search_input />
<txp:rah_file_search />
Changelog
Version 0.7
- Now filters by all words, not any. Thank you ax.
Version 0.6
- Now searches words individually. Thank you for notifying Marc.
- Searches are case-insensitive.
Version 0.5
- Added title to searchable fields in addition to filename and description.
Version 0.4
- Added: option to omit updating search_result_count. If
grand_total
attribute is set to0
, the count wont be set. - Changed: defaults search_result_count to
0
(zero).
Version 0.3
- Added: Now populates search_result_count.
Version 0.2
- Now only causes one extra query; uses
file_download_list()
insteadfile_download()
. - Now accepts all the same attributes as file_download_list tag.
- Now suppresses “Page template doesn’t contain article tag.” notice when on search context.
- Now uses uses same type of matching pattern as Textpattern.
- From now on requires Textpattern version 4.2.0 or newer.
Version 0.1
- Initial release.