Log in

View Full Version : adding images to pages?


Ittermat
03-15-2016, 01:07 AM
Okay I know this is probably a really really stupid question- but for example if I wanna add image links to my inventory or pet page... how would I go about doing that?

Which file would I edit? And what coding would I use?

Also, How would I just add a picture to a page?

tahbikat
03-15-2016, 05:30 AM
For the inventory page, if you'd like an image there, add this in view/inventoryview.php:


$document->add(new Comment("<center><img src='' /></center>"));

right under this, which is lines 7-10:


public function index(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle($mysidia->lang->inventory);


Then just place your image url in the quotes. Definitely don't use double quotes in the img tag, only singles.

Other pages should be similar, just add that same image line right under the document->setTitle lines. Just find all the -name-view.php files

Ittermat
03-15-2016, 09:51 AM
Thanks but I also meant images instead ogf the links that are there too...lol so id have image links instead of links

Abronsyth
03-15-2016, 12:55 PM
Doing the same thing as what tahbikat said, just use HTML to add-in a link tag around the image:
$document->add(new Comment("<center><a href='URLHERE'><img src='IMAGEURLHERE' /></a></center>"));

Hall of Famer
03-15-2016, 01:10 PM
Well there is a better way, use the code below:


$document->add(new Image($src, $alt, $dimension));


Here you can change src to the url you want to use, and $alt is the alt property of image tag, and dimension is for both width and height.