Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: borgqueenx - joulukuu 19, 2011, 11:48:35 AP

Otsikko: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 11:48:35 AP
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!
Otsikko: Re: Burning in google ad, how?
Kirjoitti: kat - joulukuu 19, 2011, 12:43:09 IP
Ah... I thought you'd tried the Ad Management mod.

That'd do it, for you! :)
Otsikko: Re: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 02:04:02 IP
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.
Otsikko: Re: Burning in google ad, how?
Kirjoitti: Matthew K. - joulukuu 19, 2011, 02:20:11 IP
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>';
Otsikko: Re: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 02:31:05 IP
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?
Otsikko: Re: Burning in google ad, how?
Kirjoitti: Matthew K. - joulukuu 19, 2011, 02:32:00 IP
Looks fine to me...
Otsikko: Re: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 02:35:08 IP
you do not see this big gap?  :o
it does on my pc...
http://reviewty.com/naamloos.png

(in red block marked)
Otsikko: Re: Burning in google ad, how?
Kirjoitti: Matthew K. - joulukuu 19, 2011, 02:35:59 IP
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.
Otsikko: Re: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 02:41:52 IP
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 :)
Otsikko: Re: Burning in google ad, how?
Kirjoitti: Matthew K. - joulukuu 19, 2011, 02:49:22 IP
You could...although it'd be a little bit more tricky than it sounds.
Otsikko: Re: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 03:01:39 IP
i have to chance alot more files?
can you please explain what to do and the riscs?
(i learned to backup every time now ^^)
Otsikko: Re: Burning in google ad, how?
Kirjoitti: Matthew K. - joulukuu 19, 2011, 03:04:01 IP
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.
Otsikko: Re: Burning in google ad, how?
Kirjoitti: borgqueenx - joulukuu 19, 2011, 03:22:08 IP
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? ^^