Addon licensed

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
Line 15: Line 15:
  
 
'''Example 1 - Calling addon_licensed()'''
 
'''Example 1 - Calling addon_licensed()'''
You don't have to put it in a specific file. You can stick this code in any php file included with your template (i.e. includethis.php, pgm-auto_menu.php, license_check.php -- wherever).   
+
You can stick this code in any php file included with your template (i.e. includethis.php, pgm-auto_menu.php, license_check.php -- wherever).   
 
<pre>
 
<pre>
 
if ( !addon_licensed("SPORTS-Snowboarder-blue") ) {
 
if ( !addon_licensed("SPORTS-Snowboarder-blue") ) {

Revision as of 12:57, 2 June 2006

Syntax
addon_licensed(addon_folder_name)


What it does
Checks whether domain is licensed to use specified addon (identified by name addon folder)
Returns true/false based on whether addon is/is not licensed
Description
The purpose of this function is to provide a way for premium addon developers to build license checking into their addon. For plugins, it's not incredibly important that you include a call to this function, because it is called by Pro Edition when plugin is initially installed (will not allow install to proceed if license check fails), but you're still welcome to use it as a double-check/extra layer of anti-piracy. For premium templates however there is no built-in license checking at install time, so it's highly advised that you place a call to this function somewhere in one of your template includes (even if that means creating a template include specifically for the license check).
Scope
This function is defined in shared_functions.php, you can call it from anywhere.


Example 1 - Calling addon_licensed() You can stick this code in any php file included with your template (i.e. includethis.php, pgm-auto_menu.php, license_check.php -- wherever).

if ( !addon_licensed("SPORTS-Snowboarder-blue") ) {
   echo "This template is not licensed!"; exit;
}
Personal tools