View Single Post
  #1  
Old 04-10-2009, 01:06 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,712
BMR777 is on a distinguished road
Default Mod Template - Information for Mod Creators of the Adoptables Script

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:

PHP Code:
$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 Code:
$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 Code:
$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 Code:
$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 Code:
$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 Code:
$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 Code:
$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. :)
Reply With Quote