![]() |
|
#1
|
||||
|
||||
|
This tutorial allows you to add biographies to your adopts. Let me know if you get any errors since I worked on this on and off and I might have forgotten to include a line of code somewhere.
Setup This is the stuff you need to do in phpMyAdmin before you go edit anything else. I'm sure this tutorial won't work otherwise. Find adopts_owned_adoptables and add 1 column under the structure tab with this info: You can change the length to whatever you want the max number of characters allowed in an adoptable's bio to be. I put 500 since that seems reasonable. Foundation Now for the bulk of this tutorial: Editing. This part is for getting the under-the-hood stuff for the bio working so it actually saves after you type it. Let's work from the outside in. Step 1 Go to myadopts.php and add this to it: PHP Code:
Step 2 Go to classes>class_ownedadoptable.php and add this with all the other protected and public stuff (All that yellow stuff between "class OwnedAdoptable" and "public function_construct") PHP Code:
PHP Code:
Go to lang>lang_myadopts.php and add these lines: PHP Code:
We're halfway there, wow! This part is for adding the text areas, buttons, and links that will allow users to actually add bios to their adoptables; as well as displaying it on the adoptable's profile. Step 1 Go to view>myadoptsview. After we're done, you can use the following line to display the bio wherever you want on a pet's profile. You can go ahead and add it now if you want so you can see it right after we finish. PHP Code:
PHP Code:
Add this code with all the other functions. You can put it towards the bottom to keep things organized: PHP Code:
. This huge chunk basically works like the rename function and takes the user to a page that lets them edit the bio.Step 3 Done? Good, now just scroll back up and add this with all the other links on your adoptable's profile. (Along with rename, trade status, freeze, etc.) PHP Code:
Aaand...you're done! To test this, go to your pet's profile and click on the new link we added. This should take you to a screen where you can type in whatever you want for the bio. Once you hit the "Change Bio" button, it takes you back to the profile with your pet's new and shiny biography. Last edited by Dinocanid; 12-23-2016 at 06:09 PM. |
| Thread Tools | |
| Display Modes | |
|
|
What's New? |
What's Hot? |
What's Popular? |