PDA

View Full Version : minimum posts to view *.php


cyrus
12-19-2001, 04:17 PM
I have a php file ( called " sms.php" ) which I have made so ONLY registered members can view.

But I want to make it so that only CERTAIN people who have over 20 posts in the forum can view it ... this is probably easy to do :stupid: but how can it be done ?

Thank you

Konqueror
12-20-2001, 10:16 AM
If your script includes global.php then this should do it:
(the "require("./global.php");" must be somewhere before this)


if ($bbuserinfo['posts'] > '20') {
#### Your program here ####
} else {
echo "No permission";
}

cyrus
12-23-2001, 10:37 PM
ok, this is my sms file

<?
require( "global.php" );

if( $bbuserid ) {

$user = $DB_site->query_first( "SELECT username
FROM user
WHERE userid = $bbuserid" );
$bbusername = $user[ username ];
eval("dooutput(\"".gettemplate('sms')."\");");
} else {
eval("dooutput(\"".show_nopermission()."\");");
} // end if
?>

what will I need to do to make people with ONLY 20 posts or over able to view it , or theyre are denied access ??

thanks again !

bira
12-23-2001, 10:42 PM
This:


<?
require( "global.php" );

if( $bbusinfo['posts'] > 20 ) {

$user = $DB_site->query_first( "SELECT username
FROM user
WHERE userid = $bbuserid" );
$bbusername = $user[ username ];
eval("dooutput(\"".gettemplate('sms')."\");");

} else {

show_nopermission();

} // end if
?>

cyrus
12-23-2001, 10:49 PM
its times like these i feel like WORSHIPPING u people ! :D

Ok, it works fine ... but can I make it so the errors msg displayed of why the user cant login is " You need to make 20 posts before you can send sms's !!!"

??

Thanks again !!!!! :p

cyrus
12-23-2001, 10:55 PM
small problem

People who havent got 20 posts cant log in , thats fine

but me , who has over 500 cant log in to sms either lol :eek:

somethings wrong with that code ... anyone know what ? :(

bira
12-23-2001, 11:02 PM
my typo.

$bbusinfo['posts']

should be

$bbuserinfo['posts']

:D

bira
12-23-2001, 11:05 PM
[QUOTE]Originally posted by cyrus
its times like these i feel like WORSHIPPING u people ! :D

Ok, it works fine ... but can I make it so the errors msg displayed of why the user cant login is " You need to make 20 posts before you can send sms's !!!"

??

Thanks again !!!!! :p

cyrus
12-23-2001, 11:26 PM
Another WOW

ur truely wicked at this stuff ... THANKS BIRA !!!