MyBB Community Forums

Full Version: Adding Google Adds (468x60)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi all!

I have my forum here:
http://wildteen88.xtreme-webhost.com/mybb/

and as you can see I have the frostbite theme installed

Now my problem is how would I go about making a new template to the current theme say google_adds and then use some form of code where I can add on my forum that will call the google_adds template and show the google adds thanx guys!

NOTE: I would like these to show under the "welcome block" thingy that shows when logged in and will reflect through out the forum again just like the "welcom block".
ACP -> Templates -> Modify/Delete -> header

then find the code
<div id="panel">
  <p>
  $welcomeblock
  </p>
</div>

There you go. Add it below that code.

example:

<script language="JavaScript" type="text/javascript">
 var cookieDomain = "$settings[cookiedomain]";
 var cookiePath = "$settings[cookiepath]";
</script>
		<a name="top"></a>
<table width="750px" cellpadding="0" cellspacing="0" align="center">
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td class="logo"><a href="$settings[bburl]" class="logo"><img src="$theme[logo]" alt="$settings[bbname]" border="0" /></a></td>
</tr>
</table>


<table cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td><img src="$theme[imgdir]/b_1a.gif" alt="" /></td>
    <td width="100%" class="onebg"></td>
    <td><img src="$theme[imgdir]/b_1c.gif" alt="" /></td>
  </tr>
</table>


<table cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td class="twoabg"><img src="$theme[imgdir]/b_2a.gif" alt="" /></td>
    <td width="100%" class="forumbg">
<div class="menu">$toplinks</div>
<hr class="hidden" />
<div id="panel">
  <p>
  $welcomeblock
  </p>
</div>
<div class="catfootertwo"></div>
<div id="subcontent">
			<hr class="hidden" />
				$bbclosedwarning
				$unreadreports
				<navigation>
				<br class="clear" />
[b]<center><script type="text/javascript"><!--
google_ad_client = "pub-your_client_number";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>[/b]

See it at http://www.wow-database.net/mybb/index.php
yukisho and wildteen88, doing that conflicts with google policy. Besides, its not exactly what wildteen88 wants.

I havn't tested this, but it should work:

Go to global.php, and find
if($settings['boardclosed'] == "yes")
Before add
eval("\$google_ads = \"".$templates->get("google_ads")."\";");

Next, go to Admin CP > Templates > Add > Do the following
Quote:Title: google_ads
Template: Code of the google ads goes here
Template Set: Global
but change Template: to the code of the google ads. Then click Add Template.

And finally, add
$google_ads
wherever you want the adds to display in other templates. (content pages otherwise google wont be happy).
that should work. But you have to explain the size 468x60 728x90 and so on. The way I did it is alot easier and more managable in a sense.
I edited my post above. As you will see, I put
Quote:yukisho and wildteen88, doing that conflicts with google policy. Besides, its not exactly what wildteen88 wants.
Adding to tis, you cannot put $google_ads on global template, like the toplink ones, header, footer, welcomeblock_member, or any others like it. It has to be ones that only appear on pages that have content, ie not registering pages, redirect pages, login/out pages, etc.
well I have had mine on like it is for some time and have had no problems. Its just my way of doing it.
What template is that when u click on a forum and see all the topics started?

figured it out nm
k776 Wrote:yukisho and wildteen88, doing that conflicts with google policy. Besides, its not exactly what wildteen88 wants.

I havn't tested this, but it should work:

Go to global.php, and find
if($settings['boardclosed'] == "yes")
Before add
eval("$google_ads = "".$templates->get("google_ads")."";");

Next, go to Admin CP > Templates > Add > Do the following
Quote:Title: google_ads
Template: Code of the google ads goes here
Template Set: Global
but change Template: to the code of the google ads. Then click Add Template.

And finally, add
$google_ads
wherever you want the adds to display in other templates. (content pages otherwise google wont be happy).

couldnt get it to work
I went into the Show Thread Templates and Show Forum Templates and edited the showthread file - after

$header

I put the following

<table width="100%" border="0">
<tr>
<td align="right">
<script type="text/javascript"><!--
google_ad_client = "pub-5644220309868258";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
google_color_border = "333333";
google_color_bg = "999999";
google_color_link = "000000";
google_color_url = "FF3366";
google_color_text = "FFFFFF";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table><br>


can do this to the Index Page Templates --> index
yeah, you could do that wolfden, but the idea I gave cuts back on the coding per template, so it makes it look less squished.

And opps, sorry bout that. I tested it, got it to work. So try this instead:

Go to global.php, and find
$unreadreports = "";
Before add
eval("\$google_ads = \"".$templates->get("google_ads")."\";");

Next, go to Admin CP > Templates > Add > Do the following
Quote:Title: google_ads

Template: <center><script type="text/javascript"><!--
google_ad_client = "put_your_client_number_here";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>

Template Set: Global - All Template Sets
but change put_your_client_number_here to your client number. Then click Add Template.

And finally, add
$google_ads<br />
wherever you want the adds to display in other templates that are content pages.
Pages: 1 2