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:
PHP Code:
|
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.
|
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...=\
|
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): http://imgur.com/a/obD4g Thanks for the help guys. |
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:
PHP Code:
|
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:
Thanks for any help! |
@ Abronsyth
cool. Thank you very much for for sharings this :) @ Nobody Have you try it with PHP Code:
this works for me :wutno: |
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 PHP Code:
btw i hope you understand me :coloness: |
Hey Nairi ... endlich mal jemand aus der Heimat :happyc:
hast du unter "Public function manage" stehen PHP Code:
und versuch es mal mit getadoptbackground PHP Code:
|
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 |
All times are GMT -5. The time now is 12:27 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.