2 mikes Nov 24, 2018 04:29

Say no more about the documentation lol
I've haven't seen an option to change the 30sec rule but as you indicate being able to change it seems reasonable with a warning about spammers and misuse. I'll check out the back end and files etc.
Been checking files and searched for similar see https://forums.b2evolution.net/topic-7641 but this didn't work when I tried it.
1) there is no such section and variable
/**
* Minimum interval (in seconds) between consecutive comments from same IP
* @global int $minimum_comment_interval
*/
$minimum_comment_interval = 30;
2) adding and setting at 32 for a test did nothing, so still looking
Been checking the database and no luck at finding it there so far so thinking again it is set in a file ??
Look at [/plugins/_basic_antispam.plugin.php]
if( $last_comment_time = $DB->get_var( $SQL ) )
{ // If last comment is found from current IP or email address:
$last_comment_time = mysql2date( 'U', $last_comment_time );
$new_comment_time = mysql2date( 'U', date( 'Y-m-d H:i:s', $localtimenow ) );
if( ( $new_comment_time - $last_comment_time ) < $min_comment_interval )
{ // Block new comment because of minumum interval:
$this->msg( sprintf( T_('You can only post a new comment every %d seconds.'), $min_comment_interval ), 'error' );
if( $comment_Item )
{
syslog_insert( sprintf( 'The comment can be posted only every %d seconds', $min_comment_interval ), 'info', 'item', $comment_Item->ID, 'plugin', $this->ID );
}
// Exit here to don't spend a time to next checking:
return;
}
Trying to find where $min_comment_interval is set, but could override it in this section
Ok for now you can edit the above plugin by adding a line after 219
$min_comment_interval = $this->Settings->get( 'min_comment_interval' );
$min_comment_interval = 6;
or so that only logged in users get the quick comment option, if you allow open comments, as otherwise more open to spam
$min_comment_interval = $this->Settings->get( 'min_comment_interval' );
if(isset($current_User) )
{
$min_comment_interval = 6;
}
EDIT
The second code that checked if the user was logged in didn't work so I'll get back on that
Yes that's weird works fine if I use if(isset($current_User) ) i.e user is not set ??
Not a problem for me as I don't allow comments except from logged in users so I don't need the if clause. Maybe $current_User isn't global ??
OK this seems to work and getting a new comment up and posted in less than 10 seconds is a bit much
$min_comment_interval = $this->Settings->get( 'min_comment_interval' );
if (is_logged_in());
{
$min_comment_interval = 16;
}
Bet there's an easier way of doing this but this does revert to 30 secs if someone is not a logged in user
Thanks will play with that.
Changing cms's causes brain damage.
Found it phew!
Over the years the options have become so multifarious that they are difficult to keep track of, as you indicated better documentation would help, which is updatable via comments from users.
Also many users are looking for quick answers and do not search much so lucky there is this forum.
Sorry, I meant for Mods and Users.