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":
below all the public functions, add:
In levelup.php:
inside of the click function, below
add:
below:
add:
In functions_items.php:
below all the functions, add:
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!
_______________________________________________________
These are the edits for the files:
In class_ownedadoptable.php, add below the list of "protected stuff":
PHP:
protected $background;
PHP:
public function getAdoptBackground(){
return $this->background;
}
In levelup.php:
inside of the click function, below
PHP:
$mysidia = Registry::get("mysidia");
$document = $mysidia->frame->getDocument();
$date = new DateTime;
$ip = secure($_SERVER['REMOTE_ADDR']);
PHP:
$background = $this->adopt->getAdoptBackground();
PHP:
$mysidia = Registry::get("mysidia");
$document = $mysidia->frame->getDocument();
$date = new DateTime;
$ip = secure($_SERVER['REMOTE_ADDR']);
$background = $this->adopt->getAdoptBackground();
PHP:
$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:
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: