MyBB Community Forums

Full Version: How to use {$variablegoeshere} as an image?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a button added to the reputation_add template, and it's in there like {$thisismyexamplevariable}. Now, I want to make that button an image. How can I do that?
what is the contents of $thisismyexamplevariable and how are you populating it?
If you're going to allow all users to use that button, then simply add <img> tag, like this;
<a href="LINK_URL"><img src="IMAGE_PATH_OF_THIS_BUTTON" alt="Button" title=""></a>
For example, you are showing that variable in showthread, expand showthread template and add a template inside it named
thisismyexamplevariable

and write the code in that template which Yaldaram gave and save the template.

Then you can use {$thisismyexamplevariable} anywhere you want and it'd show image. Hope that helps.
(2011-09-30, 05:03 AM)Yaldaram Wrote: [ -> ]If you're going to allow all users to use that button, then simply add <img> tag, like this;
<a href="LINK_URL"><img src="IMAGE_PATH_OF_THIS_BUTTON" alt="Button" title=""></a>

I tried that, but the button is part of a plugin, so in order to have the button, {$thisismyexamplevariable} needs to be there and it didn't work.
if you want help,you need to respond to my post above, otherwise everyone is just guessing as to what you are trying to do
Declare the variable, then use it somewhere else:

$thisismyexamplevariable = "<a href="Link Here"><img src="path here" title="Link Info Here">Link Name Here</a>;
(2011-09-30, 03:22 AM)pavemen Wrote: [ -> ]what is the contents of $thisismyexamplevariable and how are you populating it?

The variable is part of a plugin, specifically, the rep eggplant button.
if the whole HTML bit of the button or the whole of the linked image you want is derived in the plugin then do as above and simply wrap the <img> tag in an <a> tag. just be sure to global the variable you are using so its available outside the plugin function
(2011-10-01, 02:19 AM)pavemen Wrote: [ -> ]if the whole HTML bit of the button or the whole of the linked image you want is derived in the plugin then do as above and simply wrap the <img> tag in an <a> tag. just be sure to global the variable you are using so its available outside the plugin function

Okay thank you!