Background Mod
This is a simple background mod for displaying backgrounds on adoptable pages. Please save a backup of your entire site before using this mod as I can't guarantee it will work - my own site uses this system but it's heavily moddified and the coding is likely quite different for these pages. I apologize if anything breaks because of this or if the instructions are too confusing.
__________________________________________________ _____ These are the edits for the files: In class_ownedadoptable.php, add below the list of "protected stuff": PHP Code:
PHP Code:
inside of the click function, below PHP Code:
PHP Code:
PHP Code:
PHP Code:
below all the functions, add: PHP Code:
__________________________________________________ ______ Now, let's edit the database In the items_functions table, create a new row - put "Background" in the function column and "Adoptable" in the intent column. Put a description in the description column. Now, in the items table, add a column of varchar(200) latin_swedish_ci with a default value of NULL called "backgroundimage" __________________________________________________ ______ Now, let's make your first background create a new row in the items table as a new item. Name your background, set the price, stock, etc. Except. in the function column, put "Background" and in the "backgroundimage" column, put the name of the file you want to serve as the background (just the alphanumeric name). Do not include the path to the folder or the .png! __________________________________________________ ______ That should be it! |
Nice use of $mysidia->path->getAbsolute()!
|
oh I woke up to this and it made my whole day :)
Thank you and Kyttias both for all your help trying to get this going, yay, a MOD for it!! *dances* |
Does anyone know if this works? I can't test on my testing site because nothing works on it right now. As for my main site, I can't tell from the code.
|
Followed it all to the letter and for 1.3.4 everything loads fine, but when I go to use the BG I am getting:
An error has occurred. The item function is invalid However! I think its because its 1.3.4! Going to try this on 1.3.3 now! I am sure its going to work there, no idea why it isn't working for 1.3.4, I looked everything over and didn't see what could possibly be wrong --- however not everything for 3 will work for 4. If anyone else wants to take a look and see why it might not work for 1.3.4? This is a REALLY good and important Mod, be great to have for the new script! |
Quote:
|
I was able to implement adding in items that are shown under the Pet image a long time ago in 1.3.4, and I compared that item function to this one, and I swear I don't see whats missing or wrong! xD
There's likely just ONE thing I am missing somewhere. Now I'm setting up a 1.3.3 site to test this, and getting all the Strict Standards and headers already sent stuff Code:
Strict Standards: Declaration of File::getBasename() should be compatible with SplFileInfo::getBasename($suffix = NULL) in /home/petsim/public_html/Etheria/classes/class_file.php on line 19 Plus it wont let me stay logged in lol!! So I will test this on 1.3 but its gonna take a bit! Gotta work this out cos there are a lot of mods for 1.3.3 I really want to use, so .. I just need to get this going. |
Okay I had forgotten for 1.3.4 we go to class_privateitem and add:
Code:
SO! Action Completed! Your Pet now has a new background! I was able to add it and it gave me a success, but it isn't showing up yet for this pet --- so gonna see what else I need to do! This is for 1.3.4 ! |
Okay this might help someone sharper than me --
this is 1.3.4, it says the item is applied and congrats new BG etc, and the amount IS going down in my stock! But no BG shows up on the profile in my adopts, and not in levelup either, until you try to level a SECOND time --- and you get this -- this is the top third of the background image repeated three times! http://pet-sim.com/Canidae/Error.png |
I only have part of a background mod... the BG only shows up on the click page... for now. The problem is the adoptable images for signatures. In order to have backgrounds in those pictures, you need a system that saves a new image - each adopt needs to have its own individual image. I know this is possible ... I just don't know how to code this. Also, there may be a problem with this for sites with tons of pets. That's a lot of images to have to store.
|
All times are GMT -5. The time now is 03:36 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.