Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2009, 02:06 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 13,536
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
  #2  
Old 04-10-2009, 02:15 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 13,536
BMR777 is on a distinguished road
Default 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');
Users Table Structure and Contents:

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));
Groups Table Structure and Contents:

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');
Adoptables Table Structure and Contents:

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);
Owned Adoptables Table Structure and Contents:

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));
Adoptables Levels Table Structure and Contents:

Code:
CREATE TABLE adopts_levels (adoptiename varchar(50), thisislevel INT, requiredclicks INT, primaryimage varchar(120), alternateimage varchar(120), rewarduser varchar(10), promocode varchar(25));
Having the database table structure will help you create modifications for the Rusnak PHP Adoptables Script. :)
Reply With Quote
  #3  
Old 04-10-2009, 09:00 PM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 12,618
Ashje
Default RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script

Awesome, Thanks. XD
Reply With Quote
  #4  
Old 04-16-2009, 10:42 AM
trollis76 trollis76 is offline
Member
 
Join Date: Feb 2009
Posts: 160
Credits: 15,298
trollis76
Default 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 " "?
Reply With Quote
  #5  
Old 04-16-2009, 02:40 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 13,536
BMR777 is on a distinguished road
Default 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. :)
Reply With Quote
  #6  
Old 04-17-2009, 01:03 AM
trollis76 trollis76 is offline
Member
 
Join Date: Feb 2009
Posts: 160
Credits: 15,298
trollis76
Default RE: Mod Template - Information for Mod Creators of the Rusnak PHP Adoptables Script

Ah, OK. Thank you. Will this work for the new release?
Reply With Quote
  #7  
Old 04-17-2009, 10:30 AM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 13,536
BMR777 is on a distinguished road
Default 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. :)
Reply With Quote
  #8  
Old 04-17-2009, 10:52 AM
trollis76 trollis76 is offline
Member
 
Join Date: Feb 2009
Posts: 160
Credits: 15,298
trollis76
Default 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?
Reply With Quote
  #9  
Old 04-17-2009, 10:55 AM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 13,536
BMR777 is on a distinguished road
Default 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:
// ************************************
// End Prepwork - Output the page to the user
// **************************************** 
:)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -5. The time now is 10:27 PM.

Currently Active Users: 584 (0 members and 584 guests)
Threads: 4,081, Posts: 32,031, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636