Gallery2 templated pages will not render

I’ve installed Piwik 0.5.4 and inserted the code into two areas of my site. One area is basic php and the code works perfectly. However, when I attempt to insert the code into the main template (theme.tpl) for my Gallery2 installation (replacing the existing phpMyVisites code) the pages fail to render. I’ve looked over the code and can’t figure out what might be causing this. Any suggestions?

I’ve included below the file I’ve been attempting to insert the code into.

Thank you.

{*
 * $Revision: 2.01 $ $Date: 2006/08/03 $
 * 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 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
  	{* Set the GALLERY2 Favicon for the GALLERY pages *}
    {* Include this theme's style sheet *}
    <link rel="stylesheet" type="text/css" media="screen" href="{g->theme url="theme-css.php"}"/>
	<link rel="stylesheet" type="text/css" href="{g->theme url="images/lb/css/lightbox-css.php"}"/>   
    <script type="text/javascript" src="{g->theme url='theme.js'}">
    </script>    
  	
{* 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)}
  {if !isset($SlideShow)}
    <title>
    {if $theme.params.site}
      {$theme.params.site} - 
    {/if}
    {$theme.item.title|default:$theme.item.pathComponent|markup:strip}</title>
  {/if}
{/if}
{g->callback type="customfield.LoadCustomFields" itemId=$item.id|default:$theme.item.id}

<meta http-equiv="imagetoolbar" content="no"/>
{if !isset($SlideShow)}
<meta name="keywords" content="{if !empty($block.customfield.LoadCustomFields.fields.meta_tags)}{$block.customfield.LoadCustomFields.fields.meta_tags}{/if}, Kevin Pieper, Photography, Photo, Photograph, Photographer, Photog, Pictures, Pics, Pix, Shots, Foto, High Resolution, High Res, Hi Res, Digital, Nature, Outdoor, Landscape, Fine Art, Print, Prints, Northwest, NW, Pacific Northwest, PNW, Southwest, SW, West" />
<meta name="description" content="{$theme.item.description|markup:strip}" />
{/if}
    
    {assign var="separator" value=$theme.params.MenuSeparator}


    {*
     * set variables to use as icons URL for theme or colorpacks
     *}

  {capture assign="imageURL_base"}{g->theme url='images/'}{/capture}

  {capture assign="colorpackURL"}{g->url href='modules/colorpack/packs/'}{/capture}
  {assign var="colorpack" value=$theme.params.colorpack}

{if $theme.params.colorpack}
  {capture assign="colorpackURL"}{g->url href='modules/colorpack/packs/'}{/capture}
  {assign var="colorpack" value=$theme.params.colorpack}

  {assign var="imageURL_baseCP" value=$colorpackURL$colorpack/images/}

  {if $theme.params.icons == 'set1_plan'}
    {assign var="imageURL" value=$colorpackURL$colorpack/images/set1/}
    {assign var="imageURL_on" value=$colorpackURL$colorpack/images/set1/}
  {/if}
  {if $theme.params.icons == 'set1_3d'}
    {assign var="imageURL" value=$colorpackURL$colorpack/images/set1/3d/}
    {assign var="imageURL_on" value=$colorpackURL$colorpack/images/set1/3d_on/}
  {/if}
  {if $theme.params.icons == 'set1_3d_on'}
    {assign var="imageURL" value=$colorpackURL$colorpack/images/set1/}
    {assign var="imageURL_on" value=$colorpackURL$colorpack/images/set1/3d_on/}
  {/if}
  {if $theme.params.icons == 'set2'}
    {assign var="imageURL" value=$colorpackURL$colorpack/images/set2/}
    {assign var="imageURL_on" value=$colorpackURL$colorpack/images/set2/}
  {/if}
{else}
  {capture assign="imageURL_baseCP"}{g->theme url='images/'}{/capture}
  {if $theme.params.icons == 'set1_plan'}
    {capture assign="imageURL"}{g->theme url='images/set1/'}{/capture}
    {capture assign="imageURL_on"}{g->theme url='images/set1/'}{/capture}
  {/if}
  {if $theme.params.icons == 'set1_3d'}
    {capture assign="imageURL"}{g->theme url='images/set1/3d/'}{/capture}
    {capture assign="imageURL_on"}{g->theme url='images/set1/3d_on/'}{/capture}
  {/if}
  {if $theme.params.icons == 'set1_3d_on'}
    {capture assign="imageURL"}{g->theme url='images/set1/'}{/capture}
    {capture assign="imageURL_on"}{g->theme url='images/set1/3d_on/'}{/capture}
  {/if}
  {if $theme.params.icons == 'set2'}
    {capture assign="imageURL"}{g->theme url='images/set2/'}{/capture}
    {capture assign="imageURL_on"}{g->theme url='images/set2/'}{/capture}
  {/if}
{/if}


    {*
     * Set images tu use as background if option is selected
     *}

{if ($theme.params.bg != 'none') || ($theme.params.bg1 != 'none') || ($theme.params.bg2 != 'none') || $theme.params.Tborder || $theme.params.TborderColor || $theme.params.SIborder || $theme.params.SIborderColor}
  <style type="text/css">

{if $theme.params.bg != 'none'}
    {literal}
#gallery {background: url('{/literal}{$imageURL_baseCP}background/{$theme.params.bg}{literal}.gif') repeat 0 1px;}
body.gallery {background: url('{/literal}{$imageURL_baseCP}background/{$theme.params.bg}{literal}.gif') repeat 0 1px;}
    {/literal}
{/if}

{if $theme.params.bg1 != 'none'}
    {literal}
.gcBackground1 { background: url('{/literal}{$imageURL_baseCP}background/{$theme.params.bg1}{literal}.gif') repeat 0 1px;}
    {/literal}
{/if}

{if $theme.params.bg2 != 'none'}
    {literal}
.gcBackground2 { background: url('{/literal}{$imageURL_baseCP}background/{$theme.params.bg2}{literal}.gif') repeat 0 1px;}
    {/literal}
{/if}


    {*
     * Set border to THUMBNAILS
     *}

{if $theme.params.Tborder || $theme.params.TborderColor}
    {literal}
.giThumbnail {border:{/literal}{if $theme.params.Tborder}{$theme.params.Tborder}{else}1{/if}{literal}px solid {/literal}
{if $theme.params.TborderColor}{$theme.params.TborderColor}{else}black{/if}
{literal} !important; }
    {/literal}
{/if}

    {*
     * Set border to IMAGES
     *}

{if $theme.params.SIborder || $theme.params.SIborderColor}
    {literal}
.gsSingleImage {border:{/literal}{if $theme.params.SIborder}{$theme.params.SIborder}{else}1{/if}{literal}px solid
{/literal}
{if $theme.params.SIborderColor}{$theme.params.SIborderColor}{else}black{/if}
{literal} !important; }
.gsSingleImageNoF {border:{/literal}{if $theme.params.SIborder}{$theme.params.SIborder}{else}1{/if}{literal}px solid
{/literal}
{if $theme.params.SIborderColor}{$theme.params.SIborderColor}{else}black{/if}
{literal} !important; }
    {/literal}
{/if}

  </style>
{/if}

   </head>
  <body class="gallery">
    <div {g->mainDivAttributes} z-index:100;>
    {*
     * 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}


        {if ($theme.params.iestatus) || ($theme.params.expand) || ($theme.params.RightClick!="none")}
        {literal}
          <script type="text/JavaScript">
          //<![CDATA[
          <!--

        {/literal}{if $theme.params.iestatus}{literal}
            function wst(){
        {/literal}
              window.status="{$theme.params.site}";
        {literal}
                      window.setTimeout("wst()",1);
            }
           wst()
        {/literal}{/if}{literal}

        {/literal}{if $theme.params.expand}{literal}
            expand();
        {/literal}{/if}{literal}

        {/literal}{if $theme.params.RightClick=="disable"}{literal}

function click(e) 
{
     if (navigator.appName == "Microsoft Internet Explorer" && (event.button == "2" || event.button == "3"))
     {return false;}
     if (document.layers || (document.getElementById && !document.all))
     {
          if (e.which == "2" || e.which == "3")
          { return false;}
     }
}
document.onmousedown=click;document.onmouseup=click;
document.oncontextmenu=new Function("return false");
        {/literal}{/if}{literal}
        {/literal}{if $theme.params.RightClick=="alert" && $theme.params.sidebar=="floating"}{literal}
              var msgmouse="{/literal}© Copyright - {$theme.params.site}{literal}" 
              //Mouse Rigt click 'msg'

function click(e) 
{
     if (navigator.appName == "Microsoft Internet Explorer" && (event.button == "2" || event.button == "3"))
     {alert(msgmouse);return false;}
     if (document.layers || (document.getElementById && !document.all))
     {
          if (e.which == "2" || e.which == "3")
          {alert(msgmouse);return false;}
     }
}
document.onmousedown=click;document.onmouseup=click;
document.oncontextmenu=new Function("return false");
        {/literal}{/if}{literal}

        {/literal}{if $theme.params.RightClick=="options" && $theme.params.sidebar=="floating"}{literal}
function click(e) 
{
     if (navigator.appName == "Microsoft Internet Explorer" && (event.button == "2" || event.button == "3"))
     {a=ShowLayer('actions','visible');return false;}
     if (document.layers || (document.getElementById && !document.all))
     {
          if (e.which == "2" || e.which == "3")
          {a=ShowLayer('actions','visible');return false;}
     }
}
document.onmousedown=click;document.onmouseup=click;
document.oncontextmenu=new Function("return false");
        {/literal}{/if}{literal}

            //-->
            //]]>
            </script>
{/literal}
        {/if}

		<table style="width:910px" cellspacing="0" cellpadding="0">
            <tr><div id="gsHeader">
              <td nowrap="nowrap">
{g->theme include="header.tpl"}
</td>  
            </div>
            </tr>
			<tr>
			<td>
      
        {* 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}

</td></tr>
<tr><td>
        <div id="gsFooter">
          {g->theme include="footer.tpl"}
        </div>
      {/if}  {* end of full screen check *}
</td></tr>
</table>	        

    {*
     * 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 wont work properly.
     *}

    {g->trailer}
    {* Put any debugging output here, if debugging is enabled *}
    {g->debug}
	
<!-- phpmyvisites -->
<script type="text/javascript">
<!--
var a_vars = Array();
var pagename = document.title;

var phpmyvisitesSite = 1;
var phpmyvisitesURL = "www.pieperphotography.net/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="www.pieperphotography.net/phpmv2/phpmyvisites.js" type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
</p></noscript></object></a>
<!-- /phpmyvisites -->

<!-- lightbox -->
    <script type="text/javascript" src="{g->theme url='images/lb/js/prototype.js'}"></script>
    <script type="text/javascript" src="{g->theme url='images/lb/js/scriptaculous.js'}"></script>
    <script type="text/javascript" src="{g->theme url='images/lb/js/lightbox.js'}"></script>
<!-- /lightbox -->
  </body>
</html>

Wrap it inside {literal}…{/literal}.

Worked perfectly! Thank you!! style_emoticons/<#EMO_DIR#>/biggrin.gif