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
  #11  
Old 05-03-2017, 04:00 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,629
Abronsyth is on a distinguished road
Default

Okie dokie, so you'll need to put it in the manage function. (Assuming you want it to appear while a user is managing an individual pet).
You can do it like this:

Under the manage function you'll see this:
PHP Code:
        $mysidia Registry::get("mysidia");
        
$aid $this->getField("aid")->getValue();
        
$name $this->getField("name")->getValue();
        
$image $this->getField("image");
        
        
$document $this->document;        
        
$document->setTitle("Managing {$name}");
        
$document->add($image);
        
$document->add(new Comment("<br><br>This page allows you to manage {$name}.  Click on an option below to change settings.<br>")); 
Now remove the $document->add($image);. Go to the new Comment below that and replace the text within the " " with this:
PHP Code:
<div style='background:{$adopt->background} no-repeat;vertical-align:bottom;text-align:center;'><img src='{$adopt->getImage()}'/></div><br><br>This page allows you to manage {$name}.  Click on an option below to change settings.<br
I think that should work, though I haven't tested it because my manage function is heavily modified, so I had to find the original and edit it.
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #12  
Old 05-04-2017, 09:17 AM
darrinm3 darrinm3 is offline
Member
 
Join Date: May 2017
Posts: 5
Gender: Male
Credits: 788
darrinm3 is on a distinguished road
Default

Sorry to keep bothering you, but it still doesn't work. It's givin me a blank page (syntax error on "<img src='{$adopt->getImage()}'/>" and when I get rid of it, the background still doesn't show. I've tried all sorts of things but for some reason can't get it. I even tried echoing the {$adopt->background} inside the style to see if that helped but still nothing.
Reply With Quote
  #13  
Old 05-04-2017, 10:01 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 32,858
kristhasirah
Default

to call the background you must use the same name given in the owned_adoptables database, so if you used the same name posted here: adoptbackground then the correct way to call it it would be: {$adopt->adoptbackground} and the way to call the adopt image is the one you posted: <img src='{$adopt->getImage()}'/> dont know why is giving you a syntax error...=\
Reply With Quote
  #14  
Old 05-04-2017, 10:20 AM
darrinm3 darrinm3 is offline
Member
 
Join Date: May 2017
Posts: 5
Gender: Male
Credits: 788
darrinm3 is on a distinguished road
Default

That was a typo in my comment, oops! Here is the code I use which gives me a 500 error:

public function manage(){
$mysidia = Registry::get("mysidia");
$aid = $this->getField("aid")->getValue();
$name = $this->getField("name")->getValue();
$image = $this->getField("image");

$document = $this->document;
$document->setTitle("Managing {$name}");
$document->add(new Comment("<div style='background:{$adopt->adoptbackground} no-repeat;vertical-align:bottom;text-align:center;width:100px;height:400px'><img src='{$adopt->getImage()}'/></div><br><br>This page allows you to manage {$name}. Click on an option below to change settings.<br> "));


Here is what happens with the same code except I removed the "img src" tag" (I gave it a height and width to show the div was being created and modified):


Thanks for the help guys.
Reply With Quote
  #15  
Old 05-04-2017, 11:01 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,629
Abronsyth is on a distinguished road
Default

Alright, so it's failing to call the background URL. What should the URL appear as for that adoptable?

Okay, so this is what I have for my site:
PHP Code:
<td style='background-image:url({$adopt->background});background-repeat: no-repeat;background-position:center;border-top:1px #000 solid;border-bottom:1px #000 solid;vertical-align:bottom;height:155px;'><img src='{$adopt->getImage()}'></td
Try replacing style='background:{$adopt->adoptbackground} no-repeat;vertical-align:bottom;text-align:center;width:100px;height:400px' with this:
PHP Code:
style='background-image:url({$adopt->background});background-repeat: no-repeat;background-position:center;vertical-align:bottom;height:400px;width:100px;' 
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 05-04-2017 at 11:05 AM.
Reply With Quote
  #16  
Old 03-30-2018, 04:46 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 21,829
NobodysHero is on a distinguished road
Default

Heya! I'd love to get this working, but the background image isn't showing up on the pet. Halp?

My code isn't throwing any errors, so not really sure where to go from here. I've tried it in a few different places, but every time nothing changes.

This is the line of code Dinocaid helped me put together, but it's not working either:

PHP Code:
$document->add(new Comment("<div style='background-image:url('{$adopt->adoptbackground}');background-repeat: no-repeat;background-position:center;'><img src='{$adopt->getImage()}'></img></div>);"
I've already uploaded an image and made it a background item, then used it on my pet. I've removed the code from all the pages so my users can still see their pets in the meantime.

Thanks for any help!
__________________

Venture Into The Mist
Reply With Quote
  #17  
Old 08-17-2018, 05:34 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 12,564
draugluin is on a distinguished road
Default

@ Abronsyth

cool. Thank you very much for for sharings this :)

@ Nobody

Have you try it with

PHP Code:
... $adopt->getadoptbackground ... 
?

this works for me

Last edited by draugluin; 08-21-2018 at 10:24 AM.
Reply With Quote
  #18  
Old 10-03-2018, 12:50 PM
Nairi Nairi is offline
Member
 
Join Date: Sep 2018
Location: Germany
Posts: 13
Gender: Female
Credits: 987
Nairi is on a distinguished road
Default

Hi (sorry for my bad english, i'm from germany :D ),

i tried to bring the background to my game, but i'ts dont show =/ and when i try to show the pet-picture, i became an error:

Code:
 Fatal error: Call to a member function getImage() on null in /users/equino/www/view/myadoptsview.php on line 135
That's the Line:
PHP Code:
        $document->add(new Comment(" <div style='background-image:url:{$adopt->adoptbackground} no-repeat;vertical-align:bottom;text-align:center;width:400px;height:283px'><img src='{$adopt->getImage()}'></div><br><br>This page allows you to manage {$name}.  Click on an option below to change settings.<br> 
can anyone help me? :)
btw i hope you understand me
Reply With Quote
  #19  
Old 10-04-2018, 03:58 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 12,564
draugluin is on a distinguished road
Default

Hey Nairi ... endlich mal jemand aus der Heimat

hast du unter "Public function manage" stehen

PHP Code:
$image $this->getField("image");
$adopt = new OwnedAdoptable($aid); 
?

und versuch es mal mit getadoptbackground

PHP Code:
..... background-image:url:{$adopt->getadoptbackground
__________________
Reply With Quote
  #20  
Old 10-04-2018, 06:08 AM
Nairi Nairi is offline
Member
 
Join Date: Sep 2018
Location: Germany
Posts: 13
Gender: Female
Credits: 987
Nairi is on a distinguished road
Default

Hey :)

Na, das ist ja klasse.

Also das Bild vom Haustier wird nun angezeigt, danke :)
Der Hintergrund aber leider noch immer nicht. Sehr mysteriös
Reply With Quote
Reply


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


All times are GMT -5. The time now is 12:14 PM.

Currently Active Users: 670 (0 members and 670 guests)
Threads: 4,081, Posts: 32,032, 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