howtothings.co.uk
How to edit / add new top links in MyBB [Forum] - Printable Version

+- howtothings.co.uk (https://www.howtothings.co.uk)
+-- Forum: Computing (https://www.howtothings.co.uk/forumdisplay.php?fid=4)
+--- Forum: Website Development, Implementation and General Webmaster Support (https://www.howtothings.co.uk/forumdisplay.php?fid=9)
+--- Thread: How to edit / add new top links in MyBB [Forum] (/showthread.php?tid=371)



How to edit / add new top links in MyBB [Forum] - Mark - 25-09-2010

How to edit / add or remove top links on a MyBB forum


What's a top link? You may be asking, well it's the links that are at the top of your forum, usually to the right hand side.

[Image: rm0478.jpg]


There's two ways to do this, an easy and a less easy way. I'm going to show you both.


The less easy, but proper way.

1. Editing the language file.

Browse to and open:

Code:
/inc/languages/english/global.lang.php

The section you're looking for should be at the top, and look similar, if not the same as:

[Image: 33wm5wm.jpg]


2. In here, just add the top links that you wish to add then save the file, like so:

[Image: vqr80g.jpg]


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

Code:
/images/themename/toplinks/

4. Editing the header template of your theme

On your forum, go to.

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

It'll look similar to below:

[code=php]
<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>
[/code]


These are your top links:

[code=html]<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> [/code]

If you want to do an external link, it's like so:

[code=html]<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>[/code]

Just add your links in as desired, remember to add the right image name etc.


The easier way

On your top links, eg:

[code=html]<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>[/code]

Just add the title you want on your link after the title=""/> such as:

[code=html]<li><a href="{$mybb->settings['bburl']}/index.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/home.gif" alt="" title="Home" />Home {$lang->toplinks_home}</a></li>[/code]

That'll do the job.

If you have any questions or problems, please post or PM me. I'd be more than happy to help.