Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2015, 12:40 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 839
Gender: Female
Credits: 33,897
Kyttias is on a distinguished road
Send a message via AIM to Kyttias
Arrow Display Pet's Birthday / Original Owner

This mod could also be used for other things. The basic concept is that you have some bit of information you need associated with a pet but that bit of information needs to be attached to them when they are born or otherwise created by the system.

Database
Open up phpMyAdmin so you have access to your database, and open up the owned_adoptables table. We're going to create two new columns.

You can add these columns by pressing Structure and, at the bottom of that page, observing where you can type in '2' to add 2 columns at the end of the table, and pressing 'Go'.

Both will be stored as the VARCHAR type, originalowner with a length of 20, birthday with a length of 30. I recommend you fill birthday with a default value formatted such as "April 20th, 2015" and all existing pets will have this date set as their birthday. You can do the similar with originalowner, but if it's more fitting for your needs, leave it blank.

Alternatively, you can instead use the following query by opening the SQL tab instead of the Structure tab:
Code:
ALTER TABLE adopts_owned_adoptables ADD `originalowner` varchar(20) NOT NULL  DEFAULT '',
ALTER TABLE adopts_owned_adoptables ADD `birthday` varchar(20) NOT NULL  DEFAULT 'April 20th, 2015'
If your default prefix for your database is not adopts_, you'll need to edit the code above first!
Pet Creation Areas
Pets can be created through five different means so code needs to be changed in each place. In classes/class_stockadopt.php pets are created for adoptable shops, in classes/class_promocode.php, pets are created from user entered promo-codes, in classes/class_breeding, pets are created via two pets being bred together to make offspring, in adopt.php the pets are created from a list of always available pets for free, and finally, in admincp/ownedadopt.php you can, as admin, give new pets directly to members. Open all of these files up and look for this, it only happens once in each of these five files (be sure not to miss a single file):

PHP Code:
$mysidia->db->insert("owned_adoptables", array( 
Make sure that it does say insert, not update. We're only looking to make additions to the insert function. Observe this line and try to wrap your head around what's going on -- that's right, these correspond directly with the column names in the database.

Alright, anywhere in these lines, I prefer at the end, we're going to add references to our new database columns and what we want to be in these fields.

PHP Code:
"originalowner" => $mysidia->user->username"birthday" => date("F jS, Y"
Psst, an example of how the birthday field will display itself is "April 20th, 2015". If you'd like to store data differently, look into how PHP formats dates.
Displaying Information
Unfortunately, the method I'm using on my own site is kind of hack-y and simply rewrites the error page announcing "you've already clicked this pet today". This isn't the most desirable nor elegant approach. So this is not a guide to making profile pages for your pets as I have done on my own site.

However, sticking with the original framework, pet stats can be found from a pet's management page where only the current owner can find this information. If you open up classes/class_ownedadoptable.php and find public function getStats() you'll be able to add information in this location, for example, by modifying the $adoptStats variable to include references to $this->originalowner and $this->birthday which each correspond to the values found in the columns we added to the database:

PHP Code:
$adoptStats "<br>Original Owner: {$this->originalowner}<br>Birthday: {$this->birthday}<br>Trade Status: {$this->tradestatus}<br> Current Level: {$this->currentlevel}<br>Next Level: {$nextLevel}</b>"
This mod is very similar to Wallie's Pet Stats/Skills mod which is the same basic concept - adding columns to the database to hold new pet information, making sure this information is created when the pets are created, and displaying it. Wallie's thread attempts to go into detail about displaying pet information in other ways, and I based my own pet profile pages after what I learned there, so it may or may not be of help - it depends on how well you can wrap your head around code. However, Wallie's version is specific to v1.3.3, and some things have changed slightly.
Reply With Quote
  #2  
Old 11-19-2015, 12:07 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 992
Gender: Male
Credits: 38,066
Abronsyth is on a distinguished road
Default

(Super late reply but oh well)

This is splendid! Thank you for sharing :) I really appreciate the little tips and clues you include in all of your mod posts, as well!

(Now to figure out how to give pets public profiles, haha!)
__________________
Reply With Quote
  #3  
Old 01-15-2017, 10:03 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,090
Gender: Female
Credits: 24,453
SilverDragonTears is on a distinguished road
Default

It's giving my adopts a birthday a day ahead of what it really is. Suggestions?
__________________
Reply With Quote
  #4  
Old 01-16-2017, 07:51 AM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 203
Gender: Male
Credits: 6,743
Silver_Brick is on a distinguished road
Default

did you added the Database correctly i am sure the mistake is in database because i was also getting same problem but it is solved now by just re doing the things
Reply With Quote
  #5  
Old 01-16-2017, 09:46 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,090
Gender: Female
Credits: 24,453
SilverDragonTears is on a distinguished road
Default

Quote:
Originally Posted by Silver_Brick View Post
did you added the Database correctly i am sure the mistake is in database because i was also getting same problem but it is solved now by just re doing the things
I did that as well and it's still not working.
__________________
Reply With Quote
  #6  
Old 01-16-2017, 10:06 AM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 203
Gender: Male
Credits: 6,743
Silver_Brick is on a distinguished road
Default

then i think its your website timing problem and i think it is using your computer time or any think maybe you can search the forum and find the thread by kyttias where they posted about website timing maybe it will help :)
Reply With Quote
  #7  
Old 01-16-2017, 10:28 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,090
Gender: Female
Credits: 24,453
SilverDragonTears is on a distinguished road
Default

Thank you :) I will do that.
__________________
Reply With Quote
  #8  
Old 03-03-2017, 06:14 PM
KrinklyKrisps KrinklyKrisps is offline
The Bit Ranch Leader
 
Join Date: Mar 2017
Posts: 6
Gender: Male
Credits: 177
KrinklyKrisps is on a distinguished road
Default

so cool dude
__________________
| AwesomeAdopt Thread | some random text | sample text | Dinocanid is my HERO
Reply With Quote
Reply

Tags
birthday, original owner

Thread Tools
Display Modes

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
PokePets mods! NEW Orginal Owner mod! PokePets Mys v1.1.x Mods 34 04-20-2015 01:13 AM
A newbie with a new question, how original! Gelliebeen Newcomer Center 12 04-29-2013 09:27 AM
Original Fiction Tequila Fanfics and Free Writing 8 04-13-2013 01:56 PM
Birthday!!! (you'll never guess who!) PTGigi Other Chat 9 02-11-2011 07:56 PM
Show off your Original Characters! Tequila Art Gallery 6 01-22-2011 01:14 AM


All times are GMT -5. The time now is 07:12 AM.

Currently Active Users: 221 (1 members and 220 guests)
Threads: 3,924, Posts: 31,294, Members: 15,474
Welcome to our newest members, gdysmths01.
BER





What's New?

What's Hot?

What's Popular?


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