vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   minimum posts to view *.php (https://vborg.vbsupport.ru/showthread.php?t=33361)

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)

PHP Code:

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



cyrus 12-23-2001 10:37 PM

ok, this is my sms file

PHP Code:

<? 
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:

PHP Code:

<? 
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

$bbus[high]er[/high]info['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 !!!


All times are GMT. The time now is 08: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.00967 seconds
  • Memory Usage 1,727KB
  • 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
  • (3)bbcode_php_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