Hello All,
This topic is meant for mod writers of the Rusnak PHP Adoptables Script. This topic provides you some resources that will help you create modifications for the new release and will help you start writing mods for the new release before it is released and after it is released.
The first thing I will share with you is the blank file template. This file is a blank slate where you can write your modification code. The file is attached as blank.php below.
Now that you have the blank file template, I will list some functions (with example usage) that are available to you when writing your mod to allow you to interface with the new Rusnak PHP Adoptables Script.
Rusnak PHP Adoptables Script Functions and Example Usage:
Function grabanysetting:
Usage:
Grabs a setting from the database.
Example Code:
Input Parameter: The name of a setting
Result: (stored in $result) - The value of the setting returned, or blank if error.
Function cancp:
Usage:
Determines if a user can access the site's Admin CP.
Example Code:
Input Parameter: The user's current usergroup
Result: (stored in $result) - The string yes is returned if the user can access the Admin CP, otherwise no is returned.
Function getgroup:
Usage:
Determines the usergroup of a user.
Example Code:
Input Parameter: NONE
Result: (stored in $result) - The user's current usergroup, as an integer. If the user is not logged in, 0 is returned.
Function getcurrentimage:
Usage:
Gets the current image of a specified owned adoptable.
Example Code:
Input Parameter: An adoptable's numerical ID.
Result: (stored in $result) - The full URL / filepath to the adoptable's image. If the image or adoptable ID is not found, a default image is used.
Function getcurrentlevel:
Usage:
Gets the current level of an owned adoptable.
Example Code:
Input Parameter: An adoptable's numerical ID.
Result: (stored in $result) - The current numerical level of an adoptable.
Function getnextlevelexists:
Usage:
Determines if a higher level exists for a given adoptable or if it is at max level.
Example Code:
Input Parameters: The type of adoptable and the adoptable's current level..
Result: (stored in $result) - Value true is returned if a higler level exists, otherwise false is returned.
Function convertidtotype:
Usage:
Converts an adoptable's ID to a usable adoptable type, so you can use other functions that require an adoptable type.
Example Code:
Input Parameters: The adoptable's numerical id.
Result: (stored in $result) - The type of adoptable.
I will post more modding information later as we get closer to a release. Mod writers can get started now on writing mods for this new release.
Posted in the next post is some SQL for the tables and database.
This topic is meant for mod writers of the Rusnak PHP Adoptables Script. This topic provides you some resources that will help you create modifications for the new release and will help you start writing mods for the new release before it is released and after it is released.
The first thing I will share with you is the blank file template. This file is a blank slate where you can write your modification code. The file is attached as blank.php below.
Now that you have the blank file template, I will list some functions (with example usage) that are available to you when writing your mod to allow you to interface with the new Rusnak PHP Adoptables Script.
Rusnak PHP Adoptables Script Functions and Example Usage:
Function grabanysetting:
Usage:
Grabs a setting from the database.
Example Code:
PHP:
$result = grabanysetting("settingname");
Input Parameter: The name of a setting
Result: (stored in $result) - The value of the setting returned, or blank if error.
Function cancp:
Usage:
Determines if a user can access the site's Admin CP.
Example Code:
PHP:
$result = cancp($usergroup);
Input Parameter: The user's current usergroup
Result: (stored in $result) - The string yes is returned if the user can access the Admin CP, otherwise no is returned.
Function getgroup:
Usage:
Determines the usergroup of a user.
Example Code:
PHP:
$result = getgroup();
Input Parameter: NONE
Result: (stored in $result) - The user's current usergroup, as an integer. If the user is not logged in, 0 is returned.
Function getcurrentimage:
Usage:
Gets the current image of a specified owned adoptable.
Example Code:
PHP:
$result = getcurrentimage($id);
Input Parameter: An adoptable's numerical ID.
Result: (stored in $result) - The full URL / filepath to the adoptable's image. If the image or adoptable ID is not found, a default image is used.
Function getcurrentlevel:
Usage:
Gets the current level of an owned adoptable.
Example Code:
PHP:
$result = getcurrentlevel($id);
Input Parameter: An adoptable's numerical ID.
Result: (stored in $result) - The current numerical level of an adoptable.
Function getnextlevelexists:
Usage:
Determines if a higher level exists for a given adoptable or if it is at max level.
Example Code:
PHP:
$result = getnextlevelexists($type, $currentlevel);
Input Parameters: The type of adoptable and the adoptable's current level..
Result: (stored in $result) - Value true is returned if a higler level exists, otherwise false is returned.
Function convertidtotype:
Usage:
Converts an adoptable's ID to a usable adoptable type, so you can use other functions that require an adoptable type.
Example Code:
PHP:
$result = convertidtotype($id);
Input Parameters: The adoptable's numerical id.
Result: (stored in $result) - The type of adoptable.
I will post more modding information later as we get closer to a release. Mod writers can get started now on writing mods for this new release.
Posted in the next post is some SQL for the tables and database.