Insert ad script footer in core theme

Started by dabigben, September 29, 2014, 04:10:52 PM

Previous topic - Next topic

dabigben

Hello !

I have to put an ad script in the footer of my forum, and the ad management plugin doesn't display it. I would like to put the code manually in the index.template.php file but I don't know where, I tried differents places but it makes crash the forum. Can you help me please ?

The script is

----------------------
<script type='text/javascript'>sas_pageid='64402/495613';  sas_formatid=26328;  sas_target=""; </script><script type='text/javascript' src='http://ads.themoneytizer.com/script'></script>
----------------------

I guess I have to put it between something like

echo ' ***script*** ' ;

Isn't it ? But I don't know where..

Thanks a lot.


Kindred

Well, you definitely can not put it in like that.., single quotes would have to be escaped...

What do you mean the ad management mod doesn't display it?

The code that you included does not display?
If so, then adding it directly in to the template won't work any better...

Of the ad a management mod doesn't have the specific location that you want it displayed at?
If so, post in the mod support topic and the author can help you add a new location.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

dabigben

Hello,

I would like to put a banner at the bottom of the categories.

I already added a banner on the top putting the script (in the index.template.php) this way :

------------------------------------
   // Show the menu here, according to the menu sub template.

   template_menu();

echo ' <br/>';

echo '<center><script type=\'text/javascript\'>sas_pageid=\'64402/495613\';  sas_formatid=26322;  sas_target=""; </script><script type=\'text/javascript\' src=\'http://ads.themoneytizer.com/script\'></script></center>';



   // Show the navigation tree.

   theme_linktree();



   // The main content should go here.

   echo '

   <div id="bodyarea">';

------------------------------------

and it works that's why I think there's a way to do the same with the bottom ad ?

The Ad Management mod doesn't display the ad - I ticked the "Display ads on the bottom of the page" box, is it right ?

Sorry for my English , I try hard :)

Ben.

dabigben

Any idea ?

At least to make work the ad manager mod ?

Westwegoman

I use the ad management mod and it works for me. Are you sure you are you entering it correctly? Although I use Google on mine, seems like it should work for you.
Also, make sure you have the ad set to display in that location in settings.
<div align="center">
<br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxx";
/* 728x90 White BG default */
google_ad_slot = "xxxxxxxxxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


dabigben

Sorry it doesn't work..

I don't know, when I set the ad management it returns no error but doesn't display the script.

I just put name, then I paste the script code, and finally I tick the "Display ads on the bottom of the page" to have the ad at the bottom of all pages am I right ?

There's nothing else to do ?

dabigben

Edit  : I forgot to say that the ad plugin works with the ads at the right.

For the top banner I had to cheat manually with the index.templates.php cause the ad plugin didn't work.

And finally for the bottom banner the ad plugin also doesn't work.

*The ad company says to put the bottom banner code in the header, I don't know how to do it manually..


mashby

You were able to put this at the top, right? Have you tried putting a copy of what you put at the top in the bottom? I'm not familiar with the core theme, but the area would be function template_body_below(). Somewhere in there should work.
Always be a little kinder than necessary.
- James M. Barrie

dabigben

I know I tried to copy the first code at the end like you say, I tried a lot of places but all times it crashes the site..I just tried again but nothing more..

mashby

Crashes the site as in the code you inserted isn't quite right? How are you inserting the code? Where and what? :)
Always be a little kinder than necessary.
- James M. Barrie

dabigben

In fact  i try to invent xD

The first time with the top banner, I put the script like this in the index.templates.php :

------------------------------------
   // Show the menu here, according to the menu sub template.

   template_menu();

echo ' <br/>';

echo '<center><script type=\'text/javascript\'>sas_pageid=\'64402/495613\';  sas_formatid=26322;  sas_target=""; </script><script type=\'text/javascript\' src=\'http://ads.themoneytizer.com/script\'> [nofollow]</script></center>';

   // Show the navigation tree.

   theme_linktree();

// The main content should go here.

   echo '

   <div id="bodyarea">';

------------------------------------

it's working this way so I thought I could do the same with the bottom banner ! But I don't find how..

mashby

OK, just for fun as I only have a few more minutes before this stupid baseball game ends and I have to get to bed...would you mind attaching the index.template.php file and a link to where this is being used?
Always be a little kinder than necessary.
- James M. Barrie

dabigben

file attached.

code to put :

<script type='text/javascript'>sas_pageid='64402/495613';  sas_formatid=26328;  sas_target=""; </script><script type='text/javascript' src='http://ads.themoneytizer.com/script'></script>

Website :

www.infotrucs.fr

Thanks..

mashby

Hmm...there is a lot of whitespace in this file...I'll see what I can do. I used Delete Blank Lines in Notepad++ which from my experience isn't always reliable, but try the attached? If it fails, you always have your attachment above as a backup.
Always be a little kinder than necessary.
- James M. Barrie

dabigben

Sorry the site is down :

www.infotrucs.fr

it says "unable to load 'main_above' model

just like everytimes I tried

mashby

OK, please put your previous file back. :)

The remove blank lines likely is the issue. Sorry about that. I can see the Ad Management mod code in here though. Might be worth asking how to get that operational.
Always be a little kinder than necessary.
- James M. Barrie

dabigben

the ad management plugin is used to display two ads at the right of the site. Unfortunately the plugin doesn't wants to work with top or bottom banners..And also everything is in English so maybe I miss something..

dabigben

I finally put my script in every post's bottom, it's really what I wanted so if someone knows how to put an ad at the bottom of the core theme, without plugin, please let me know !

Bye !

Advertisement: