![]() |
Home Community Mys-Script Creative Off-Topic |
|
![]() |
|
Thread Tools | Display Modes |
#11
|
||||
|
||||
![]()
By default, on pages like /myadopts, the framework calls up a pet's image with the function $adopt->getImage("gui"), where $adopt is, of course, $adopt = new OwnedAdoptable($aid), and the $aid is being obtained by looping through the objects made by the database query statement. All of these pages are calling the getImage() function from inside the OwnedAdoptable class. I'd open up classes/class_ownedadoptable.php and search for public function getImage and perhaps modify things there.
BUT, you've made changes to the default process. I'm not sure what changes you've made, but perhaps create a new function to call every time getImage() was, sitewide, in its place, that would better suit your needs. Or change the contents of getImage() or modify whatever function you're already currently using. I can, however, tell you that in classes/class_ownedadoptable.php, you can acquire things from the current pet's table in the database by simply going $this->columnname. I added all the new columns as variables to the top of this file, too, for good measure, alongside the existing one. So if you made a column to hold the pet's background image, perhaps it would be $this->bg. If you had a folder somewhere you were storing all the background images, I'd store just the filename, without even so much as the extension, and not the location. If you're storing the pet's image inside $this->imageurl, then maybe something like this: PHP Code:
Code:
.layer { position:absolute; left:0; top:0; } .petcontainer { position:relative; } If you want images different for each pet (for example, with items), I'd suggest storing them in a folder structure based on $this->type, so long as everything sharing a species type shares the same body structure. Perhaps you can think of another variable to base this off of, if it better suits what you're doing. Hopefully this pointed you somewhere in the right direction, even if its not how you'll do things in the end.
__________________
Please do not contact me. I cannot offer tech support on any coding I've done prior to 2018.
Last edited by Kyttias; 04-14-2015 at 11:15 PM. |
#12
|
||||
|
||||
![]()
Wow thank you so much!! <3
I will give this a shot and see if I can do it right, looks like you really gave a good way to make this happen! Thank you for posting this! :) *Crosses fingers * |
#13
|
||||
|
||||
![]()
I made an extra column for owned adoptables in the database for 'bg' and --I have this now in class_ownedadoptable:
Code:
public function getLayers(){ if ( $this->bg ){ $bg = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->bg.".png'>"; } if ( $this->item1 ){ $item1 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item1.".png'>"; } if ( $this->item2 ){ $item2 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item2.".png'>"; } if ( $this->item3 ){ $item3 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item3.".png'>"; } if ( $this->item4 ){ $item4 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item4.".png'>"; } if ( $this->item5 ){ $item5 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item5.".png'>"; } $layers = "<div class='petcontainer'> ".$bg." <img class='layer' src='http://pet-sim.com/Canidae/bgimages".$this->imageurl.".png'> ".$item1.$item2.$item3.$item4.$item5." </div>"; return $layers; } Also, where do I put the little snippet of css for the layering to show? Sorry to be so much trouble :( |
#14
|
||||
|
||||
![]()
The code looks fine to me. For the images for your items, just link them all up to the same items folder, and then you can keep your items separate from your background images.
You should be putting the css with the rest of the css for your theme. If you don't have it, the images will show up side by side. getLayers() is just an example function name, of course. You need to call this function everywhere you want the pet image to show. How are you currently making your pet images appear? I explained how it was done by default, but again, you've made changes to the default framework, so it's difficult to instruct you on how to proceed.
__________________
Please do not contact me. I cannot offer tech support on any coding I've done prior to 2018.
|
#15
|
||||
|
||||
![]()
I'm using your gorgeous Bootstrap theme, and I'm not sure where to insert the code snippet to show the background and pet--- I see several css files in the theme folder.
All I really want is a working background system, and if it can be modded to insert toys as well that would be great. I'm really hoping to get this going! Last edited by Missy Master; 04-16-2015 at 01:13 AM. |
#16
|
||||
|
||||
![]()
Okay I have this in class_ownedadoptables and in myadopts too :
Code:
public function getLayers(){ if ( $this->background){ $background= "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->background.".png'>"; } if ( $this->item1 ){ $item1 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item1.".png'>"; } if ( $this->item2 ){ $item2 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item2.".png'>"; } if ( $this->item3 ){ $item3 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item3.".png'>"; } if ( $this->item4 ){ $item4 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item4.".png'>"; } if ( $this->item5 ){ $item5 = "<img class='layer' src='http://pet-sim.com/Canidae/bgimages/".$this->item5.".png'>"; } $layers = "<div class='petcontainer'> ".$background." <img class='layer' src='http://pet-sim.com/Canidae/".$this->imageurl.".png'> ".$item1.$item2.$item3.$item4.$item5." </div>"; return $layers; } Nothing is showing still on the profile .. I'm guessing because I dont have the css snippet in yet, but even so, it should be showing side by side. The pet image is in imageurl in the database in owned adopts. The full URL ... The background image is in background, in the owned adopts table ... just the file name. Not sure what I am doing wrong still! I am not good with this coding sorry :( |
#17
|
||||
|
||||
![]()
Could you show me where you are calling the function on your profile?
__________________
Please do not contact me. I cannot offer tech support on any coding I've done prior to 2018.
|
#18
|
||||
|
||||
![]()
Alright, as far as my Bootstrap theme goes - style-kyt.css is what is being used for additional styling to make the Bootstrap stuff compatible with Mysidia. You can add the additional styles to the end of this, since it's being used on every page.
As for making backgrounds show up every time your pets do, I NEED to know how you're CURRENTLY displaying pets. You've modified the base code because of your breeding modifications and you're storing pet images differently and pulling them differently. I don't know where you've made changes and I don't know what you're code currently looks like. Without knowing anything more than what I already know I'll tell you again: You need to call the getLayers() function we justmade every single time a pet is displayed. I already explained that the default framework is using a function called getImage(). Here are most of the places its being called, thanks the search function in my text editor: ![]() There's also a few other locations, such as favpet->getImage( that you'd have to search for. Possibly more, any place where new OwnedAdoptable isn't being stored as $adopt, really. And I don't know just how many times that is in the framework. I don't know what you're doing in these locations, because you've modified the base framework to change how pets are already displayed. Either you're calling them the same way you are by default, or you modified the getImage() function inside of class_ownedadoptables long ago. If your files are the same as the image, you can change these to getLayers(), as originally instructed. Hopefully this won't get too much more complicated. Or you could comment out the existing getImage() function in class_ownedadoptables and keep it there as a backup and create a new one with the same name and simply replace its contents and see how that goes. You don't need "gui" as a parameter when calling my function, however, so it might throw some angry errors when it receives such a thing, since the original getImage() function can get one, but I dunno. So try this: PHP Code:
PHP Code:
If you've actively using alternate images for pets based on the original framework, you'll have to make some more changes, taking a cue from the original function to check if the current pet usesAlternates().
__________________
Please do not contact me. I cannot offer tech support on any coding I've done prior to 2018.
Last edited by Kyttias; 04-16-2015 at 10:46 AM. |
#19
|
||||
|
||||
![]()
I'm sorry, I'm not trying to frustrate you.
Quote:
All I can do is attach my files and hope it makes sense that way. I am sorry I just don't really understand what you are asking about. I did a lot of mods for the old script but object oriented I really have trouble understanding and I don't know why. But as far as I know, it's all being called the default way you described. The only difference I KNOW of, is in breeding we make a new image for the baby and insert that in the imageurl field. I don't think there is any difference at all in how we call the image up in the coding. Last edited by Missy Master; 04-16-2015 at 11:47 AM. |
#20
|
||||
|
||||
![]()
I only had to open up one file and search for one of the lines in the image I posted to tell you that, no, nothing has been modified and if you want to go ahead and change the getImage() function in classes/class_ownedadoptables.php I posted last, things should work. Just open that file up and search for:
public function getImage($fetchMode = ""){ Make a copy of that function, comment out one, rename it, whatever, just so you have a backup of it. Then change the contents of the original (see my last post for what I'm asking you to change the contents to). Out of curiosity, is the getImage function's contents different than the original version I included in the last post? Because it's quite curious to me how images are being stored and pulled in your setup, but I digress... try the changes, then get back to me?
__________________
Please do not contact me. I cannot offer tech support on any coding I've done prior to 2018.
|
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mysidia Sites Directory | Hall of Famer | Adoptables Sites Showcase | 6 | 08-10-2016 03:28 AM |
This is sort of an hypothetical: Collecting things besides adopts and items | EzzyAlpha | Questions and Supports | 8 | 11-12-2013 07:23 AM |
Free linearts for your sites. :> | pachoofoosh | Art Gallery | 4 | 01-08-2013 06:56 PM |
Random breeding outcome/ rare breeding | SilverDragonTears | Questions and Supports | 0 | 03-25-2012 02:33 AM |
Adoptable Sites Directory! | Hall of Famer | Adoptables Sites Showcase | 7 | 08-29-2011 04:04 AM |
What's New? |
What's Hot? |
What's Popular? |