MyBB Community Forums

Full Version: Banner for guests only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi friends,

I want to show a guest register banner to guest only at header below navigation....I don't want to use any ad management plugin because i have already mybb advertisements old version installed....
Is there any code to use in header template which will show the banner only to guests...?

My site url is: http://worldofdth.com
Whatever you want to show to guests only put it in 'header_welcomeblock_guest' template and that will be exclusively for guests only.
The header_welcomeblock_guest template code
is only limited to login area, check my forum header first. Code is:
<div align="right">
<div id="panel_main">

<form method="post" action="member.php">

<a href="{$mybb->settings['bburl']}/member.php?action=lostpw"><img align="bottom" src="{$mybb->settings['bburl']}/images/wod/panel_button/lp_h.png"  onmouseover="this.src='{$mybb->settings['bburl']}/images/wod/panel_button/lp.png';" onmouseout="this.src='{$mybb->settings['bburl']}/images/wod/panel_button/lp_h.png';"></a>&nbsp;&nbsp; 

<input type="hidden" name="action" value="do_login">
<input type="hidden" name="url" value="{$mybb->settings['bburl']}/index.php">
<input type="hidden" name="quick_login" value="1">
<input type="text" name="quick_username" id="quick_login_username" value="Username" class="textbox" onfocus="if(this.value == 'Username') { this.value=''; }" onblur="if(this.value == '') { this.value='Username'; }">&nbsp;&nbsp;
<input type="password" name="quick_password" id="quick_login_password" value="Password" class="textbox" onfocus="if(this.value == 'Password') { this.value=''; }" onblur="if(this.value == '') { this.value='Password'; }">
<input type="image" name="submit" value="Login" class="button_p" src="{$mybb->settings['bburl']}/images/wod/panel_button/log_in_h.png" onmouseover="this.src='{$mybb->settings['bburl']}/images/wod/panel_button/log_in.png';" onmouseout="this.src='{$mybb->settings['bburl']}/images/wod/panel_button/log_in_h.png';">&nbsp;

<span class="remember_me"><input name="quick_remember" type="checkbox" checked="checked" value="yes" class="checkbox" id="quick_login_remember"><label for="quick_login_remember"> </label></span>


<a href="{$mybb->settings['bburl']}/member.php?action=register"><img align="top" src="{$mybb->settings['bburl']}/images/wod/panel_button/register_b.png" /></a>&nbsp;&nbsp; 
</form>

</div>
</div>

If i place the banner at the end of this template then it will show the banner above the logo of forum like this:

[Image: 11avaiu.png]


I want to show this banner below navigation of forum at header for guests only...any way to do it...
It seems your 'panel_main' id is set to 'position: fixed;'

Put the banner in 'header_welcomeblock_guest' template at the end as you have done and move '{$welcomeblock}' after '<navigation>' in header template.
Moving welcome block after navigation would also bring the login bar below navigation if i am not wrong.

Thats not the solution for this
Yes you are wrong. I said it seems the bar is set to {position: fixed; /* or maybe absolute */ top: 0px;} in CSS. It appears exactly that way. It will stick at the top in every case.
you could also use conditional templates from mybb hacks and put an if else block under the navigation.

http://mybbhacks.zingaburga.com/showthread.php?tid=464
Why making it complicated? It is simple. I better want to look at the id declaration of 'panel_main' from css. I'm sure it is fixed or absolute.

OK here it is:

#panel_main {
padding: 4px;
}

Just make it:

#panel_main {
padding: 4px;
position: absolute;
top: 0px;
}

Just give it a try and let us know if it comes under the breadcrumb ever.
I can't understand what you people are saying as i don't know much coding...please tell me step wise what to do and where to do.....to show a banner for guests...
(2012-10-16, 04:12 PM)saini1987 Wrote: [ -> ]I can't understand what you people are saying as i don't know much coding...please tell me step wise what to do and where to do.....to show a banner for guests...

Saini - please start your own support thread. The advice from effone is applicable to ONLY the OP's theme.
Pages: 1 2