vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Limit posts per thread (https://vborg.vbsupport.ru/showthread.php?t=68406)

vonedaddy 08-16-2004 03:20 PM

Limit posts per thread
 
Is there a way I can limit the amount of posts in a certain time frame someone can post to a particular thread??? In other words say I want to limit a user names bob to only be able to post in the same thread once every day is that possible??

Can that be possible?

Colin F 08-16-2004 03:37 PM

Quote:

Originally Posted by vonedaddy
Is there a way I can limit the amount of posts in a certain time frame someone can post to a particular thread??? In other words say I want to limit a user names bob to only be able to post in the same thread once every day is that possible??

Can that be possible?

Sure it's possible.

Add a check with something like this in your newreply.php

$lastpost = $DB_site->query_first("SELECT dateline FROM post WHERE threadid = $thread[threadid] AND userid = $bbuserinfo[userid]");
if (vbdate("Ymd", $lastpost[dateline]) == vbdate("Ymd"))
{
eval(print_standard_error('error_posttoday'));
}

you would have to add an errorphrase "error_posttoday".

Also, enclose the whole thing with a check if it's the forum or thread you want.

vonedaddy 08-17-2004 02:30 AM

I appreciate the help but I dont know if I am good enough with PHP to do this... I would be willing to pay someone to make a hack for me that I can use from my admincp or something.

Colin F 08-17-2004 03:02 AM

I'll contact you per PM then :)

Gholsie 08-21-2004 05:07 AM

Is there a way to limit the posts per hour, per thread? I'd like to set up a user so he can only post once per hour per thread instead of an entire day.

Colin F 08-21-2004 05:29 AM

Add a check like this:

$lastpost = $DB_site->query_first("SELECT dateline FROM post WHERE threadid = $thread[threadid] AND userid = $bbuserinfo[userid]");
if (vbdate("YmdH", $lastpost[dateline]) == vbdate("YmdH"))
{
eval(print_standard_error('error_posttoday'));
}

this wil allow users to post at 10.55 AND at 11.05 though. Just not again till 12.xx

pran 09-11-2004 02:32 AM

Quote:

Originally Posted by Colin F
Add a check like this:

$lastpost = $DB_site->query_first("SELECT dateline FROM post WHERE threadid = $thread[threadid] AND userid = $bbuserinfo[userid]");
if (vbdate("YmdH", $lastpost[dateline]) == vbdate("YmdH"))
{
eval(print_standard_error('error_posttoday'));
}


this wil allow users to post at 10.55 AND at 11.05 though. Just not again till 12.xx

Hi, I'm getting
Code:

Invalid SQL: SELECT dateline FROM post WHERE threadid =  AND userid = 2
mysql error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND userid = 2' at line 1

when I used your code. It doesn't seem to get the threadid variable from PHP.

Colin F 09-11-2004 07:44 AM

funny... I guess you don't have table prefixes, do you?

You might try this:

$lastpost = $DB_site->query_first("SELECT dateline FROM post WHERE (threadid = $thread[threadid]) AND (userid = $bbuserinfo[userid])");

blackshadowc4p 09-22-2004 10:17 AM

I need something a little different. We have a validation period were all posts from a user are validated before going to the board.

We have a Polls forum, and some of the validating users try to scape the period by posting there a lot.

I want to allow just 1 post on the whole Poll forum per day for all users that are on a particular usergroup (in my case Validating Members).

Is this possible? If yes, how?

Thanks.


All times are GMT. The time now is 11:31 AM.

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.02040 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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