coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: guchuj05 on February 22, 2008, 03:32:13 PM

Title: Add stat counter to template
Post by: guchuj05 on February 22, 2008, 03:32:13 PM
Hello,

I'm trying to add a sitemeter stat counter to the template of the Mac OSX theme, but it alters the entire page every time.  How can I do this without altering the page?  This is what I tried to do:




{META}
{CUSTOM_HEADER}
{GAL_NAME}
{GAL_DESCRIPTION}
{SUB_MENU}
{SYS_MENU}
{ADMIN_MENU} {GALLERY}
{THEME_SELECT_LIST} {LANGUAGE_SELECT_LIST}
{LANGUAGE_SELECT_FLAGS}
{CUSTOM_FOOTER}
-- Site Meter -->
<a href="http://s34.sitemeter.com/stats.asp?site=s34guchuj05" target="_top">
<img src="http://s34.sitemeter.com/meter.asp?site=s34guchuj05" alt="Site Meter" border="0"/></a>
<!-- Copyright (c)2006 Site Meter -->
{VANITY}

Any help would be appreciated.  Thanks!

Title: Re: Add stat counter to template
Post by: François Keller on February 22, 2008, 03:33:33 PM
use the custom footer feature
Title: Re: Add stat counter to template
Post by: Joachim Müller on February 22, 2008, 06:35:39 PM
Post a link to your gallery for a start - the snippet you posted above can't be the content of your template.html
Title: Re: Add stat counter to template
Post by: guchuj05 on February 24, 2008, 07:01:52 PM
Hello,

Thanks for the reply.  The link to the gallery is: http://gallery.thesportsjournal.ws/ (http://gallery.thesportsjournal.ws/)

and the code above is what was in the template file I downloaded from Mac oS X template.  Did I download it in the wrong formatt?

Thanks!

Title: Re: Add stat counter to template
Post by: Joachim Müller on February 24, 2008, 08:22:33 PM
This is the content of your custom template.html (http://gallery.thesportsjournal.ws/themes/mac_ox_x/template.html):<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/mac_ox_x/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
<!-- $Id: template.html 4100 2007-12-02 23:05:48Z nibbler999 $ -->
</head>
<body>
<div id="CUSTOM_HEADER">

  {CUSTOM_HEADER}
</div>

<div class="top_panel">
  <div class="top_panel_r">
    <div id="GAL_NAME">
      <h1>{GAL_NAME}</h1>
      <h3>{GAL_DESCRIPTION}</h3>
    </div>

  </div>
</div>
 
<div id="MENUS">
  <div id="SUB_MENU">
    {SUB_MENU}
  </div>
  <div id="SYS_MENU">
    {SYS_MENU}
  </div>
</div>

<div id="GALLERY">
  {ADMIN_MENU}
  {GALLERY}
</div>


<div id="SELECT_LISTS">
  {THEME_SELECT_LIST}
  {LANGUAGE_SELECT_LIST}
</div>


<div id="SELECT_FLAGS">
  {LANGUAGE_SELECT_FLAGS}
</div>

<div id="CUSTOM_FOOTER">
  {CUSTOM_FOOTER}
</div>

<div id="VANITY">
  {VANITY}
</div>
 
</body>
</html>

Add <div id="site_meter">
<!-- Site Meter -->
<a href="http://s34.sitemeter.com/stats.asp?site=s34guchuj05" target="_top">
<img src="http://s34.sitemeter.com/meter.asp?site=s34guchuj05" alt="Site Meter" border="0"/></a>
<!-- Copyright (c)2006 Site Meter -->
</div>
into that file right above<div id="VANITY">
  {VANITY}
</div>
and assign CSS properties as you see fit.

You're running cpg1.4.10, while the most recent stable release currently is cpg1.4.16, so you're running 6 versions behind. It's mandatory to upgrade asap as suggested in the corresponding section of the docs.
Title: Re: Add stat counter to template
Post by: skidpics on February 27, 2008, 03:10:14 AM
Prob should install it after the <body> tag and before the </body> tag. 
Title: Re: Add stat counter to template
Post by: Joachim Müller on February 27, 2008, 06:33:56 AM
Really? How surprising...
Title: Re: Add stat counter to template
Post by: skidpics on February 27, 2008, 06:40:28 AM
Quote from: Joachim Müller on February 27, 2008, 06:33:56 AM
Really? How surprising...

True.. LOL - Hey, the question was asked..  just another explanation..  right?