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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2015, 09:58 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,158
Hwona is on a distinguished road
Default 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:
protected $background
below all the public functions, add:
PHP Code:
public function getAdoptBackground(){
        return 
$this->background;
    } 
In levelup.php:
inside of the click function, below
PHP Code:
 $mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();        
        
$date = new DateTime;
        
$ip secure($_SERVER['REMOTE_ADDR']); 
add:
PHP Code:
$background $this->adopt->getAdoptBackground(); 
below:
PHP Code:
 $mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();        
        
$date = new DateTime;
        
$ip secure($_SERVER['REMOTE_ADDR']);
$background $this->adopt->getAdoptBackground(); 
add:
PHP Code:
$message "<div><div style='text-align:center;background-image:url({$mysidia->path->getAbsolute()}picuploads/backgrounds/{$background}.png);'><br><img src='{$mysidia->path->getAbsolute()}levelup/siggy/{$this->adopt->getAdoptID()}'></div>"
In functions_items.php:
below all the functions, add:
PHP Code:
 function items_background($item$adopt){
  
$mysidia Registry::get("mysidia");
  
// Update the lastbred info.
  
$background $item->backgroundimage;
  
$mysidia->db->update("owned_adoptables", array("background" => $background), "aid ='{$adopt->aid}' and owner='{$item->owner}'");    
  
$note "Your adoptable now has a new background!<br>";
  
//Update item quantity...
  
$delitem $item->remove();   
  return 
$note;

In the picuploads folder, make a new folder called "backgrounds" and fill it with all your different background image files. They must all be png files!!! Give each file an alpha numeric name with NO SPACES!
__________________________________________________ ______

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!
__________________

Last edited by Hwona; 04-15-2015 at 10:21 AM.
Reply With Quote
  #2  
Old 04-15-2015, 10:41 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,951
Kyttias is on a distinguished road
Default

Nice use of $mysidia->path->getAbsolute()!
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #3  
Old 04-15-2015, 12:11 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,512
Missy Master is an unknown quantity at this point
Default

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*
Reply With Quote
  #4  
Old 04-15-2015, 04:46 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,158
Hwona is on a distinguished road
Default

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.
__________________
Reply With Quote
  #5  
Old 04-15-2015, 05:03 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,512
Missy Master is an unknown quantity at this point
Default

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!
Reply With Quote
  #6  
Old 04-15-2015, 05:10 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,158
Hwona is on a distinguished road
Default

Quote:
Originally Posted by Annatar View Post
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!
I remember trying to help Kyttias implement the stat system on 1.3.4... that script displays everything using 2 files I think... I never was able to figure it out. XD
__________________
Reply With Quote
  #7  
Old 04-15-2015, 05:34 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,512
Missy Master is an unknown quantity at this point
Default

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

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/petsim/public_html/Etheria/classes/class_file.php:19) in /home/petsim/public_html/Etheria/classes/class_session.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at /home/petsim/public_html/Etheria/classes/class_file.php:19) in /home/petsim/public_html/Etheria/classes/abstract/abstract_usercreator.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/petsim/public_html/Etheria/classes/class_file.php:19) in /home/petsim/public_html/Etheria/classes/abstract/abstract_usercreator.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /home/petsim/public_html/Etheria/classes/class_file.php:19) in /home/petsim/public_html/Etheria/classes/abstract/abstract_usercreator.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/petsim/public_html/Etheria/classes/class_file.php:19) in /home/petsim/public_html/Etheria/classes/abstract/abstract_usercreator.php on line 25

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.
Reply With Quote
  #8  
Old 04-15-2015, 05:53 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,512
Missy Master is an unknown quantity at this point
Default

Okay I had forgotten for 1.3.4 we go to class_privateitem and add:

Code:
 
case "Background":
$message = items_background($this, $owned_adoptable);
break;

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 !
Reply With Quote
  #9  
Old 04-15-2015, 06:45 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,512
Missy Master is an unknown quantity at this point
Default

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!



Reply With Quote
  #10  
Old 04-16-2015, 07:51 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,158
Hwona is on a distinguished road
Default

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.
__________________
Reply With Quote
Reply

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
The disappearing background O.o SilverDragonTears Questions and Supports 7 03-31-2012 10:22 PM
Theme background help PokePets Questions and Supports 2 11-04-2011 02:29 PM
how to change background of siggy? vexel Questions and Supports 7 09-29-2010 10:54 AM
Transparent Background Problem [Answered] gjac1 Questions and Supports 4 12-10-2009 04:35 AM


All times are GMT -5. The time now is 08:34 AM.

Currently Active Users: 441 (0 members and 441 guests)
Threads: 4,080, Posts: 32,024, 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