[2.0.19] Anti Double Posts

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
8
89%
Very Good
1
11%
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes : 9

Re: [2.0.19] Anti Double Posts

Postby 009nightfire » Fri Apr 20, 2007 12:45 am

Hello, I wanted this for my forum, but there where errors and it looked like some bits where missing and it hasn't been updated in a while, so I re wrote it and tested it on my forum, phpBB 2.0.22, found no errors so far.

1. Added a section to the Admin config panel to set how many minutes have to pass before a user can double post. 0 = Off, 1 Minute = 1, 1 hour = 60, 1 day = 1440, 1 week = 10080 etc.
2. Users can now edit their previous posts
3. Checked to see if users can post in locked topic's, which was no.
4. Added/Changed the cannot double post message to include the day and time when a user can double post again. (date('H:i - D dS M Y')

Code: Select all
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
# Insert new row into phpbb_config
  config_name - edit_time
  config_value - 0

INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('edit_time', '0');
#   
#-----[ OPEN ]------------------------------------------
#
templates/subsilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
      <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="search_flood_interval"

value="{SEARCH_FLOOD_INTERVAL}" /></td>
   </tr>
#
#-----[ AFTER, ADD ]------------------------------------
#
   <tr>
      <td class="row1">{L_EDIT_TIME} <br /><span class="gensmall">{L_EDIT_TIME_EXPLAIN}</span></td>
      <td class="row2"><input class="post" type="text" size="6" maxlength="7" name="edit_time" value="{EDIT_TIME}" /></td>
   </tr>
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_SEARCH_FLOOD_INTERVAL_EXPLAIN" => $lang['Search_Flood_Interval_explain'],
#
#-----[ AFTER, ADD ]------------------------------------
#
"L_EDIT_TIME" => $lang['Edit_Time'],
"L_EDIT_TIME_EXPLAIN" => $lang['Edit_Time_explain'],
#
#-----[ FIND ]------------------------------------------
#
"SEARCH_FLOOD_INTERVAL" => $new['search_flood_interval'],
#
#-----[ AFTER, ADD ]------------------------------------
#
"EDIT_TIME" => $new['edit_time'],

#-----[ OPEN ]------------------------------------------
#
language/language_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Search_Flood_Interval_explain'] = 'Number of seconds a user must wait between search requests';
#
#-----[ AFTER, ADD ]------------------------------------
#
// Edit Time Mod
$lang['Edit_Time'] = 'Edit Time Interval';
$lang['Edit_Time_explain'] = 'Number of minutes a user must wait before replying to the last post in a topic if the last post was their own. 1 hour = 60, 1 day = 1440, 0 = Off/never';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['No_post_mode']
#
#-----[ AFTER, ADD ]-----------------------------------
#
$lang['No_doublepost'] = 'You cannot Double Post in this topic until the time limit expires. Please edit your message instead. Time till expire: ';
$lang['Query_topic'] = 'Could not query topics table';
$lang['Query_post'] = 'Could not query posts table';
#

#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
   switch ( $mode )
   {
      case 'editpost':
      case 'newtopic':
      case 'reply':
#
#-----[ AFTER, ADD ]------------------------------------
#
# If you use a mod that limits user edit time, change $board_config['edit_time']
# to the correct option if neccessary.
#
         //
         // BEGIN - Anti Double Post Mod
         //
         if ( $mode == 'reply')
         {
            
            if ( !$is_auth['auth_mod'] && $board_config['edit_time'] != 0 )
            {
            
            $sql = "SELECT topic_last_post_id
                  FROM " . TOPICS_TABLE . "
                  WHERE topic_id = " . $topic_id;
            if (!$topic_query = $db->sql_query($sql))
            {
                message_die(GENERAL_ERROR, $lang['Query_topic']);
            }
            $topic = $db->sql_fetchrow($topic_query);
            $last_post_id = $topic['topic_last_post_id'];
            
            $sql = "SELECT poster_id,post_time
                  FROM " . POSTS_TABLE . "
                  WHERE post_id = " . $last_post_id;
            if (!$post_query = $db->sql_query($sql))
            {
               message_die(GENERAL_ERROR, $lang['Query_post']);
            }

            $post = $db->sql_fetchrow($post_query);
            $last_user = $post['poster_id'];
                                $last_post_time = $post['post_time'];

            $current_time = time();
            $difference_min = ($current_time - $last_post_time) / 60;
            
                if ($difference_min < $board_config['edit_time']) {
                $edit_overtime = TRUE;
            $difference_mins = date('H:i - D dS M Y',($last_post_time + ($board_config['edit_time']*60)));}
                else { $edit_overtime = FALSE; }
   
            if (($userdata['user_id'] == $last_user) && ($is_auth['auth_edit']) && ($edit_overtime == TRUE) &&

(!$is_auth['auth_mod']))
            {
               message_die(GENERAL_MESSAGE,$lang['No_doublepost'].$difference_mins.".");
            }
            }
                         }
                        //
         // END - Anti Double Posts Mod
         //

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
009nightfire
Registered User
 
Posts: 1
Joined: Wed Apr 26, 2006 2:53 pm

Re: [2.0.19] Anti Double Posts

Postby RottNKorpse » Wed May 16, 2007 12:40 am

wow nice update nightfire...

Is it fixed yet, and how do I get it to my forums

Can somebody please make a tutorail on how to get it to FreePowerBoards???

http://freepowerboards.com/kylespivots

A site about Pivot Stick Figure Animations.
THANKS!!

No one can help you with this because free forum hosts don't allow you to install mods...the only two things you can do is either contact the staff of freepowerboards and ask them to install it or buy your own hosting and install it yourself.
User avatar
RottNKorpse
Registered User
 
Posts: 197
Joined: Fri Apr 29, 2005 9:46 pm
Location: don't rush me

Re: [2.0.19] Anti Double Posts

Postby drewtscott » Tue Jun 12, 2007 5:45 pm

Any plans to port this mod to phpBB3?
drewtscott
Registered User
 
Posts: 152
Joined: Wed Jan 04, 2006 9:51 pm

Re: [2.0.19] Anti Double Posts

Postby runegirlie » Thu Jul 05, 2007 8:50 am

I installed 1.0.3 .. don't seem to be getting any of the errors people have reported.

1. People can edit their posts regardless if someone else has already posted
2. People cannot post on locked topics
3. People can post on other posts regardless if someone else has posted

Great Mod .. thanks much! :D
runegirlie
Registered User
 
Posts: 173
Joined: Sun Jul 31, 2005 6:08 pm

Re: [2.0.19] Anti Double Posts

Postby catssy » Mon Mar 31, 2008 3:38 pm

How to insert in a No_doublepost Message :
Code: Select all
You cannot post in this topic until another user posts after you. Please edit your message instead.

which is shown when You tray to double post, a BACK link to Your last post ?
like: Click HERE to view your message ??
catssy
Registered User
 
Posts: 4
Joined: Wed Jan 16, 2008 2:00 pm

Previous

Return to [2.0.x] MOD Database Releases

Who is online

Users browsing this forum: No registered users and 3 guests