miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · Register · Search · Statistics · File Bank · Manual ·
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

How to achieve that afrer registarion user is not allowed to post for a certain period of time

 
Author Persian
Partaker
#1 · Posted: 3 Sep 2008 15:24
how can i set for user registration that when he/she registers can't creat topik or post in some hour or days?...

Author Paul
Lead Lead Developer
#2 · Posted: 4 Sep 2008 03:27
Currently, there is no such option or solution, but only custom add-on would be possible to implement.

Author tom322
Active Member
#3 · Posted: 2 Jul 2025 17:11
With the recent spammers who first register and wait for some time to spam, I thought it would be a useful addon. I created a mock up which doesn't work but I feel it needs to be something like that. Only Paul can confirm ; )

$secFromReg=84000; //how many seconds the newly registered user must wait before he can make a post

if($action=='vthread' or $action=='vtopic' and $user_id>0 and $row=db_simpleSelect(0, $Tu, "{$dbUserSheme['username'][1]}, {$dbUserId}", $dbUserSheme['user_regdate'][1], '>', NOW()+$secFromReg)) $canPost=TRUE; else $canPost=FALSE;

if($canPost==FALSE) $roForums[]=$forum;

Author Paul
Lead Lead Developer
#4 · Posted: 4 Jul 2025 19:11
tom322
I would avoid using straight NOW() as mySQL command. From my experience, mySQL database and PHP could be set up in different time zones ('cause placed on different servers). If we deal with PHP, then I'd prefer to use PHP commands only, and your code would be improved to that (I didn't check it):

$secFromReg=84000; //how many seconds the newly registered user must wait before he can make a post
$canPost=FALSE;

if(($action=='pthread' or $action=='ptopic' or action=='vthread' or action=='vforum') and $user_id>1 and !$isMod){
if($row=db_simpleSelect(0, $Tu, "{$dbUserSheme['user_regdate'][1]}", "{$dbUserId}", '=', $user_id)) {
if(time()>strtotime($row[0])+$secFromReg) $canPost=TRUE;
}
}

if(!$canPost) $roForums[]=$forum;

Author tom322
Active Member
#5 · Posted: 4 Jul 2025 19:50
Thank you Paul, I'll check it. But quick question — you add this condition on 'pthread' or 'ptopic' actions, but then when user writes something in a post form, it will be lost when he submits the form? If so, I'm not sure if it's a convenient way as it may put some people off.. so I thought it might be better to use it on 'vthread' or 'vforum' actions, but not sure now..

Author Paul
Lead Lead Developer
#6 · Posted: Yesterday 11:49
Oh well, actions you've mentioned surely could be added to the code (I've updated mine) to avoid displaying of the posting form.

But posting actions should be added too, 'cause someone could use external script for the submission. Spammers most likely do that and do not use forum forms.

Author tom322
Active Member
#7 · Posted: Yesterday 14:50
Thank you — it seems to work well, will have to check with a couple of more users and will let you know if there's a problem, but it shouldn't be.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 How to achieve that afrer registarion user is not allowed to post for a certain period of time
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.