phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

How to separate timeout and edit timeout?


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
bengurion
Board Member



Joined: 16 Sep 2018

Posts: 21



PostPosted: Mon Sep 24, 2018 1:48 pm 
Post subject: How to separate timeout and edit timeout?

I need to set timeout for posting more than 60 seconds. But if you post a message, you cannot edit it also for this amount of time.
How to let users edit messages without timeout?
icon_question.gif Image link
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 153



PostPosted: Mon Sep 24, 2018 1:59 pm 
Post subject: Re: How to separate timeout and edit timeout?

Hi,

What mod are you using for said timeout?
There was a mod that made any new message posted before a delay into an edit of the previous message.

_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
bengurion
Board Member



Joined: 16 Sep 2018

Posts: 21



PostPosted: Mon Sep 24, 2018 2:56 pm 
Post subject: Re: How to separate timeout and edit timeout?

Vendethiel wrote:
Hi,

What mod are you using for said timeout?
There was a mod that made any new message posted before a delay into an edit of the previous message.


I think it is not a mod. It is basic feature from configuration. But i really don't remember icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif
By the way - are there ways not to let people post in some forum for first X days after registration? Only one of the forums not all of them.
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 585
Location: North West UK


flag
PostPosted: Mon Sep 24, 2018 4:48 pm 
Post subject: Re: How to separate timeout and edit timeout?

You could make that forum a private one only accessed by members of a usergroup. Members would then have to ask to join that usergroup.

Jim

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
bengurion
Board Member



Joined: 16 Sep 2018

Posts: 21



PostPosted: Mon Sep 24, 2018 5:13 pm 
Post subject: Re: How to separate timeout and edit timeout?

Jim_UK wrote:
You could make that forum a private one only accessed by members of a usergroup. Members would then have to ask to join that usergroup.

Jim


That's already done by the way icon_wink.gif Through system of "reputation points". But the problem is to timeout new postings not damaging the edit timeout. icon_rolleyes.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 439
Location: Qu├ębec


flag
PostPosted: Mon Sep 24, 2018 6:33 pm 
Post subject: Re: How to separate timeout and edit timeout?

Flood control happens in includes/functions_post.php around line 194:
Code:
   if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')
   {
      //
      // Flood control
      //
      $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
      $sql = "SELECT MAX(post_time) AS last_post_time
         FROM " . POSTS_TABLE . "
         WHERE $where_sql";
      if ($result = $db->sql_query($sql))
      {
         if ($row = $db->sql_fetchrow($result))
         {
            if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
            {
               message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
            }
         }
      }
   }

If you simply want to allow editing without any timeout, you could simply remove that part of the condition at the top:
Code:
CHANGE:
if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')

TO:
if ($mode == 'newtopic' || $mode == 'reply')

If instead you want to hardcode an arbitrary timeout for editing, there are a few ways you could go about it. The most straightforward might be to add an alternate limit in the last condition check (replacing '10' as desired):
Code:
CHANGE:
            if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))

TO:
            if (intval($row['last_post_time']) > 0 && (($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']) || ($mode == 'editpost' && ($current_time - intval($row['last_post_time'])) < 10)))

Hopefully I didn't trip over all those parentheses - make sure to try this on a development board first.
Back to top
bengurion
Board Member



Joined: 16 Sep 2018

Posts: 21



PostPosted: Mon Sep 24, 2018 10:54 pm 
Post subject: Re: How to separate timeout and edit timeout?

Salvatos wrote:
If you simply want to allow editing without any timeout, you could simply remove that part of the condition at the top:
Code:
CHANGE:
if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')

TO:
if ($mode == 'newtopic' || $mode == 'reply')



Thats it! Works great thank you!
I love this forum at last exists. icon_cool.gif icon_cool.gif icon_cool.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0257 seconds using 15 queries. (SQL 0.0023 Parse 0.0008 Other 0.0226)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo