PDA

View Full Version : Statcounter


noodles
09-05-2008, 12:16 AM
Hi There,

Can someone please tell me how and where to add the code for statcounter to work on my site? Is it on index.php?

Please help. Thanks in advance.

Trauko
09-05-2008, 02:16 AM
Place it in image_template.html,
insert after the <body> tag and before the </body> tag.

<body>
....
....
<div id="footer">
...
statcounter code
.....
</div>
</body>

noodles
09-05-2008, 09:34 PM
Thank you! I'll give it a go now.... :)

noodles
09-05-2008, 09:51 PM
It didn't work...

dhdesign
09-05-2008, 11:51 PM
noodles -

Can you insert the code into image_template.html, as below, and leave it there so one of us can troubleshoot this for you? We can't see what's going wrong if the code isn't there to check on your site.

<br clear="all" />

-- insert statcounter code here --

</body>
</html>

ps/ Great blog - love the photos. I might have to try out some of those recipes. ;)

noodles
09-06-2008, 10:19 AM
Thanks, i will try again!

noodles
09-06-2008, 10:29 AM
Hi, i have just done as instructed however, when i go to my site, the main image is not showing...? It's also doing something funny with my css i.e., comment section. The counter is at the bottom of the image though before you click on the 'info/comments' section.

Please would you mind taking a look again for me? Here's my image_template.html codes

Oh, and thank you so much for the compliment! :)


<!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">

<head>

<title><SITE_TITLE></title>
<meta name="description" content="" />
<meta name="keywords" content="" />

<link rel="stylesheet" type="text/css" href="../Downloads/templates/osiris/styles/light.css" title="light" />
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="../Downloads/index.php?x=rss" />
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="../Downloads/index.php?x=atom" />

<style type="text/css" media="screen">
#copyright {
text-align: center;
color: <HARMONIOUS_NORMAL>;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, sans-serif;
font-size: 11px;
background-color: #FFFFFF;
}

#copyright a,
#copyright a:link,
#copyright a:visited {
color: <HARMONIOUS_NORMAL>;
text-decoration: none;
font-weight: normal;
}

body{
background-color: <HARMONIOUS_DARK>;
color: <HARMONIOUS_NORMAL>;
}

#info {
text-align: center;
color: #FFFFFF;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, sans-serif;
font-size: 11px;
background-color: <HARMONIOUS_DARK>;
}

