Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Adding coin image instead of a currency name.q (http://www.mysidiaadoptables.com/forum/showthread.php?t=4329)

LucasA33 12-21-2013 05:56 AM

Adding coin image instead of a currency name.q
 
I'm new to PHP so I am at a loss of what to do here, but I want to add a small 16x16 icon image where it says MONEY:
http://i.imgur.com/KaqfIb4.png

I've tried resources like google but all it ever does is confuse me :P
Maybe one of you guys could help me put this together.

Current code:

Quote:

/**
* The getMoneyBar method, getter method for property $moneyBar.
* @access public
* @return Paragraph
*/
public function getMoneyBar(){
return $this->moneyBar;
}

/**
* The setMoneyBar method, setter method for property $moneyBar.
* It is set internally upon object instantiation, cannot be accessed in client code.
* @access protected
* @return Void
*/
protected function setMoneyBar(){
$mysidia = Registry::get("mysidia");
$this->moneyBar = new Paragraph;
$this->moneyBar->add(new Comment("Money: {$mysidia->user->money} {$mysidia->settings->cost} | "));

$donate = new Link("donate");
$donate->setText("Donate");
$this->moneyBar->add($donate);
$this->setDivision($this->moneyBar);
}

Hall of Famer 12-21-2013 06:11 AM

If you wish to add an image to the money bar, use the following code:

PHP Code:

$this->moneybar->add(new Image("image.gif")); 


LucasA33 12-21-2013 06:16 AM

Ok, thanks. I probably feel stupid for not figuring that out myself :Q:

IntoRain 12-21-2013 07:58 AM

By the way, google doesn't help much Mysidia-wise xD

LucasA33 12-21-2013 09:01 AM

Yeah but PHP is :P

IntoRain 12-21-2013 11:24 AM

Yes, but Mysidia is a pretty complete framework, which means it has its own ways of doing things. Usually you add a picture with HTML tags not PHP, mysidia has its own way of "adding image" that simplifies this process

LucasA33 12-22-2013 01:32 PM

Quote:

Originally Posted by Hall of Famer (Post 28651)
If you wish to add an image to the money bar, use the following code:

PHP Code:

$this->moneybar->add(new Image("image.gif")); 


I'm not exactly sure how to add that with out it erroring out. Mind if you post a completed line with it included? I still want a comment as well.

Hall of Famer 12-22-2013 08:05 PM

Quote:

Originally Posted by LucasA33 (Post 28659)
I'm not exactly sure how to add that with out it erroring out. Mind if you post a completed line with it included? I still want a comment as well.

What errors do you get? The images cannot be found? If the image is hosted on your server, just use path like templates/images/myimage.png.

katsunya 01-19-2014 02:42 PM

What file would we have to edit in order to do this?

Hall of Famer 01-19-2014 04:00 PM

the file class_sidebar.php in your /classes folder.


All times are GMT -5. The time now is 06:49 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.