TinyPortal

Development => Support => Topic started by: jotade29 on May 03, 2022, 07:00:32 PM

Title: How i put a img before txt buttons?
Post by: jotade29 on May 03, 2022, 07:00:32 PM
Hi, I'm trying to put an image next to the text of a button, but I don't know the syntax...

Code: [Select]
$dlbuttons = array(
'frontdl' => array('text' => 'tp-downloadss1', 'lang' => true, 'url' => $scripturl . '?action=tportal;sa=download;dl' ),
'upload' => array('text' => 'tp-dlupload', 'test' => 'can_tp_dlupload', 'lang' => true, 'url' => $scripturl . '?action=tportal;sa=download;dl=upload'),
'search' => array('text' => 'tp-search', 'lang' => true, 'url' => $scripturl . '?action=tportal;sa=download;dl=search'),
'stats' => array('text' => 'tp-stats', 'lang' => true, 'url' => $scripturl . '?action=tportal;sa=download;dl=stats'),
);
if(in_array($context['TPortal']['dlaction'],array('frontdl','upload','search','stats')))
$dlbuttons[$context['TPortal']['dlaction']]['active'] = true;
else
$dlbuttons['frontdl']['active'] = true;

echo '
<div style="overflow: hidden; margin: 0 0 5px 0;">';
template_button_strip($dlbuttons, 'right');

echo '
</div>';

Normally, the buttons are seen with your label, actions... and with this syntax I am not able without the name disappearing, I usually put it like this:

for example...
Code: [Select]
'stats' => array('text' => '<img scr="blah"/>' . 'tp-stats', 'lang' => true, 'url' => $scripturl . '?action=tportal;sa=download;dl=stats')
Where is the wrong?

Thanks