PDA

View Full Version : page viewble only by users with xxx posts


hollyboy
03-23-2005, 07:22 AM
Is it possible to set a php integrated into my vB so that only registered users with xxx posts can view it?

hate
03-23-2005, 07:34 AM
After your call to global.php in the script put this if ($bbuserinfo[posts] =<20)
{
print_no_permission();
}

hollyboy
03-23-2005, 07:41 AM
I get error after I added that code I think the "<" is not recognized

hate
03-23-2005, 08:03 AM
Try this (is tired I mixed up the possition)
if ($bbuserinfo[posts] <= 20)
{
print_no_permission();
}

hollyboy
03-23-2005, 08:06 AM
this one worked, thanks dude :)
Is it possible to get a message for the users who can't access the page?

Something like "To view this page u must have more then xxx posts"

Thanks :)

hate
03-23-2005, 08:27 AM
In your phrase manager add new phrase.

Select Front-End Error Messages

notenoughpostsaddin (rename if you wish but make sure you rename in code)

Put the text you wish it to show

Save It
Now change the code I gave you to this
if ($bbuserinfo[posts] <= 20)
{
eval(print_standard_error('error_notenoughpostsadd in'));
}

hollyboy
03-23-2005, 08:33 AM
works great!
thank u very much

hate
03-23-2005, 08:34 AM
No trouble at all glad it is working right :)