Login Register
Home View New Posts Help
Mybb Code To Add User Welcome Banner For Guests Only
Well had a little play and came up with a way to add
a welcome banner for guests only.
Here is how to
do it:
Edit the Main Header Template and remove the
<div id="container">
<a name="top" id="top"></a><br />
<div id="header">
<div class="logo"><a href="{$mybb->settings<br />
['bburl']}/index.php"><img src="images/red_<br />
theme/logo.png" alt="{$mybb->settings ['bbname']}" title="{$mybb->settings<br />
['bbname']}" /></a></div>
<div class="menu">
<li><a href="{$mybb->settings['bburl']}/<br />
search.php"><img src="{$mybb->settings ['bburl']}/{$theme['imgdir']}/toplinks/<br />
search.gif" alt="" title="" />{$lang->toplinks_<br />
<li><a href="{$mybb->settings['bburl']}/<br />
memberlist.php"><img src="{$mybb->settings<br />
['bburl']}/{$theme['imgdir']}/toplinks/ memberlist.gif" alt="" title="" />{$lang-<br />
<li><a href="{$mybb->settings['bburl']}/<br />
calendar.php"><img src="{$mybb->settings<br />
['bburl']}/{$theme['imgdir']}/toplinks/<br />
calendar.gif" alt="" title="" />{$lang->toplinks_ calendar}</a></li>
<li><a href="{$mybb->settings['bburl']}/<br />
misc.php?action=help"><img src="{$mybb-<br />
>settings['bburl']}/{$theme['imgdir']}/toplinks/<br />
help.gif" alt="" title="" />{$lang->toplinks_<br />
help}</a></li> </ul>
<hr class="hidden" />
<div id="panel">
<hr class="hidden" />
<br class="clear" /><br />
<div id="content"><div id="pluginlibrary">Hello PluginLibrary!<p>This is a sample PluginLibrary Plugin (which can be disabled!) that displays this message on all pages.</p><!-- start: hellopl_example -->
<p>...and this is the <i>hellopl_example</i> template.</p>
<!-- end: hellopl_example --></div>
{$pm_notice}<br />
{$bannedwarning} {$bbclosedwarning}<br />
{$unreadreports}<br />
<br />

Now edit the header_welcomeblock_member Template

<span style="float:right;">{$lang->welcome_<br />
current_time}</span><br />
{$lang->welcome_back} (<a href="{$mybb-<br />
>settings['bburl']}/usercp.php"><strong>{$<br />
lang->welcome_usercp}</strong></a>{$<br />
modcplink}{$admincplink} — <a href ="{$mybb->settings['bburl']}/member.php?<br />
action=logout&logoutkey={$mybb->user<br />
['logoutkey']}">{$lang->welcome_logout}</<br />
a>)<br />
<span class="links"><br />
<a href="#" on‌click="MyBB.popupWindow('{$ mybb->settings['bburl']}/misc.php?<br />
action=buddypopup', 'buddyList', 350, 350);"><br />
{$lang->welcome_open_buddy_list}</a><br />
</span><br />
<a href="{$mybb->settings['bburl']}/<br />
search.php?action=getnew">{$lang- >welcome_newposts}</a> | <a href="{$mybb-<br />
>settings['bburl']}/search.php?<br />
action=getdaily">{$lang->welcome_<br />
todaysposts}</a> | <a href="{$mybb->settings<br />
['bburl']}/private.php">{$lang->welcome_pms}<br />
</a> {$lang->welcome_pms_usage}
Now edit the header_welcomeblock_guest Template

<script type="text/javascript"><br />
<!--<br />
lang.username = "{$lang->login_username}";<br />
lang.password = "{$lang->login_password}";<br />
lang.login = "{$lang->login}";<br />
lang.lost_password = " — <a href=\"{$ mybb->settings['bburl']}/member.php?<br />
action=lostpw\">{$lang->lost_password}<\/<br />
a>";<br />
lang.register_url = " — <a href=\"{$<br />
mybb->settings['bburl']}/member.php?<br />
action=register\">{$lang->welcome_register}< \/a>";<br />
// --><br />
</script><br />
<span style="float: right;">{$lang->welcome_<br />
current_time}</span><br />
<span id="quick_login">{$lang->welcome_ guest} (<a href="{$mybb->settings['bburl']}/<br />
member.php?action=login"<br />
on‌click="MyBB.quickLogin(); return false;">{$<br />
lang->welcome_login}</a> — <a href<br />
="{$mybb->settings['bburl']}/member.php?<br />
action=register">{$lang->welcome_register}</ a>)</span><br />
<div style="text-align:center; margin-<br />
top:15px;"><br />
<a href="member.php?<br />
action=register"><img src="images/red_<br />
theme/register.jpg" title="Click Here To Register on {$mybb->settings['bbname']}"<br />
alt="Click Here To Register"></a><br />

Then simply edit the image location in the last bit of
code and anything else you want to adjust.
This was done on the standard MyBB theme on
MyBB v1.4.8
If you have any problems or suggestions post below

Possibly Related Threads...
Thread Author/Last Post
  Any other Mybb SEO Plugins
  Cool Wapkiz And Wapelf File Manager Search List Code
  Top 5 Mybb Forums in Nigeria
  Mybb Nairaland theme
  Mybb theme: Download Naija words green theme
  How Do I Display Latest Posts On Mybb Index
  Mybb theme: Which Theme Is Nulled.ch Using?
  Mybb Forum: Why is username blank when quoting a guest post
  MYBB Forum SEO: Tip for successful Forum
  MYBB: How Can I Display Social Share Buttons