How can I add google adsense
magicphoto
Joined: 2006-09-28
Posts: 1 |
![]() |
Hi, I found instructions on how to add google adsense to both footer and header. However, I'd like to add a google adsense banner to the right side of the pic when being viewed (post clicking on the thumbnail). How can this be done? Thanks again for your help! Magic |
|
baloch4
Joined: 2007-02-19
Posts: 8 |
![]() |
I think this is the best way to place google ads anywhere you want to place it on your gallery and i asure you that it works you can see it on my site http://www.junkinside.com/picture-gallery/ The page is missing one vital element for the novice coder. You need to surround your google addstuff with single quotes. I will use myself as an example, just because I know what I did: First off, you can see this working at http://www.junkinside.com/picture-gallery/ I went to google and requested some text add scripts, went through and got the settings for a vertical and a horizontal banner. Than I went to my gallery/themes/matrix/templates directory and created a new directory called local. Please note, I'm following the instructions on that page precisely, However, what I'm doing is surrounding my adcode in single quotes. It seemed logical to me and it worked, but then I am halfway familiar with PHP. I followed the same process to create a footer template, only calling it adsense-footertext.tpl Now, the next step is to COPY the album.tpl, photo.tpl, and sidebar.tpl from the template directory to the local directory. IE from gallery/themes/matrix/templates to gallery/themes/matrix/templates/local Now, you will only edit the files in the local directory! Edits to the templates directory will be ignored. To add a sidebar under the random image, I edited sidebar.tpl </div> To add the footer to the main window(but I wanted it IN the window, not at the page bottom] I edited 2 templates: To add a footer underneath the full sized photo's I edited photo.tpl, changing So that is the basics. Similiar actions can be taken for the top and footer. Advanced functionality I want to look into 1) Display a sidebar of ads next to an image(since many of my images don't fill the screen) 2) Display google ads in the midst of an list of thumbnails when viewing an album, or in the middle of a list of albums. Of the two, I am likely to do the former, but unlikely to do the latter since I truely don't want the ads showing up in my own personal album there, I just want to do it as an exercise in learning how to do it. |
|
bigu_c
![]()
Joined: 2007-10-28
Posts: 421 |
![]() |
detected: Trojan program Trojan-Clicker.JS.Agent.h URL: http://www.junkinside.com/picture-gallery/main.php//main |
|