bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use the paid() function
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Tue May 14, 2013 15:45    Post subject: How to use the paid() function Reply with quote

If you are using the subscription module then you know this tutorial is for you. It will show you how to use the paid() function to hide parts of your page from non subscribers. You can also use it to hide links, images just about anything.

The first thing is to understand how the function works. The following is a full view of the codes.

Code:
if(paid()) {//Show the link, image or other content to subscribers


echo "You are a subscribers";

}else{//Non subscribers will see the following

echo "You are not a subscriber";

}
    


Basically what you are doing is checking to see if the member is a subscriber, they get the "goodies", if not then they get nothing. Let's put this to better use. In the example below we have a link we want hidden from non subscribers. We first check if the member is a subscriber using the paid() function already defined in the mainfile.php


Code:
if(paid()){


If the member is a subscriber we want them to see the link so we show it in following codes.

Code:
if(paid()){ //Check if the member is a subscriber


echo '<a>BestBuildPC</a>'; //Link is shown to subscriber.

     }// close the "if" statement


Done! You may ask, why didn't I use the else{ part as in the first example. Well you only need the else{ if you want to show something to non subscibers like in the following codes

Code:
if(paid()){ //Check if the member is a subscriber


echo '<a>BB</a>'; //Link is shown to subscriber.

     }// close the "if" statement
    
     else{ //show something to non subscribers
    
echo 'You cannot see this because you are a non subscriber'; //This shown to non subscribers

}// Close the "else" statement


This should give you a better idea of how to use this important function. You can use it to protect anything on your website.
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©