Gallery 2.1 Google Ads Module

SamBeckett
SamBeckett's picture

Joined: 2002-09-29
Posts: 146
Posted: Sun, 2006-03-12 11:11

I can't seem to find any modules that let you insert google ads into Gallery.

Where are they?! thank you

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2006-03-13 01:38

there is none.

 
SamBeckett
SamBeckett's picture

Joined: 2002-09-29
Posts: 146
Posted: Mon, 2006-03-13 07:07

Why not? I would think this would be highly requested.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2006-03-15 04:29

we had someone working on this a year ago. then this person disappeared, was there again etc.
bottom line:
it's far from finished and doesn't work at all, and currently noone is working on it.

 
SamBeckett
SamBeckett's picture

Joined: 2002-09-29
Posts: 146
Posted: Wed, 2006-03-15 06:09

guess I could try to make one then.

starting with 1 basic feature

1) on/off select in admin modules options
2) textarea box where you paste any html code (the google, or any other ad code) in admin modules options
3) this code will then be inserted below the main header on every album and image page, excluding pages like edit, add images and admin

--when I'm done where should I send this?

 
rso

Joined: 2006-05-15
Posts: 6
Posted: Mon, 2006-05-15 15:08

I am really looking forward to your module!
Another possible option could be that you put the google ads on the naviation bar on the left. There you can already change the order of the displayed modules like random image or language settings.

Thanks

Richard

 
SamBeckett
SamBeckett's picture

Joined: 2002-09-29
Posts: 146
Posted: Mon, 2006-05-15 17:44

Ok, this is what you can do:

edit your theme.tpl and after the header section, and the logo but befor the closing </div>
add <center> so your ads are in the center, then your google code.

This will put your google banner on every page. and it is a simple edit.

in my case it was /home/www.mydomain.com/http/gallery2/themes/matrix/templates/theme.tpl

Quote:
{*
* $Revision: 1.11 $
* If you want to customize this file, do not edit it directly since future upgrades
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
* version. Gallery will look for that file first and use it if it exists.
*}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
{* Let Gallery print out anything it wants to put into the <head> element *}
{g->head}

{* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
{if empty($head.title)}
<title>{$theme.item.title|default:$theme.item.pathComponent|markup:strip}</title>
{/if}

{* Include this theme's style sheet *}
<link rel="stylesheet" type="text/css" href="{g->theme url="theme.css"}"/>
</head>
<body class="gallery">
<div {g->mainDivAttributes}>
{*
* Some module views (eg slideshow) want the full screen. So for those, we
* don't draw a header, footer, navbar, etc. Those views are responsible for
* drawing everything.
*}
{if $theme.useFullScreen}
{include file="gallery:`$theme.moduleTemplate`" l10Domain=$theme.moduleL10Domain}
{else}
<div id="gsHeader">
<img src="{g->url href="images/galleryLogo_sm.gif"}" width="107" height="48" alt=""/>
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-2452741204855045";
google_alternate_color = "FFFFFF";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="7780549065";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div>

<div id="gsNavBar" class="gcBorder1">
<div class="gbSystemLinks">
{g->block type="core.SystemLinks"
order="core.SiteAdmin core.YourAccount core.Login core.Logout"
othersAt=4}
</div>

<div class="gbBreadCrumb">
{g->block type="core.BreadCrumb"}
</div>
</div>

{* Include the appropriate content type for the page we want to draw. *}
{if $theme.pageType == 'album'}
{g->theme include="album.tpl"}
{elseif $theme.pageType == 'photo'}
{g->theme include="photo.tpl"}
{elseif $theme.pageType == 'admin'}
{g->theme include="admin.tpl"}
{elseif $theme.pageType == 'module'}
{g->theme include="module.tpl"}
{elseif $theme.pageType == 'progressbar'}
{g->theme include="progressbar.tpl"}
{/if}

<div id="gsFooter">
{g->logoButton type="validation"}
{g->logoButton type="gallery2"}
{g->logoButton type="gallery2-version"}
{g->logoButton type="donate"}
</div>
{/if} {* end of full screen check *}
</div>

{*
* Give Gallery a chance to output any cleanup code, like javascript that
* needs to be run at the end of the <body> tag. If you take this out, some
* code won't work properly.
*}
{g->trailer}

{* Put any debugging output here, if debugging is enabled *}
{g->debug}
</body>
</html>

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Fri, 2006-05-19 02:25

Theres a few themes out there that make inserting ads very easy what they do is include it in the theme.tpl as say "ads.tpl" then in ads.tpl you can just paste you google adsense code or whatever ad or code you want, or leave it empty and it wont shop up. Something like {g->theme include="ads.tpl"} , that way you ad code is organized better as a seperate file instead of being inserted right into the theme.tpl.

 
conan

Joined: 2006-07-06
Posts: 9
Posted: Sat, 2006-07-22 06:29

Just did this - easy and gets those multiple album hits to pay (hopefully)

[url]www.conanstevens.com[/url]