Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2010-02-18 06:41:26

François
Member
From: Lyon (France)
Registered: 2009-09-01
Posts: 171
Website

Double post protection

Would it be possible to add a double-post protection, to prevent users to posts 2 consecutives messages in the same topic with less than X seconds between them, and ask them in the error message to edit their previous message instead of creating a new one ?

I think you just have to add something like that in the post.php file
ligne 25

$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

Replace by

$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed, s.user_id AS is_subscribed, p.poster_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN .$db->prefix.'posts AS p ON t.last_post_id = p.id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

Line 65

// Flood protection
if (!isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'])
    $errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];

   
Add after

// Double post protection
if (!isset($_POST['preview']) && $pun_user['last_post'] != '' && $pun_user['id'] == $cur_posting['poster_id'] && (time() - $pun_user['last_post']) < $pun_user['g_post_double_post'])
    $errors[] = $lang_post['double post start'].' '.$pun_user['g_post_double_post'].' '.$lang_post['double post end'];

And some code in the group permission to choose how long the users had to wait between to consecutive post in the admin panel.

Last edited by François (2010-02-18 08:29:19)


Sorry for my English, I'm French

Offline

#2 2010-02-24 10:36:19

PascL
Member
From: France
Registered: 2010-02-21
Posts: 2
Website

Re: Double post protection

There might be another option to add the text automatically to the previous post (if the length of the addition is correct) instead of creating a new one or doing an error.


Bouh !
French !

Offline

#3 2010-02-24 11:02:31

François
Member
From: Lyon (France)
Registered: 2009-09-01
Posts: 171
Website

Re: Double post protection

The user must be alerted that he doesn't post a new message because the "new" message isn't consider as a new post for the other users (it is not mark as "not read") , so an "error" must be display

Or we can modifiy the posted date ?


Sorry for my English, I'm French

Offline

#4 2010-02-24 11:31:44

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 3,755
Website

Re: Double post protection

I would say this should be a mod. It will definitely not be implemented in 1.4.0 (officially we're in "feature freeze") wink


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#5 2010-02-24 11:45:05

François
Member
From: Lyon (France)
Registered: 2009-09-01
Posts: 171
Website

Re: Double post protection

Ok, thanks for the answer wink


Sorry for my English, I'm French

Offline

Board footer

Powered by FluxBB 1.4.8