Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2003, 02:58 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-13-2003, 04:19 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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>
Reply With Quote
  #3  
Old 05-13-2003, 04:30 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 05-13-2003, 04:34 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 05-13-2003, 05:56 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 05-13-2003, 06:32 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 05-14-2003, 07:13 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here you go
Attached Files
File Type: txt x post per day.txt (2.9 KB, 35 views)
Reply With Quote
  #8  
Old 05-14-2003, 01:43 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 05-14-2003, 03:37 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

problems fixed in the updated attachment..
Reply With Quote
  #10  
Old 05-14-2003, 04:03 PM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thank you so much!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:55 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.04115 seconds
  • Memory Usage 2,265KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete