Inserting Page Counter code into WaterDrops theme Main Page Inserting Page Counter code into WaterDrops theme Main Page
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Inserting Page Counter code into WaterDrops theme Main Page

Started by vrviji, January 08, 2005, 05:20:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vrviji

Hi,
I hope I am in the correct section to request some assistance as to where I should insert the following code - so that I get my Page Couter ( from www.statcounter.com ) to count hits on my Main Page of my gallery. My gallery at www.sundram.org uses the Water Drop theme. And StatCounter requires that I install this code :


<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=305018;
var sc_partition=1;
</script>
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img  src="http://c2.statcounter.com/counter.php?sc_project=305018&amp;java=0" alt="counter free hit unique web" border="0"></a> </noscript>
<!-- End of StatCounter Code -->

into the page to track my users who view the main page.

My problem is ...
Can I just go in an insert this code, as is, anywhere in the main index page ( and if so, which page would be best ? )

Any help ( including telling me to read the relevant section of the User Manual would be most appreciated.

Regards,

Viji Rajasundram
www.sundram.org

vrviji

Thanks. I changed all the punctuation marks - so that they are the same " ' " one on both sides, but I still get the same error, when the page is displayed. Except that this time, they show the punctuation marks being of the straight variety.

Could it be that this code cannot be inserted into the anycontent.php file ?

Viji

Tranz

Please post the entire content of your file.

It looks like you didn't put the statements between php tags.

vrviji

#3
Thank you very much. I really appreciate this. Here is the file :

************ start of copy ******

<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.2                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR                                     //
// http://www.chezgreg.net/coppermine/                                       //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// (http://coppermine.sf.net/team/)                                          //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify      //
// it under the terms of the GNU General Public License as published by      //
// the Free Software Foundation; either version 2 of the License, or         //
// (at your option) any later version.                                       //
// ------------------------------------------------------------------------- //
// CVS version: $Id: anycontent.php,v 1.5 2004/07/24 15:03:52 gaugau Exp $
// ------------------------------------------------------------------------- //

starttable("100%""Welcome");

?>

<tr><td class="tableb" >
Hi, Welcome to the Photo Gallery of the Somasundram Family. I hope the pictures here bring back fond memories of all the good times we have had together as a family. Please feel free to send me any other pictures that you wish to share.

Cheers, 
Viji Rajasundram
( Keeper of the Royal Gallery )



File : anycontent.php

</td></tr>


echo '<!-- Start of StatCounter Code -->';
echo '<script type="text/javascript" language="javascript">';
echo 'var sc_project=509407; ';
echo 'var sc_partition=3;';
echo '</script>';

echo '<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img  src="http://c4.statcounter.com/counter.php?sc_project=509407&amp;java=0" alt="counter free hit unique web" border="0"></a> </noscript>';
echo '<!-- End of StatCounter Code -->';


<?php
endtable
();


?>




*************** End of copy *************




vrviji

Hi again,

Guess what ? I inserted the html code from statcounter into the template.html file under the Water Drop theme directory - and it works !
While I am quite sure the elegant way of doing this would be to insert it as PHP code in the anycontent.php file, this also serves my purpose - as I at least have some little understanding of HTML.

Thank you for your help.

Cheers,

Viji Rajasundram
www.sundram.org

Tranz

Actually, either way is possible. The key thing was the placement (in this case, misplacement) of the last opening php tag. If the html code is outside of php tags, you don't need to use echo statements, as you can see with your table tags. If the code is between php tags, you need to use echo statements.

vrviji

Again, my sincere thanks and gratitude for helping me solve this problem.

I am again a Happy Camper and a great appreciater of Coppermine !  8)

What a wonderful piece of software. You guys must be so proud to have developed such a useful application.

Please consider this thread closed / solved with my thanks.

Cheers,

Viji Rajasundram
www.sundram.org