Adsense in Gallery

koolpalace

Joined: 2005-10-19
Posts: 1
Posted: Wed, 2005-10-19 09:18

Hello,
Can someone please tell me how to use google adsense code in gallery.. In which file do I have to paste the code? I know its a silly question but I could not use adsesne in gallery.. Please help me...

 
paulbearne

Joined: 2005-08-01
Posts: 87
Posted: Wed, 2005-10-19 11:55

Hi

Yes I can do this

Have a look at www.swindonGallery.org.uk

These instuctions are for the matrix theme but they should be same for the other themes

you need go to gallery2/themes/matrix/templates and make a folder called "local"

them copy into this folder from the template folder the file called theme.tpl

now open gallery2/themes/matrix/templates/local/theme.tpl in an text editor

and look for ( in my case ) <div id="gsFooter"> and add a div with the addsence code inside as below

<div id="footerAddBlock">
<script type="text/javascript"><!--
google_ad_client = "pub-3133210812009797";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div id="gsFooter">
{g->logoButton type="validation"}
{g->logoButton type="gallery2"}
{g->logoButton type="gallery2-version"}
</div>

This will put a google addsnece block at the bottom most pages

I have also edited the theme.css again copying it to a local folder (ie. gallery2/themes/matrix/local/theme.css)

I added this block to tidy up the div

#footerAddBlock{
display:block;
text-align: center;
padding:2px 0 2px 0px;
font-weight:bold;
background-color:#EEEEEE;
}

I hope this will help

Paul

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2005-10-19 13:25

coolplace,
paulbearne gave directions for G2 if you want to do this for G1 then you have to paste the code in a html_wrap file. Depending on the location where you want the add to show. Read the stickies on how to work with the html_wrap files.

Dave

____________________________________________________
Gallery Frames / Mods || G1 Test Gallery

 
johanhorak

Joined: 2005-10-23
Posts: 13
Posted: Thu, 2005-10-27 10:30

Hi Paul

I have done what you have said to the T - i hope.

when I looed at the view source of the main page I saw this:

<a href="javascript:alert('Validation disabled until you set allowSessionAccess in config.php');">

Is this something I need to do and if so how?

http://www.thegoodbadandugly.info/gallery2/main.php?

Regards

Johan

http://www.copywriting-tactics.com

 
paulbearne

Joined: 2005-08-01
Posts: 87
Posted: Thu, 2005-10-27 13:20

Hi

I have had a look and it seems to be working OK

then I spotted the junk in the thumbnail text

Go back to the template and make sure you haven't droped so of the code elsewhere on the page

this is stange!!

post the code here if you can't fix it

Paul

PS have a look at our good bad and ugly swindonGallery.org.uk

 
ricaw

Joined: 2006-04-03
Posts: 2
Posted: Wed, 2006-05-31 17:27

Hi all. I placed the AdSense code in my page (www.wright.com.br/gallery2/) but with AdSense code I can't upload the pictures using the Windows XP Publisher Tool because I can't login in the page. Anyone know why?

 
jkimbo

Joined: 2006-12-29
Posts: 18
Posted: Fri, 2006-12-29 21:11

I tried this and the adsense does not show, not even a public service ad will show. I have version 2.1.2

any suggestions?

 
paulbearne

Joined: 2005-08-01
Posts: 87
Posted: Sat, 2006-12-30 12:00

Can I have an URL

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2006-12-30 18:31

Not the URL but a Codex page that might help:
http://codex.gallery2.org/index.php/Gallery2:How_to_add_adsense

Dave
____________________________________________________
Blog with G2 || G2 theme contest: $3K in Prizes

 
bluejam

Joined: 2007-01-15
Posts: 1
Posted: Mon, 2007-01-15 02:07

EDIT - Fixed...!

If anyone else has this issue - clear your caches in the admin page
------------

well this balled up my gallery!
I did the code thing - but had a few issues to deleted the new 'local' directory.

I now cannot access my gallery at all!

I get this:

Security Violation
The action you attempted is not permitted.

Back to the Gallery
http://steveandciara.com/gallery2/main.php?g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT

Please can some advise how this has locked the gallery out??

thanks in advance

Steve