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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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,943
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
 


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 03:19 PM.

Currently Active Users: 9531 (0 members and 9531 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