|
#1
|
||||
|
||||
[1.3.4] Pet Lineages
This tutorial is derived from this thread. The goal here is to modify the breeding system to record pet's lineages (parents), allowing users to keep track of breeding history and/or build a pedigree.
I am not going over making it pretty, that part will be up to you! Database Modification First we're going to start off with getting the database ready for this. In the adopts_owned_adoptables table, add three new columns with the following information: classes/class_breeding.php Go into this file and find the line starting like so; PHP Code:
PHP Code:
{home}/breeding.php This is where the bulk of the work is done (aside from making them display all pretty-like). So in public function index find this line: PHP Code:
PHP Code:
Displaying the information Now for the fun part! Wherever you want to display the information (offspring and parents) the code needed will be relatively the same, but it does differ based on whether the file you're editing is a view file or a base file (ex: view/myadoptsview.php vs myadopts.php). In a view file... PHP Code:
PHP Code:
Code; PHP Code:
And that should be it! I know this tutorial isn't very detailed...once you have all of the code it isn't difficult to put it all together...so I hope that it is understandable enough!
__________________
My Mods Site (1.3.4, 2020 Mods) |
#2
|
||||
|
||||
Nice! Thank you :D
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.
|
#3
|
||||
|
||||
Bonus code!
Want to show more generations on a pet's page? Easy! Since we already call the parent in a manner that let's us call their information, we can readily do this; PHP Code:
PHP Code:
(maternal grandmother's mother) PHP Code:
So you can create obnoxiously long pedigrees
__________________
My Mods Site (1.3.4, 2020 Mods) |
#4
|
|||
|
|||
I having some trouble with thev view file, where do i put the <strong>Parents:</strong> {$p1name} and {$p2name} tag? and when i put the code in i get a syntax error
|
#5
|
||||
|
||||
Quote:
PHP Code:
__________________
|
#6
|
|||
|
|||
K thanks, but ive run into another issue, when inputting (if num<0) when i insert the code i get a blank breeding.php page. when i take it out the page is normal, is there something off with the code?
|
#7
|
||||
|
||||
Quote:
PHP Code:
__________________
|
#8
|
|||
|
|||
i think i got it right ....right lol |
#9
|
||||
|
||||
It looks about right...
Do you have error reporting enabled on your host by any chance? It would help pinpoint the problem.
__________________
|
#10
|
|||
|
|||
Okay so, I'm a total noob to coding, could someone give me instructions (for an actual dummy) on where to go to do this?
|
|
|
What's New? |
What's Hot? |
What's Popular? |