View Full Version : limited forum threads
Smalley
12-14-2002, 08:30 PM
there is any hack can limit the users to do not add more than the threads which the admin wants ??
like in fourmid==2 it is for 50 threads only no more thread can be added unless the admin increase the limit for this specific forum?
Xenon
12-14-2002, 08:48 PM
hmm, there is no hack out, and i didn't see the sense of it, but i can be done with one edit of newthread.php:
after that:$permissions=getpermissions($forumid);
if (!$permissions[canview] or !$permissions[canpostnew]) {
show_nopermission();
}
add that:
if (in_array($forumid,array(2,3,4))) {
$threadcount=$DB_site->query_first("SELECT COUNT(*) AS count FROM thread WHERE forumid=$forumid");
if($threadcount[count]>=50) show_nopermission();
}
Smalley
12-14-2002, 09:42 PM
when i place it ,, i face this error ..
Fatal error: Call to undefined function: array() in /home/arabms/public_html/vb/newthread.php on line 42
Smalley
12-14-2002, 09:43 PM
and if i want it for multiple forums can i ??
Xenon
12-14-2002, 10:17 PM
yap, sorry, typing error ;)
i've edited the post, now it'll work for the forumid's 2,3,4 :)
Smalley
12-14-2002, 10:36 PM
man it still gives me error
Parse error: parse error, unexpected '{' in /home/arabms/public_html/vb/newthread.php on line 40
and how about if i repate the line to control diffirent forum for diffirent number of threds it will work ?
Smalley
12-15-2002, 07:19 AM
any help for this issue ?
Smalley
12-15-2002, 11:42 AM
it is still not works
Xenon
12-15-2002, 11:46 AM
there is no need for 2 bumps after less than half of a day....
hav corrected it, i've forgotten an )
Smalley
12-15-2002, 01:58 PM
its working fine Thanks alot ,,
if i want it to be for different fourm in different number of threads should i repeat the line or there is another way to have this ?
Xenon
12-15-2002, 02:59 PM
you're welcome
you have to expand and repeat the inner if-clause:
if (in_array($forumid,array(2,3,4))) {
$threadcount=$DB_site->query_first("SELECT COUNT(*) AS count FROM thread WHERE forumid=$forumid");
if($threadcount[count]>=50 and $forumid==2) show_nopermission();
else if($threadcount[count]>=150 and $forumid==3) show_nopermission();
else if($threadcount[count]>=20 and $forumid==4) show_nopermission();
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.