ads gallery help

Status
Not open for further replies.

rickyc88

New Member
Messages
3
Reaction score
0
Points
0
site rickyc.exofire.net
How do I put corporate ad's on every page of gallery
rickyc.exofire.net/gallery
 

Christopher

Retired
Messages
14,659
Reaction score
8
Points
0
This is a modified version of http://codex.gallery2.org/Gallery2:How_to_add_adsense

First, FTP into your web site and create a new directory (folder) called 'local' in the templates folder of the theme you are using.

Then create a new .tpl file under /gallery2/themes/matrix/templates/local/

A quick an easy way to create a new .tpl file is to open up Notepad in Windows (don't use Word Pad as it will insert formatting) and type (copy) your code. When you go to save the file, just save it as .tpl instead of .txt.

Call it x10ad.tpl

Edit this file and insert the following code (insert it anywhere since this file will be blank):

Code:
{php}
$adcode = <<<END
<script type="text/javascript" src="http://x10hosting.com/adserve.js?corporate"></script>
END;
echo $adcode;
{/php}

Now you have to copy /gallery2/themes/matrix/templates/theme.tpl to /gallery2/themes/matrix/templates/local/ (create the directory if it does not exist) and edit /gallery2/themes/matrix/templates/local/theme.tpl

After the logo line (before </div>) add this code:

Code:
{if $theme.pageType == 'album' || $theme.pageType == 'photo'}
{g->theme include="x10ad.tpl"}
{/if}

That's it!
 
Last edited:
Status
Not open for further replies.
Top