MyBB Community Forums

Full Version: Code Editing Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages are built up by adding various templates together. This shows quite clearly if you take a look at a page's source code: you'll see start and end comments where templates end and start.

The first location you wish to have the Google ads is above the breadcrumb navigation bar. The template responsible for this is the 'nav' template. To edit this, go to the Admin CP > Templates > Modify/Delete, expand the Navigation category and choose to change the original nav template in it. You will see something like

<div class="navigation">
$nav$activesep$activebit
</div>

You could alter this to, for example,

<div style="text-align: center">
[i]Code for Google ads here[/i]
<br><br></div>

<div class="navigation">
$nav$activesep$activebit
</div>
(the <br><br> was added to prevent the bottom of the Google ads being too close to the normal navigation bar).

Now, to put them at the bottom you should to a similar thing to another template, named footer. In it, (at the bottom of the code) you'll see something like

[size=1]<li><a href="#content">$lang->bottomlinks_returncontent</a></li>
					<li><a href="$settings[bburl]/misc.php?action=syndication">$lang->bottomlinks_syndication</a></li>
				</ul>
				<br class="clear" />
			</div>
			<div id="copyright">
				<div id="debug"><debugstuff></div>
Powered by <a href="http://www.mybboard.com">MyBulletinBoard</a> $mybboard[internalver]<br />
				Copyright &copy; 2004 <strong><a href="http://www.mybboard.com">MyBulletinBoard Group</a></strong>
		</div>
		</div>[/size]

Add your code above the <div id="copyright">. Seeing as you know HTML and I explained it for the nav template, I'm sure you can work this out on your own. If not, don't hesitate to ask further questions Smile
First go to Admin CP > Templates > Modify/Delete > *template set expand*

For #1) header > edit > put above
<navigation>
For #2) footer > edit > pout above
<div class="menu">

And finally welcome to the myBB community. Hope you enjoy being here!
Ah, I misread your second location and thought you meant below the bar. Follow k776's instructions there Smile
Hey K776 and Tochjo,

Thank you both for being so helpful, I really appreciate you guys taking your time to help out people like me with this great forum software. There's no way I am ever going back to IPB, I love MyBB :p.

I just had one last question - I decided not to put the Google Adsense in it's second spot (above the bottom menubar). I would rather put it above the "Private Messages" space, which would also be below where the forums and categories end (see this screenshot for what I mean).
Now, I'm not sure if I were to stick it in there, if it would follow everywhere you went (like if I stuck it in between those two, would it still show up when viewing a forum or a thread?). If not, essentially I would like to put the Adsense above the "Threaded Mode | Linear Mode" row in topics, and below the "Mark this forum read | Subscribe to this forum" row in forums (which is in turn above the "New Thread" button).

I don't know if this would be too complex to do or not.
I did try the footer one by K776 but I didn't like the way it shown up and how it was so close to the bottom. Is there any way what I described above is possible, or am I further ahead to go with the footer?

Once again, thank you both so much for the help Smile,
-Andy M
Quote:I would rather put it above the "Private Messages" space
Quote:if it would follow everywhere you went
No. Putting it here will mean that it will only show up on the index page since no other page have this. Are you ok with that?

header and footer templates are the only two global templates I know of. They go throguh almost all pages which means they are the wisest choice when doing what you want to do!

Quote:I don't know if this would be too complex to do or not.
Not complex, but not the wisest idea. It might muck up the layout a bit!

Quote:I did try the footer one by K776 but I didn't like the way it shown up
I showed you the place and suggestion, the exact possition and gaps between things is up to you. For eg, you could have used:
<br /><br />google code<br /><br /><div class="menu">
instead. That would have given it more room on both sides.
Thanks once again L776 Big Grin
I've done a bit of experimenting, but I finally did find out how to place the ads in the spots that I wanted, now everything is working in good shape Smile