Adding coin image instead of a currency name.q

Forum
Last Post
Threads / Messages

LucasA33

Member
Member
Joined
Jul 26, 2011
Messages
144
Points
16
Mysidian Dollar
7,036
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:
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:

/**
* 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);
}
 
If you wish to add an image to the money bar, use the following code:

PHP:
$this->moneybar->add(new Image("image.gif"));
 
Ok, thanks. I probably feel stupid for not figuring that out myself :Q:
 
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
 
If you wish to add an image to the money bar, use the following code:

PHP:
$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.
 
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.
 
What file would we have to edit in order to do this?
 
Go to classes->class_sidebar.php

Add the code above:
$this->moneyBar->add(new Comment("Money: {$mysidia->user->money} {$mysidia->settings->cost} | "));
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,124
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top