vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Maximum # Posts Per Day (https://vborg.vbsupport.ru/showthread.php?t=52892)

SFishy 05-13-2003 01:58 PM

Maximum # Posts Per Day
 
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 03: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 03: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 03: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 04:56 PM

Please tell me, if you can, if this is right...

Code:

// ############################### 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 05: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 06:13 AM

1 Attachment(s)
here you go

SFishy 05-14-2003 12: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

Code:

$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 02:37 PM

problems fixed in the updated attachment..

SFishy 05-14-2003 03:03 PM

Awesome Log! I just went through a whole bunch of testing and it seems to work perfectly!

Thank you so much!


All times are GMT. The time now is 12:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02125 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete