Log in

View Full Version : Number of posts before access of page


Mum
05-09-2008, 01:41 AM
I have a page on my vb which i don't want people to be able to access unless they have made 5 posts in the previous 24 hours, does anyone know of a way to do this?

calorie
05-09-2008, 03:55 AM
Untested but try placing the following right after you include the vB global.php file:

$fivepost_check = $db->query_first("SELECT COUNT(1) AS cnt
FROM " . TABLE_PREFIX . "post
WHERE userid = " . $vbulletin->userinfo['userid'] . "
AND dateline > " . TIMENOW . " - 86400
");

if ($fivepost_check['cnt'] < 5)
{
print_no_permission();
}

Mum
05-09-2008, 04:36 AM
I use this https://vborg.vbsupport.ru/showthread.php?t=62164&highlight=subscription can i use that script at the top of that page?

calorie
05-09-2008, 04:41 AM
Untested but try placing the following right after you include the vB global.php file:

require_once('./global.php');

// here

Don't see why not, just do the bold part and give it a try.

Mum
05-09-2008, 06:20 AM
That worked perfectly! Is there anyway that i can make it say something about needing 5 posts?

Dismounted
05-09-2008, 10:40 AM
You can create an error phrase, and you the error message handler in vBulletin.

Mum
05-09-2008, 06:09 PM
I'm not so good with that sort of thing (still learning) are you able to give me a few more instructions?