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!