MyBB Community Forums

Full Version: TopLinks Image. How do I display a picture.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Like on the top links you have Search, Member List, Calendar, Help.

They have images beside them and I want to link to the icons for them on my server. How do I do that? They are located in images/toplinks/(img name)

The way I'm doing it right now is using img src but I'm linking directly to the actual URL of the image instead of the internal link I guess you could call it.

So how do you link that way?

Edit: When I try this <img src="{$theme['imgdir']}/toplinks/portal.png" (it is closed just later in code)
The image is not displayed.
Close the tag right away.

<img src="{$theme['imgdir']}/toplinks/portal.png" />
(2011-11-07, 04:09 AM)Paul H. Wrote: [ -> ]Close the tag right away.

<img src="{$theme['imgdir']}/toplinks/portal.png" />

Closed still not displaying

<img src="{$theme['imgdir']}/toplinks/portal.png"/>
1. Go to
/inc/languages/english/global.lang.php

2. Add in the toplinks you want, Copy your search toplink and paste it underneath and write the name of your new one.

3. Upload the images you wish to use to your theme's toplink image folder.


/images/themename/toplinks/

4. Editing the header template of your theme

On your forum, go to.


Admin control panel (ACP) > Themes and Templates > Templates > Your Template name > Options > Expand > Header Templates > Options > Expand > header

It'll look similar to below:


<div id="container">
		<a name="top" id="top"></a>
		<div id="header">
			<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
			<div class="menu">
				<ul>
 
                                        <li><a href="{$mybb->settings['bburl']}/index.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/home.gif" alt="" title="Home" />{$lang->toplinks_home}</a></li>       
                                        <li><a href="{$mybb->settings['bburl']}/donate.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/search.gif" alt="" title="Donate" />{$lang->toplinks_donate}</a></li>
					<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="Member List" />{$lang->toplinks_memberlist}</a></li>
					<li><a href="{$mybb->settings['bburl']}/member.php?action=emailuser&uid=1"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="Contact" />{$lang->toplinks_contact}</a></li>
                                        <li><a href="http://twitter.com/mcomputeforums" target="_blank"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/twitter.gif" alt="" title="Twitter" />{$lang->toplinks_twitter}</a></li>                                     
					<li><a href="{$mybb->settings['bburl']}/misc.php?action=help&hid=8"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/help.gif" alt="" title="Rules" />{$lang->toplinks_rules}</a></li>
				</ul>
			</div>

Add this:
<li><a href="{$mybb->settings['bburl']}/index.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/name.png" alt="" title="TOPLINK NAME" />{$lang->toplinks_home}</a></li>
What's your forum URL?
@Mrawwad Thanks. Stupid me didn't realize it wasn't going to images/toplinks/ for the logo's when it should have been going to the theme's location. Thanks. And my way of displaying it is different and it works.
<li><img src="{$theme['imgdir']}/toplinks/portal.png" /></a><a  href="{$mybb->settings['bburl']}/portal.php">Portal</a></li>
(2011-11-07, 04:22 AM)Fogest Wrote: [ -> ]@Mrawwad Thanks. Stupid me didn't realize it wasn't going to images/toplinks/ for the logo's when it should have been going to the theme's location. Thanks. And my way of displaying it is different and it works.
<li><img src="{$theme['imgdir']}/toplinks/portal.png" /></a><a  href="{$mybb->settings['bburl']}/portal.php">Portal</a></li>
Glad I helped mate.