Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 12, 2022, 05:44:40 PM

Login with username, password and session length
Members
  • Total Members: 3842
  • Latest: Kokoro
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 50
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 41
Total: 41

Author Topic: How i put a img before txt buttons?  (Read 220 times)

0 Members and 1 Guest are viewing this topic.

Offline jotade29

  • Jr. Member
  • **
  • Posts: 5
How i put a img before txt buttons?
« 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
« Last Edit: May 03, 2022, 08:14:43 PM by jotade29 »