vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Min Post count to start a new thread (https://vborg.vbsupport.ru/showthread.php?t=70265)

luke2kz71 10-05-2004 10:00 PM

Min Post count to start a new thread
 
I made this for our for-sale section..... thought someone else may want it... it has no user friendly control pannel or anything.... just plain code.


Open your newthread.php file in your forum directory...

find this line:
PHP Code:

// ############################### start post thread ############################### 

right before it add this:
PHP Code:

// check to see if user meets post count requirments

//set the min posts count
$minpostcount 49;
//enter the forumids of the forums u want a post count limit on. i used 73, 28, and 40.

if ((($forumid == 73) OR ($forumid == 28) OR ($forumid == 40) OR ($forumid == 80)) AND ($bbuserinfo['posts'] < $minpostcount)) {
print_no_permission();


This simple hack is extreamly simple, and there is nothing special about it.... but it may help someone who wants to limit access to a forum or 2... to make it work for only 1 forum... use this:

PHP Code:

if (($forumid == 73) AND ($bbuserinfo['posts'] < $minpostcount)) {
print_no_permission();


73 being the only forumid

or for 2 forums:

PHP Code:

if ((($forumid == 73) OR ($forumid == 100)) AND ($bbuserinfo['posts'] < $minpostcount)) {
print_no_permission();


73 and 100 being the forum ids...

If you do not know how to get a forum id, just copy and paste a link to your forum.... like this:
http://www.fullsizechevy.com/forums/...isplay.php?f=3

the number after the equal sign is the forumid .... which in this case... is 3 :)

Xenon 10-06-2004 02:41 PM

i suggest to replace
PHP Code:

if ((($forumid == 73) OR ($forumid == 28) OR ($forumid == 40) OR ($forumid 80)) AND ($bbuserinfo['posts'] < $minpostcount)) {
print_no_permission();


with
PHP Code:

if (in_array($forumid, array(73284080)) AND $bbuserinfo['posts'] < $minpostcount
{
print_no_permission();


way easier to read or change :)

luke2kz71 10-06-2004 03:39 PM

Quote:

Originally Posted by Xenon
i suggest to replace
PHP Code:

if ((($forumid == 73) OR ($forumid == 28) OR ($forumid == 40) OR ($forumid 80)) AND ($bbuserinfo['posts'] < $minpostcount)) {
print_no_permission();


with
PHP Code:

if (in_array($forumid, array(73284080)) AND $bbuserinfo['posts'] < $minpostcount
{
print_no_permission();


way easier to read or change :)

Thanks, i am still a php noob :D

I also just realised i put 1 equal sign instead of 2 up there on the third forum, which would have changed the forumid to 80 everytime a new thread was started :o

Colin F 10-06-2004 03:46 PM

I would edit your first post, to reflect the fix for that one =, as some users don't read past the first post...

AN-net 10-06-2004 04:27 PM

am i just missing something cant you just use the promotions system....

Colin F 10-06-2004 04:42 PM

Quote:

Originally Posted by AN-net
am i just missing something cant you just use the promotions system....

now that you mention it, yes you could.

Still, this might be helpful for users that already have tons of usergroups, which would make an implementation of the promotion system rather hard...

luke2kz71 10-06-2004 04:43 PM

Quote:

Originally Posted by Colin F
now that you mention it, yes you could.

Still, this might be helpful for users that already have tons of usergroups, which would make an implementation of the promotion system rather hard...


well we allready have a dozen usergroups, and 19,000 members...

Mephisteus 10-06-2004 06:28 PM

I believe this already exists, https://vborg.vbsupport.ru/showthread.php?t=64607

Nice work anyway :)

kall 10-06-2004 06:52 PM

Quote:

Originally Posted by AN-net
am i just missing something cant you just use the promotions system....

AFAIK, default Usergroup Permissions doesn't allow for per-forum posting restrictions.


All times are GMT. The time now is 12:39 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.01063 seconds
  • Memory Usage 1,752KB
  • 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
  • (8)bbcode_php_printable
  • (4)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