#info a,
#info a:link,
#info a:visited {
color: #FFFFFF;
text-decoration: none;
font-weight: normal;
}
.style1 {font-family: "Courier New", Courier, monospace}
.style3 {
color: #336699
}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style5 {color: #999999}
</style>

<script language='javascript' type='text/javascript'>
<!-- BEGIN
function flip(rid){
current=(document.getElementById(rid).style.displa y == 'none') ? 'block' : 'none';
document.getElementById(rid).style.display = current;
}
function gotohome(){
document.location = 'index.php';
}
function gotocomments(){
document.location = '#comments';
}

// End -->
</script>

<script type="text/javascript">
<!--
function clearBox(box) {
if(box.value==box.defaultValue) {
box.value = "";
}
}
//-->
</script>
</head>

<body>

<div id="content">

<table align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td width="418" align="center">
<div id="transition" class="image">
<div id="picture">
<div class="wrap1">
<div class="wrap2">
<div class="wrap3">
<div style="text-align: center;">
<div align="right" class="style1">
<div align="center" class="style3">riceandnoodles</div>
</div>
</div>

<div id="copyright">
<br />
<a href="../Downloads/index.php" title="home">Fresh</a> |
<a href="../Downloads/index.php?showimage=&lt;IMAGE_PREVIOUS_ID&gt;" title="previous">&lt;&lt;</a> |
<a href="../Downloads/index.php?showimage=&lt;IMAGE_NEXT_ID&gt;" title="next">&gt;&gt;</a> |
<a onclick="flip('comments'); gotocomments(); return false;">Info/Comments (
<IMAGE_COMMENTS_NUMBER>)</a> | <LINK_TO_PAGED_ARCHIVE> |
<a href="../Downloads/index.php?x=about" title="about">About</a> |
<a href="../Downloads/index.php?x=rss" title="RSS 2.0 feed">RSS</a>/<a href="../Downloads/index.php?x=atom" title="ATOM feed">Atom</a>

<img class="photobox" src="../Downloads/images/&lt;IMAGE_NAME&gt;" title="<IMAGE_TITLE>" alt="<IMAGE_TITLE>" border="0" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" /></a>

<div id="copyright"><div id="comments" a name="comments">
<div align="center"><font size=3>&nbsp;&nbsp;
<IMAGE_TITLE>


</font><br />
<br />
&nbsp;&nbsp;&nbsp;</div>
<IMAGE_NOTES>
<div align="left"><br />
<br />
Posted on:&nbsp;
<IMAGE_DATE>
<br />
<IMAGE_CATEGORY>
<br />
<br />
<br />
</div>
<IMAGE_COMMENTS>

<div align="left"><span class="title"><font size=2>Leave me sweet notes...</font></span> &nbsp;&nbsp;&nbsp;</div>
<form method='post' action='../Downloads/index.php?x=save_comment' name='commentform' accept-charset='UTF-8'>
<textarea name='message' rows='2' cols='50' onfocus="clearBox(this);">Your Comment Here...</textarea>
&nbsp;&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;&nbsp;<input type='text' name='name' class='input' value='<VINFO_NAME>' id="name"/>&nbsp;&nbsp;&nbsp; <label for="name"><font size=1>Name</font></label><br /><br />
&nbsp;&nbsp;&nbsp;<input type='text' name='url' class='input' value='<VINFO_URL>' id="url"/>&nbsp;&nbsp;&nbsp; <label for="url"><font size=1>Website URL, if any</font></label><br /><br />
&nbsp;&nbsp;&nbsp;<input class='input' type='text' name='email' value='<VINFO_EMAIL>' id="email"/>&nbsp;&nbsp;&nbsp; <label for="email"><font size=1>Email (not visible to others)</font></label><br /><br />
&nbsp;&nbsp;&nbsp;<input type='hidden' name='parent_name' value='<IMAGE_NAME>' />
&nbsp;&nbsp;&nbsp;<input name='vcookie' type='checkbox' id="saveinfo" value='set' checked="checked" />
<label for="saveinfo"><font size=1>Save User Info</font></label><br /><br />
<input type='submit' value='Add' class="comment-button"/>
<br />
<br />
&nbsp;&nbsp;&nbsp;<font size=1><COMMENT_POPUP> As Popup</font>
<br />
&nbsp;&nbsp;&nbsp;<input type='hidden' name='parent_id' value='<IMAGE_ID>' />
&nbsp;&nbsp;&nbsp;<input type='hidden' name='parent_name' value='<IMAGE_NAME>' />
</form>

</div>
</div>

<script language='javascript' type='text/javascript'>flip('comments');</script>

<div class="style4" id="info">
<br />
<span class="style5">All Images Copyright &copy; 2006-2008 Mae Gabriel | All Rights Reserved</span> </div>
</div></td>
</tr>
</tbody></table>


<br clear="all" />


<!-- Start of StatCounter Code -->
<script type="text/javascript">
sc_project=1837610;
sc_invisible=0;
sc_partition=17;
sc_security="dee9962a";
sc_text=2;
</script>

<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a title="web stats" class="statcounter" href="http://www.statcounter.com/free_web_stats.html"><img class="statcounter" src="http://c18.statcounter.com/1837610/0/dee9962a/0/" alt="web stats" /></a></div></noscript>
<!-- End of StatCounter Code -->


</body>
</html>

dhdesign
09-06-2008, 12:07 PM
I set up a local copy of the your main blog page with your image in it, and tested. I was able to get the stat counter to display, and it didn't squirrel up your layout.

Insert the stats code in image_template.html as follows:

This part goes at the very end of the head section at the top of the template
<script type="text/javascript">
<!--
function clearBox(box) {
if(box.value==box.defaultValue) {
box.value = "";
}
}
//-->
</script>

<script type="text/javascript">
sc_project=1837610;
sc_invisible=0;
sc_partition=17;
sc_security="dee9962a";
sc_text=2;
</script>
</head>


And this goes at the very bottom of your template:

<br clear="all" />

<div style="text-align: center; font-size: 13px; color: #999; margin-bottom: 10px;">
<!-- Start of StatCounter Code -->
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
<noscript><div class="statcounter"><a title="web stats" class="statcounter" href="http://www.statcounter.com/free_web_stats.html"><img class="statcounter" src="http://c18.statcounter.com/1837610/0/dee9962a/0/" alt="web stats" /></a></div></noscript>
<!-- End of StatCounter Code -->
</div>

</body>
</html>

There was no div to control the position, etc. of the counter, so that may have been causing your issues.

Give this a try and let me know if it works okay for you.

noodles
09-06-2008, 03:36 PM
I really appreciate your effort in helping me here.

It still doesn't work. I've placed the codes exactly as you described. The main image is still not showing up. Which browser are you using? I am using Firefox 3 and Safari.

Thanks again. Btw, you have an incredible gallery!!! :)

