diff options
author | Yorhel <git@yorhel.nl> | 2009-08-08 11:35:02 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-08 11:36:40 +0200 |
commit | 56e1cdc886144b85ede74c15d1ced116c790f7c2 (patch) | |
tree | 814cc652c6c8a3a4ac6d26ca9d6d1769342ddccd | |
parent | d762e3bfb989cb0f95413c37142d18de1180bfbb (diff) | |
parent | 1d2756b5fe83419a24591ccc4cc403c3d58dd7af (diff) |
Merge branch '3dev' of git://3decibels.net/vndb into beta
+ ChangeLog update
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | lib/VNDB/DB/Discussions.pm | 4 | ||||
-rw-r--r-- | lib/VNDB/Handler/Discussions.pm | 4 | ||||
-rw-r--r-- | lib/VNDB/Util/FormHTML.pm | 1 |
4 files changed, 9 insertions, 1 deletions
@@ -10,6 +10,7 @@ - Tag cache regenerated daily rather than hourly - Added OpenSearch plugin + autodetection - Converted font size units to px in the css + - Added double-post prevention 2.5 - 2009-07-09 - Hide NSFW images in diff viewer (unless NSFW warnings are disabled) diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm index 58cc5f61..5e371fbc 100644 --- a/lib/VNDB/DB/Discussions.pm +++ b/lib/VNDB/DB/Discussions.pm @@ -153,7 +153,7 @@ sub dbThreadCount { } -# Options: tid, num, what, order, uid, hide, page, results +# Options: tid, num, what, order, uid, mindate, hide, page, results # what: user thread sub dbPostGet { my($self, %o) = @_; @@ -169,6 +169,8 @@ sub dbPostGet { 'tp.num = ?' => $o{num} ) : (), $o{uid} ? ( 'tp.uid = ?' => $o{uid} ) : (), + $o{mindate} ? ( + 'tp.date > ?' => $o{mindate} ) : (), $o{hide} ? ( 'tp.hidden = FALSE' => 1 ) : (), $o{hide} && $o{what} =~ /thread/ ? ( diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm index 1ec79c18..d8aa2f63 100644 --- a/lib/VNDB/Handler/Discussions.pm +++ b/lib/VNDB/Handler/Discussions.pm @@ -166,6 +166,10 @@ sub edit { { name => 'msg', maxlenght => 5000 }, ); + # check for double-posting + push @{$frm->{_err}}, 'doublepost' if $self->dbPostGet( + uid => $self->authInfo->{id}, tid => $tid, mindate => time - 30, results => 1, $tid ? () : (num => 1))->[0]{num}; + # parse and validate the boards my @boards; if(!$frm->{_err} && $frm->{boards}) { diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm index dfb9a91f..f8047c4c 100644 --- a/lib/VNDB/Util/FormHTML.pm +++ b/lib/VNDB/Util/FormHTML.pm @@ -54,6 +54,7 @@ my %formerr_exeptions = ( toolarge => 'Image is too large, only 500kB allowed', oneaday => 'You can only register one account from the same IP within 24 hours', nochanges => 'No changes, please don\'t create an entry that is fully -identical- to another', + doublepost => 'Please wait 30 seconds before making another post', ); |