MyBB Community Forums

Full Version: centering buysellads ad.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I cannot get the advertisement for them to center. I contacted support, and tried both things they told me the do, and had no luck. The footer ad is messed up too, and looks terrible. I have no idea why its doing what its doing.

forumkorner.com to see the ads. The header ad has two, and says xblforums on the first ad, and than advertise here for the second one. Its on ad rotator so you might have to refresh a couple of times to see the right ad.

The footer ad just says advertise here once, and is all in the wrong spots and stuff. I am using my advertisements plugin if that helps at all.

This is what buysellads support told me to do,

1. You can increase the margin to the left of that ad in the "Anchor Style" field of "Advanced Settings" to make it appear centered.

2. Or in your website files, you can add a div around the STEP 2 ad code that has the same width of the ad itself, and then set that div to 'margin:0 auto' so that it centers. You can call this new div that you create "ad_container" or something similar so you will know that it's the div that surrounds the ad zone. So it would look something like this in your styles:

.ad_container {
width:468px;
margin:0 auto;
}

Both suggestions they said I couldn't get to work. :/ It really makes my site looks terrible having non centered ads, and centered ads.
The ads in the header and footer look centered to me... on FF8
This is what your forum looks like right now in Chrome 16:
[Image: Fskdr.png]
<center> ad code </center>

Simple as that.
There is more than one ad. You guys need to refresh the page a couple times to see the not centered ads. Solidus that does not work.
What's the code you're using to add the advertisements and in what templates?
Here is my index template,

<html>
<head>
<title>Gaming Community Forums</title>
{$headerinclude}
<meta name="description" content="ForumKorner is a fun and friendly gaming community / forums. Meet other gamers or Buy, Sell, And Trade accounts and other services here." />
<meta name="keywords" content="gaming forum, gaming forums, game forum, game forums, games forum, forumkorner, a games, armor games, forums, xbox 360 forums, marketplace, webmaster, graphics, computing, best games, Gaming community" />
<script type="text/javascript">
<!--
    lang.no_new_posts = "{$lang->no_new_posts}";
    lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
<style type="text/css">
.buttons {
    background: url(images/arrowright.png) no-repeat;
    width: 16px;
    height: 16px;
    display: block;
    cursor: pointer;
}

.clickedbuttons {
    background: url(images/arrowleft.png) no-repeat;
    width: 16px;
    height: 16px;
    display: block;
    cursor: pointer;
}
</style>
</head>
<body>
<!-- BuySellAds.com Ad Code -->
<script type="text/javascript">
(function(){
  var bsa = document.createElement('script');
     bsa.type = 'text/javascript';
     bsa.async = true;
     bsa.src = 'http://s3.buysellads.com/ac/bsa.js';
  (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
})();
</script>
<!-- End BuySellAds.com Ad Code -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=176533962427714";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{$header}
<a class="buttons" style="float: right;"></a>
<a class="clickedbuttons" style="float: right;"></a>
<br class="clear" />
<div class="sidebar" style="float: right;width: 19%;">
<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr><td class="thead">Register</td></tr>
<tr><td class="trow1"><a href="member.php?action=register"><img src="images/ctdarkblue/register.png" width="100%" alt="register here" /></a></td></tr>
</table>
<br />
</if>
{$sb_welcome}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>
Twitter Feed
</strong></td>
</tr>
<tr>
<td class="trow1">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 30000,
  width: 'auto',
  height: 300,
  theme: {
    shell: {
      background: '#1892c6',
      color: '#ffffff'
    },
    tweets: {
      background: '#ffffff',
      color: '#000000',
      links: '#1892c6'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('ForumKorner').start();
</script>
</td>
</tr>
</table>
<br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>
Forum Info
</strong></td>
</tr>
<tr>
<td class="trow1">
<center>
<A href="http://www.alexa.com/siteinfo/forumkorner.com"><SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/t/b?url=forumkorner.com'></SCRIPT></A>
<br />
<a href="http://www.dmca.com/" title="ForumKorner.com is DMCA protected, Don't Leach or your website will be taken down immediately."> <img src ="http://images.dmca.com/Badges/dmca_protected_3_120.png"  alt="DMCA.com" /></a>
<br />
<!-- Place this tag where you want the +1 button to render -->
<g:plusone></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
<br />
<div class="fb-like" data-href="www.ForumKorner.com" data-send="false" data-layout="button_count" data-width="50" data-show-faces="false"></div></span>
</td>
</tr>
</table>
<br />
</div>
</center>
<div class="forums" style="float: left;width: 80%;">
{$tabmenu}
{$forums}
{$recenttopics}
<script type="text/javascript">
<!--//
var myflowers=new ddtabcontent("menutabs")
myflowers.setpersist(true)
myflowers.init()
-->
</script>

</div>
<br class="clear" />
{$boardstats}

<br style="clear: both" />
{$footer}
</body>
</html>

Buy sell ads says to do this,
Install Ad Code
Step 1: Main snippet that goes right after your opening <body> tag
If you already have the code below right after the opening <body> tag in your website, skip to step 2. This should only be installed ONCE.

<!-- BuySellAds.com Ad Code -->
<script type="text/javascript">
(function(){
  var bsa = document.createElement('script');
     bsa.type = 'text/javascript';
     bsa.async = true;
     bsa.src = 'http://s3.buysellads.com/ac/bsa.js';
  (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
})();
</script>
<!-- End BuySellAds.com Ad Code -->
Step 2: Zone specific snippet
Copy and paste the following code into your website where you would like the ad(s) to be displayed. Do not change this code or its format.

<!-- BuySellAds.com Zone Code -->
<div id="bsap_1270949" class="bsarocks bsap_8a09e1f5cce3e6d8d97808f51b576be1"></div>
<!-- End BuySellAds.com Zone Code -->

I put the step two code into my advertisements plugin header, and footer ad spots.

Which the code I used for that is,
<!-- BuySellAds.com Zone Code -->
<div id="bsap_1270949" class="bsarocks bsap_8a09e1f5cce3e6d8d97808f51b576be1"></div>
<!-- End BuySellAds.com Zone Code -->
So you tried something like this?
<div style="text-align: center"><!-- BuySellAds.com Zone Code -->
<div id="bsap_1270949" class="bsarocks bsap_8a09e1f5cce3e6d8d97808f51b576be1"></div>
<!-- End BuySellAds.com Zone Code --></div>
No I haven't tried that I will right now. I currently tried this though,
<div style="clear: both"></div>
	<center>
<!-- BuySellAds.com Zone Code -->
<div id="bsap_1270949" class="bsarocks bsap_8a09e1f5cce3e6d8d97808f51b576be1"></div>
<!-- End BuySellAds.com Zone Code -->
</center>
<div style="clear: both"></div>

Dennis I just put your code up, and that is not working either. :/
Ok try this instead.

<div style="clear: both"></div>
    <div id="ad_container">
<!-- BuySellAds.com Zone Code -->
<div id="bsap_1270949" class="bsarocks bsap_8a09e1f5cce3e6d8d97808f51b576be1"></div>
<!-- End BuySellAds.com Zone Code -->
</div>
<div style="clear: both"></div>

And in your theme's global.css, add this to the bottom of the file (in advanced editor).
#ad_container a {
margin: auto;
width: 100%;
text-align: center;
}
Pages: 1 2