Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Burning in google ad, how?

Aloittaja borgqueenx, joulukuu 19, 2011, 11:48:35 AP

« edellinen - seuraava »

borgqueenx

i want to place a google ad next to the linktree on top of the forum - wich shows category, topic title ect.
I have the custom headers and footers mod installed, but it placed the google ad under it. i want no space between the linktree and first forum.

thanks!

kat

Ah... I thought you'd tried the Ad Management mod.

That'd do it, for you! :)

borgqueenx

cant install it - guess what. error modyfying some current theme files.... LOL this theme is bringing me hell, sort of :P
So i need someone who knows where to hardcode it so it works...
what line to find and then where to place the google ad code with maybe a extra piece of code.

Matthew K.

Look in index.template.php ;) You'd ad your code right above theme_linktree();, although if you don't follow PHP syntax, you could cause a syntax error.

You have to echo ''; markup, such as: echo '<div>This is my HTML</div>';

borgqueenx

thanks, thats a start.
please check out www.reviewty.com

its at least above the linktree now. but its not quite what i ment. it still leaves a big gap between the logo and linktree now, while that is not nessacary at all, as you can see.
is this fixable?

Matthew K.


borgqueenx

you do not see this big gap?  :o
it does on my pc...
http://reviewty.com/naamloos.png

(in red block marked)

Matthew K.

It looks slightly different in the guest view, obviously. Although to me, I wouldn't define that as a big gap, it's following the flow of the parent divs.

borgqueenx

i cant put it next to the logo then?
(i first asked for above linktree because i thought that would resolve the gap).

and i appriciate the fast replys :)

Matthew K.

You could...although it'd be a little bit more tricky than it sounds.

borgqueenx

i have to chance alot more files?
can you please explain what to do and the riscs?
(i learned to backup every time now ^^)

Matthew K.

There aren't risks, assuming you know some CSS, (X)HTML, and even basic PHP Syntax (enough not to break the syntax, such as line-endings, statements, and outputting code [echo's mainly]).

You'll just need to put the Google Ad code inside a div that's floating right, the div will also contain either the member information, or the guest login form.

borgqueenx

#12
i already tried some (to me) obvious places, im not getting a syntax error, just nothing at all.
this is what im trying to copy and paste:
echo '<div style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-11111111111111111";
/* reviewty image */
google_ad_slot = "111111111111111";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>';


after parts like these:
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
or after:
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))


could you please give me a area where i should add my code? ^^

Advertisement: