MyBB Community Forums

Full Version: How to add image and text to Top Header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I see what the problem is. In the header, replace the following:

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

With

<table class="bodyline" width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td>        <table class="topbkg" style="background: url(http://www.yoursite.com/images/background-of-your-header.jpg) repeat-x" width="100%" cellspacing="0" cellpadding="0" border="0">
            <tr> 
                <td><a href="index.php?sid=cf38afdee591dc613d90f27128efd9a6"><img src="http://localhost/images/logo.gif" border="0" alt="yoursite.com" title="yoursite.com" width="290" height="110" /></a></td>
                <td align="center" width="100%">

                    <span class="header_maintitle"> 
                    <b><font face="arial">First text in line.</font></b><br />
                    <span class="header_genmed">Other text in line or some link!</span><br />
                    </span>
                </td>
                <td align="right"><img src="http://localhost/images/logo.gif" border="0" alt="yoursite.com" title="yoursite.com width="" height="" /></td>
                </tr>
        </table> 

Be sure to revert template to original before doing this. Basically remove what you did before.
Yes it really worked very well. Thanks a lot.

If it's not any trouble. Is it possible to make the image on the right corner change automatically every 20 or 30 secs ?

You can check my site forum.wheelnmotor.com
Try adding

name="refresh" id="img1"

To your image source code then right below the img src code, add the following:

<script language="JavaScript" type="text/javascript">
var t = 35 // Interval in Seconds
images = new Array('PATH TO THE IMAGE'; //URLs of the Images

function Start() {
tmp = new Date();
tmp = "?"+tmp.getTime();
for (i=1;i<image.length;i++){
document.getElementById("img"+i).src = images[i]+tmp;
}
setTimeout("Start()", t*1000)
}
Start();
</script>
I tried it but it isn't working. Maybe my code is wrong. Could you please check it. Here it is below.

<td align="right"><img src="http://forum.wheelnmotor.com/images/logo-right.jpg" border="0" alt="forum.wheelnmotor.com" title="forum.wheelnmotor.com width="190" height="120" name="refresh" id="img1" />
               <script language="JavaScript" type="text/javascript">
var t = 35 // Interval in Seconds
images = new Array("http://forum.wheelnmotor.com/images/sls-front-right.jpg" border="0" alt="forum.wheelnmotor.com" title="forum.wheelnmotor.com width="190" height="120";"http://forum.wheelnmotor.com/images/jaguar-front-right.jpg" border="0" alt="forum.wheelnmotor.com" title="forum.wheelnmotor.com width="190" height="120")

function Start() {
tmp = new Date();
tmp = "?"+tmp.getTime();
for (i=1;i<image.length;i++){
document.getElementById("img"+i).src = images[i]+tmp;
}
setTimeout("Start()", t*1000)
}
Start();
</script>
</td>
I'm not sure then about refreshing the image. I'm not good with java.
(2013-08-13, 05:03 PM)Arbaz Wrote: [ -> ]I'm not sure then about refreshing the image. I'm not good with java.

It's alright.I think the issue is with the image path. Can you please tell me only if that is correct or not.
The image path seems to be okay. I would just recommend you to get rid of the modification I provided in reply #13.
(2013-08-13, 06:22 PM)Arbaz Wrote: [ -> ]The image path seems to be okay. I would just recommend you to get rid of the modification I provided in reply #13.

Ok done. Thanks.

Maybe there is a plugin for the image to change so I'm closing the thread now.
Pages: 1 2