Forum Moderators: martinibuster

Message Too Old, No Replies

Adding adsense to tpl file using notepad++

ad not displaying. hope this is the right forum for this question

         

emdubl

3:19 am on Oct 7, 2010 (gmt 0)

10+ Year Member



Hello,

I am trying to edit a website for someone and add an additional adsense ad block. I am not the original coder of the website and the site already has one working adsense banner in the footer. (code is placed in footer.tpl file).

I am trying to add an additional ad block to a div box on the lower right side of the index page. I am adding the code to index.tpl.

In Firefox the ad just does not appear and the box is empty. In IE, it displays a "The webpage cannot be.." error in the box (full error msg is cutoff).

I'm trying to edit the file using notepad++. If you look at the source code for the page, it looks like the code is there, but all whitespace is being removed for some reason and I don't know if that is the issue or not.

Any ideas?

[edited by: incrediBILL at 5:04 am (utc) on Oct 7, 2010]
[edit reason] removed URL, see TOS #13 [webmasterworld.com...] [/edit]

rajivatre

3:31 am on Oct 7, 2010 (gmt 0)

10+ Year Member



I am no expert in javascript, but it seems that you need to add new line character at the end of each line of google adsense code.
Without it the code looks to be changed and may not be executing properly.
Just my 2 cents.

Thanks
Rajiv

emdubl

3:40 am on Oct 7, 2010 (gmt 0)

10+ Year Member



thanks for the reply.

that's why i dont know if notepad++ is the issue or not. when i edit it in the editor, it has the new line characters after each line. but when i ftp the file to the server, it seems that they are being stripped out. i'm copying / pasting the adsense code directly from the code given to me from the adsense setup.

emdubl

3:57 am on Oct 7, 2010 (gmt 0)

10+ Year Member



hmm, maybe an issue with notepadd++ or the file. when i re-edit the file in regular notepad, it seems to replace all CR, with CRLF. i guess this fixed the issue.

thanks.

rajivatre

5:11 pm on Oct 7, 2010 (gmt 0)

10+ Year Member



emdubl,
I am glad i could help you.

Thanks
Rajiv

Sgt_Kickaxe

12:29 am on Oct 9, 2010 (gmt 0)



.tpl file = phpbb forum correct ?

Some applications that include multiple pages to create a full page do some funny things to code including adding tags and removing linebreaks. That's the case with some phpbb templates, adding "\n" works for line breaks.