summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-07 01:35:48 +0200
committerYorhel <git@yorhel.nl>2015-09-07 01:35:48 +0200
commit438d4df64d950f8905bd31bddc203d408f42f125 (patch)
treed2ebd6f9ea86238773cfdc35ac41033dcb9baffa /lib/VNDB/Util
parent19ce5fcf536ed478ad34b6b1014bf6f44841d25d (diff)
Implement discussion board search function
Inspired by wakaranai's implementation at https://github.com/morkt/vndb/commit/b852c87ad145fdaaa09c79b6378dd819b46f7e87 This version is different in a number of aspects: - Separate search functions for title search and fulltext post search. Perhaps not the most convenient option, but the downside of a combined search is that if the query matches the threads' title, then all of the posts in that thread will show up in the results. This didn't seem very useful. - Sorting is based purely on post date. Rank-based sort is slow without a separate caching column, and in my opinion not all that useful. Implementation differences: - Integrated in the existing DB::Discussions functions, so less code to maintain and more code reuse. - No separate caching column for the tsvector, a functional index is used instead. This is a bit slower (index results need to be re-checked against the actual messages, hence the slowdown), but has the advantage of smaller database dumps and less complexity in updating the cache. Things to fix or look at: - Highlighting of the search query in message contents. - Allow or-style query matching
Diffstat (limited to 'lib/VNDB/Util')
-rw-r--r--lib/VNDB/Util/FormHTML.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm
index 4a63a9b7..041d5a14 100644
--- a/lib/VNDB/Util/FormHTML.pm
+++ b/lib/VNDB/Util/FormHTML.pm
@@ -168,6 +168,7 @@ sub htmlFormPart {
# Generates a form, first argument is a hashref with global options, keys:
# frm => the $frm as returned by formValidate,
# action => The location the form should POST to (also used as form id)
+# method => post/get
# upload => 1/0, adds an enctype.
# nosubmit => 1/0, hides the submit button
# editsum => 1/0, adds an edit summary field before the submit button
@@ -178,7 +179,7 @@ sub htmlFormPart {
# automatically calls htmlFormError and adds a 'formcode' field.
sub htmlForm {
my($self, $options, @subs) = @_;
- form action => '/nospam?'.$options->{action}, method => 'post', 'accept-charset' => 'utf-8',
+ form action => '/nospam?'.$options->{action}, method => $options->{method}||'post', 'accept-charset' => 'utf-8',
$options->{upload} ? (enctype => 'multipart/form-data') : ();
div class => 'hidden';