dhdesign
09-07-2008, 11:51 AM
Sorry for the delay in responding. I'm not sure why it isn't working for you. I use FF 2.0.0.16, and it worked fine for me. When you added the Statcounter code, did you clear your cache in both browsers before looking at your photoblog again? I'm wondering if you aren't having some type of cache issue possibly.

The other alternative, if you can't get this working, is to use some of the stats already available within Pixelpost, either natively or an addon:

Advanced Stats is an addon that is included in the PP download package, so you should already have it - you just need to enable it (status: ON) and click the "Do it" button. The template tag to show your total visitor count on your photoblog is <ADVNCD_SITE_VISITORNUMBER> (more info (http://www.pixelpost.org/docs/TemplateTags/ADVNCD_SITE_VISITORNUMBER)).

Image Statistics by Austriaka (http://www.pixelpost.org/extend/addons/image-statistics/) - I use this on my photoblog and love it. You get your image stats by overview, detailed (latest visitors), most viewed, search terms, and long term. There's nothing to add to the template with this, unless you want to use one of the 2 tags associated with it.

Thanks for the compliment on my photoblog. :) I haven't much free time in the last several months to spend out with the camera, so there hasn't been anything new posted for awhile. I'm hoping to change that soon, though. ;)

noodles
09-07-2008, 12:23 PM
I've just cleared my cache but still the main image is not working and. I will now try the other options... :)

dhdesign
09-07-2008, 12:33 PM
I just checked the source code and figured out why the image isn't showing, so hold on a minute - we may still be able to fix this! ;)

What program are you using to edit the image_template.html file? Whatever you are using has converted the template tag to show the image from <IMAGE_NAME> to &lt;IMAGE_NAME&gt; - that's why the image isn't showing up! It's changing the opening/closing brackets on that template tag, and has also converted a couple other template tags the same way.

Do you have a plain text editor (like Notepad)? If so, then you need to open image_template.html, add the Statcounter code the way you did, and change:

<img class="photobox" src="../Downloads/images/&lt;IMAGE_NAME&gt;" to <img class="photobox" src="../Downloads/images/<IMAGE_NAME>"

You also need to fix the template tags in the following 2 lines - replace &lt; with < and &gt; with >:

<a href="../Downloads/index.php?showimage=&lt;IMAGE_PREVIOUS_ID&gt;" title="previous">&lt;&lt;</a> |
<a href="../Downloads/index.php?showimage=&lt;IMAGE_NEXT_ID&gt;" title="next">&gt;&gt;</a> |

noodles
09-07-2008, 12:40 PM
I'm using Dreamweaver. I'll do it 'notepad' way....

Oh, this is great!!!!

dhdesign
09-07-2008, 12:41 PM
I would suggest not using Dreamweaver to edit any Pixelpost files (core or template), as this is the type of thing that can happen.

Always use a plain text editor to edit any of the Pixelpost files.

noodles
09-07-2008, 12:45 PM
Oooops! I am using mac and i only have 'TextEdit'! It's converting the codes to a web view?

noodles
09-07-2008, 12:47 PM
I'm downloading 'Notepad' for mac...

dhdesign
09-07-2008, 01:01 PM
TextEdit can also be used, but you have to make sure you are using it in Plain Text Format, not Rich Text Format. Follow the directions in the link in this post (http://www.pixelpost.org/forum/showpost.php?p=60809&postcount=18) to set TextEdit to Plain Text format.

noodles
09-07-2008, 01:37 PM
It worked!!!! Thank you SO MUCH!

Love Pixelpost!!!!

dhdesign
09-07-2008, 01:42 PM
You're welcome - glad it all got sorted out for you! :)