Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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: (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: (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: (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: (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: (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: (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: (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. :) |
#2
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
SQL Tables:
This post contains information about some key SQL tables that the script uses. Settings Table Structure and Contents: Code:
CREATE TABLE adopts_settings (name varchar(20), value varchar(350)); INSERT INTO adopts_settings (name, value) VALUES ('themeurl', 'templates/default/template.html'); INSERT INTO adopts_settings (name, value) VALUES ('browsertitle', 'This is the site title as pulled from the DB'); INSERT INTO adopts_settings (name, value) VALUES ('sitename', 'Your site name goes here.'); INSERT INTO adopts_settings (name, value) VALUES ('admincontact', 'admin@email.com'); INSERT INTO adopts_settings (name, value) VALUES ('slogan', 'Test Slogan'); INSERT INTO adopts_settings (name, value) VALUES ('gdimages', 'yes'); INSERT INTO adopts_settings (name, value) VALUES ('usealtbbcode', 'yes'); INSERT INTO adopts_settings (name, value) VALUES ('systememail', 'admin@email.com'); Code:
CREATE TABLE adopts_users (uid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, username varchar(20) UNIQUE, password varchar(100), email varchar(60), usergroup INT, newmessagenotify varchar(10), membersince varchar(20), isbanned INT, website varchar(80), profilepic varchar(80), aim varchar(80), yahoo varchar(80), msn varchar(80)); Code:
CREATE TABLE adopts_groups (gid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, groupname varchar(20) UNIQUE, canadopt varchar(10), canpm varchar(10), cancp varchar(10), canmanageadopts varchar(10), canmanagecontent varchar(10), canmanageads varchar(10), canmanagesettings varchar(10), canmanageusers varchar(10)); INSERT INTO adopts_groups VALUES ('', 'rootadmins', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'); INSERT INTO adopts_groups VALUES ('', 'admins', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'); INSERT INTO adopts_groups VALUES ('', 'registered', 'yes', 'yes', 'no', 'no', 'no', 'no', 'no', 'no'); INSERT INTO adopts_groups VALUES ('', 'artists', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'no'); Code:
CREATE TABLE adopts_adoptables (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, type varchar(40), description varchar(300), eggimage varchar(120), whenisavail varchar(50), promocode varchar(50), freqcond varchar(50), number INT, datecond varchar(50), date varchar(20), adoptscond varchar(20), moreless varchar(20), morelessnum INT, levelgrle varchar(25), grlelevel INT, alternates varchar(10), altoutlevel INT, altchance INT); Code:
CREATE TABLE adopts_owned_adoptables (aid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, type varchar(40), name varchar(40), owner varchar(40), currentlevel INT, totalclicks INT, code INT, imageurl varchar(120), usealternates varchar(10), tradestatus varchar(15), isfrozen varchar(10)); Code:
CREATE TABLE adopts_levels (adoptiename varchar(50), thisislevel INT, requiredclicks INT, primaryimage varchar(120), alternateimage varchar(120), rewarduser varchar(10), promocode varchar(25)); |
#3
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
Awesome, Thanks. XD
|
#4
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
Well, thank you.
I'm sorry to ask so many questions, but how do I change the URL of the "Blank" site? Do I change the name of the document? Or do I change something inside of these " "? |
#5
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
You would change blank.php to the filename where you want your mod to appear, such as www.yoursite.com/adoptables/yourmod.php or something like that. :)
The above file is just meant to be a template file for you to use. :) |
#6
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
Ah, OK. Thank you. Will this work for the new release?
|
#7
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
Yeah, that's what this file is for, the new release. :)
This is just a blank file from the new release where you can write your code. It takes care of all of the required parts of the script, such as checking if the user is logged in, working with the template system, etc. :) |
#8
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
This is my last question ( I hope). Where do I write? On any specific spot or anything?
|
#9
|
|||
|
|||
RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script
You can write your code anywhere you need to on the file, however most of the time you can start after:
PHP Code:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dechiphering the Adoptables Script | Ansem717 | Questions and Supports | 1 | 01-15-2011 07:58 PM |
Adoptables Script + MyBB | Blues | Questions and Supports | 3 | 08-05-2009 07:24 PM |
What can be done with the PHP Adoptables Script! | Seapyramid | Suggestions and Feature Requests | 11 | 07-19-2009 12:16 PM |
Can you put a flash template with a easy adoptable script? | Tezna | Questions and Supports | 2 | 05-26-2009 08:28 PM |
Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY] | Ashje | Addons/Mods Graveyard | 2 | 05-24-2009 04:17 AM |
What's New? |
What's Hot? |
What's Popular? |