PDA

View Full Version : Maximum # Posts Per Day


SFishy
05-13-2003, 02:58 PM
Hi All,

I've searched around and haven't found it, so I thought I'd request it here -- either where to find it, or if anyone thinks it would be useful enough to write (I'm no programmer!)

I'm looking for a hack that does this...

I could create a new user group called something like Registered-Limited.

People in that group would only be able to post X times per day (new threads and replies combined, in all forums), and that number could either be set globally (for all members in that group) or by the individual -- though by group would be fine for my purposes (and I think would be easier for me since I wouldn't have to add a field to the table).

What do you think? Has it been done? If not, would anyone be interested in writing it?

Thanks ;)

Logician
05-13-2003, 04:19 PM
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=40094&highlight=per+day" target="_blank">https://vborg.vbsupport.ru/showt...hlight=per+day</a>

SFishy
05-13-2003, 04:30 PM
Thanks Logician...

Problem is, I'm not sure how to modify that hack for my purposes. I don't want it to occur on a specified forum, but on all existing forums. Can you help?

I know it said in that thread to delete $cantpostforumid==$forumid AND but I wasn't sure that was complete, and I wasn't exactly sure on the syntax -- like double (( and such.

Thanks

SFishy
05-13-2003, 04:34 PM
oh, and one other thing...

I wasn't sure how to make this work for REPLIES as well, not just threads. I want it to be amount of allowed posts (threads and replies) per day.

So maybe like 1 thread and 4 replies per day allowed.

SFishy
05-13-2003, 05:56 PM
Please tell me, if you can, if this is right...

// ############################### start limit threads hack ###############################
// Cant post more than X threads in the last Y hours
// User cant post before this time expires:
$cantposthour=48;
// User cant post if he has more than X threads in the allowed time:
$allowedthreadcount=1;

if ($bbuserinfo[usergroupid]!=11)
{
$cantpostsqltime= mktime (date("H")-$cantposthour, date("i"), date("s"), date("m"), date("d"), date("Y"));
$tcinforum_db=$DB_site->query_first("SELECT count(*) as count FROM thread WHERE postuserid=$bbuserinfo[userid] AND dateline>$cantpostsqltime AND forumid=$forumid");
// User new thread count in the last X hours
$bbuserinfo[tcinforum]=$tcinforum_db['count'];

if ($bbuserinfo[tcinforum]>=$allowedthreadcount AND ($bbuserinfo[usergroupid]!=11))
{
eval("standarderror(\"".gettemplate("cantpostnow")."\");");
}
}
// Cant post more than X threads in the last Y hours

updateuserforum($threadinfo['forumid']);

And how would I modify the for newreply.php?

Thanks

SFishy
05-13-2003, 06:32 PM
Okay, obviously the above code DOESNT work... that makes everyone not able to post more than X thread per Y hours, unless they are in usergroup 11.

The original code made is so that everyone OTHER thans mods, admins and supermods could only post X threads per Y hours. I don't want that either.

Could someone please help me out here and tell me how to make it so that only ONE usergroup is permitted X posts (threads AND replies) they are allowed per Y hours.

If I knew what I was doing I wouldn't have to ask ;) and taking code that was meant to do something else isn't working for me because I don't know how to modify it properly.

Thanks

Logician
05-14-2003, 07:13 AM
here you go

SFishy
05-14-2003, 01:43 PM
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in ///newreply.php on line 93

Thanks Log... but the above error is what I got using your code. Line 93 is

$bbuserinfo[tcinforum]=$tcinforum_db['count'];

Also, would the exact same code go into newthread.php?

And... in your code you said to find updateuserforum($foruminfo['forumid']); -- that doesn't exist in either newthread.php or newreply.php

Logician
05-14-2003, 03:37 PM
problems fixed in the updated attachment..

SFishy
05-14-2003, 04:03 PM
Awesome Log! I just went through a whole bunch of testing and it seems to work perfectly!

Thank you so much!