Banner announcement

jdab

Madly Diligent
Joined
Aug 29, 2010
Messages
9,642
Reaction score
1
FP$
21
Didn't really know what to call this thread, but I saw these on the MyBB Community Forum; how do I get them?

56454713542000.0003dsfgjhk.png
 
Flux said:
TheNova said:
I've done everything it says but I'm getting plain text and no banner 🙁

Put this:

Code:
.newsbar {
	background: #D6ECA6;
	border-top: 2px solid #8DC93E;
	border-bottom: 2px solid #8DC93E;
	text-align: center;
	margin: 10px auto;
	padding: 5px 20px;
	font-weight: bold;
}

In your global.css file for your theme instead of the index template of your theme. Then add:

Code:
<p class="newsbar">Your Important Announcement Here</p>

In the index template of your theme. If you need help, shoot me a PM with some login info and I'll do it for you.
 
TheNova said:
Flux said:
TheNova said:
I've done everything it says but I'm getting plain text and no banner 🙁

Put this:

Code:
.newsbar {
	background: #D6ECA6;
	border-top: 2px solid #8DC93E;
	border-bottom: 2px solid #8DC93E;
	text-align: center;
	margin: 10px auto;
	padding: 5px 20px;
	font-weight: bold;
}

In your global.css file for your theme instead of the index template of your theme. Then add:

Code:
<p class="newsbar">Your Important Announcement Here</p>

In the index template of your theme. If you need help, shoot me a PM with some login info and I'll do it for you.
Thanks but I think I've got it now, seems to be working, no idea what went wrong last time. Also, how to you add a link? Need the code to add 🙂
 
TheNova said:
Code:
<a href="http://linkhere">text here</a>
Cheers man. Also, it says on the web page on how to add more banners. I realise why they weren't working before. The guide says:
For multiple news bars in different colours, you'll need to duplicate the CSS with a different class name (say .newsbar_red) and change the CSS colours accordingly.
I renamed the banner 'newsbar_facebook' but it didn't like it.

Where do I put the coding for another banner? This is what my code looks like at the moment:
Code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<style type="text/css">
.newsbar {
	background: #3B5998;
	border-top: 2px solid #133783;
	border-bottom: 2px solid #133783;
	text-align: center;
	margin: 10px auto;
	padding: 5px 20px;
	font-weight: bold;
}
</style>
</style>
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
<p class="newsbar">Are you a fan of LevelUnlocked on Facebook? If not, <a href="http://www.facebook.com/LevelUnlocked">like our page</a> now!</p>

{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
	<dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->no_new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
	<dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>
 
Code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<style type="text/css">
.newsbar {
   background: #3B5998;
   border-top: 2px solid #133783;
   border-bottom: 2px solid #133783;
   text-align: center;
   margin: 10px auto;
   padding: 5px 20px;
   font-weight: bold;
}
.newsbar2 {
   background: #FFA500;
   border-top: 2px solid #133783;
   border-bottom: 2px solid #133783;
   text-align: center;
   margin: 10px auto;
   padding: 5px 20px;
   font-weight: bold;
}
</style>
</style>
<script type="text/javascript">
<!--
   lang.no_new_posts = "{$lang->no_new_posts}";
   lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
<p class="newsbar">Are you a fan of LevelUnlocked on Facebook? If not, <a href="http://www.facebook.com/LevelUnlocked">like our page</a> now!</p>

{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
   <dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
   <dd>{$lang->new_posts}</dd>

   <dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
   <dd>{$lang->no_new_posts}</dd>

   <dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
   <dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>

Try the code above, I just added .newsbar2 with the background colour #FFA500 (orange). Just change the background colour to what you want. Use this website for reference on colours: http://www.computerhope.com/htmcolor.htm
 
TheNova said:
Code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<style type="text/css">
.newsbar {
   background: #3B5998;
   border-top: 2px solid #133783;
   border-bottom: 2px solid #133783;
   text-align: center;
   margin: 10px auto;
   padding: 5px 20px;
   font-weight: bold;
}
.newsbar2 {
   background: #FFA500;
   border-top: 2px solid #133783;
   border-bottom: 2px solid #133783;
   text-align: center;
   margin: 10px auto;
   padding: 5px 20px;
   font-weight: bold;
}
</style>
</style>
<script type="text/javascript">
<!--
   lang.no_new_posts = "{$lang->no_new_posts}";
   lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
<p class="newsbar">Are you a fan of LevelUnlocked on Facebook? If not, <a href="http://www.facebook.com/LevelUnlocked">like our page</a> now!</p>

{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
   <dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
   <dd>{$lang->new_posts}</dd>

   <dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
   <dd>{$lang->no_new_posts}</dd>

   <dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
   <dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>

Try the code above, I just added .newsbar2 with the background colour #FFA500 (orange). Just change the background colour to what you want. Use this website for reference on colours: http://www.computerhope.com/htmcolor.htm
Thanks man!
 
Back
Top Bottom