TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 01:39:23 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 180
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 163
  • Total: 163

How i put a img before txt buttons?

Started by jotade29, May 04, 2022, 02:00:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jotade29

Hi, I'm trying to put an image next to the text of a button, but I don't know the syntax...

$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...
'stats' => array('text' => '<img scr="blah"/>' . 'tp-stats', 'lang' => true, 'url' => $scripturl . '?action=tportal;sa=download;dl=stats')

Where is the wrong?

Thanks