MyBB Community Forums

Full Version: how to add image/link to right of logo in header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am very unfamiliar with myBB's coding.

can anyone point me to what file (and where in that particular file) i need to be if i want to add an image/link to the 'right' of the main logo in the header?

i'm assuming it is index.php, but it's all german to me. Big Grin (no offense to the germans, of course)


-------------------------

ok, i answered my own question by finding the templates in the admincp.


-------------------------

however, now my question is this (unfortunately i am quite rusty with html)

i want to add an image (right justified preferably) next to the existing logo.jpg that i have in the header.

here is the header template for my theme: (i've highlighted my juvenile tinkering)

Quote:<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>
<a href="http://xat.com/web_gear/chat/go_large.php?id=115888535"><img src="http://www.thelonelylife.com/images/chat.jpg" /></a>
</div>
<!-- *** -->

<div class="menu">
<ul>
<li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>
<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></li>
<li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></li>
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></li>
</ul>
</div>
<hr class="hidden" />
<div id="panel">
{$welcomeblock}
</div>
</div>
<hr class="hidden" />
<br class="clear" />
<div id="content">
{$pm_notice}
{$bannedwarning}
{$bbclosedwarning}
{$unreadreports}
{$pending_joinrequests}
<navigation>
<br />

info about the image i want to add:

- it's a link to a xat chatbox
- dimensions are 120 x 96
- name is chat.jpg
- location is in ...root/images/chat.jpg

this is impossible for me, but i'm sure somebody knows what to add into that template to make this image appear. any help is very appreciated. Smile
<div id="container">
<a name="top" id="top"></a>
<div id="header">
<div class="logo"><div style="float:right">

<a href="http://xat.com/web_gear/chat/go_large.php?id=115888535"><img src="http://www.thelonelylife.com/images/chat.jpg" /></a>

</div>


<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']}/search.php"><img src="{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>
hey torbin. thanks for responding.

i'm sure it should be working with the code you've given me, but i'm not sure how much of that to actually add and where to insert it. i tried it a few different ways with no luck. this is probably because i'm so rusty with html that the answer is too obvious.

here is my header template again, unedited:

Quote:<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']}/search.php"><img src="{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>
<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></li>
<li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></li>
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></li>
</ul>
</div>
<hr class="hidden" />
<div id="panel">
{$welcomeblock}
</div>
</div>
<hr class="hidden" />
<br class="clear" />
<div id="content">
{$pm_notice}
{$bannedwarning}
{$bbclosedwarning}
{$unreadreports}
{$pending_joinrequests}
<navigation>
<br />

can you show me exactly what code to insert and where to put it? i do honestly apologize for the trivial nature of this question, i used to be good at this stuff, but it's been years.

thanks for any help. Smile
Just add this before the logo div:
<div class="float_right">**yourcode**</div>

So the result is:
<div id="header">
<div class="float_right">**yourcode**</div>
<div class="logo">
thanks for the response ajs. i think i followed your instructions correctly.

this is my code, with highlighted changes:

Quote:<div id="container">
<a name="top" id="top"></a>
<div id="header">

<!-- *** -->
<div class="float_right"><a
href="http://xat.com/web_gear/chat/go_large.php?id=115888535"><img
src="http://www.thelonelylife.com/images/chat.jpg" /></a></div>
<!-- *** -->

<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a>
</div>

it still isn't working. i'm not even getting a red-X, so i imagine there is something wrong with my code.
There's nothing wrong with that code, are you sure you're editing the right template set?
(2010-10-01, 01:21 PM)AJS Wrote: [ -> ]There's nothing wrong with that code, are you sure you're editing the right template set?

wow. Big Grin

i really should just retire while i'm still ahead. derrr.

i was editing the default template instead of the proper theme's template.

it's working. Shy