Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Inserting Page Counter code into WaterDrops theme Main Page  (Read 5181 times)

0 Members and 1 Guest are viewing this topic.

vrviji

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Inserting Page Counter code into WaterDrops theme Main Page
« on: January 08, 2005, 05:20:03 pm »

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
« Last Edit: January 08, 2005, 08:34:53 pm by TranzNDance »
Logged

vrviji

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Inserting Page Counter code into WaterDrops theme Main Page
« Reply #1 on: January 08, 2005, 08:04:39 pm »

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
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Inserting Page Counter code into WaterDrops theme Main Page
« Reply #2 on: January 08, 2005, 08:09:50 pm »

Please post the entire content of your file.

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

vrviji

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Inserting Page Counter code into WaterDrops theme Main Page
« Reply #3 on: January 08, 2005, 08:15:34 pm »

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

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

Code: [Select]
<?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 *************



« Last Edit: January 08, 2005, 08:20:10 pm by TranzNDance »
Logged

vrviji

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Inserting Page Counter code into WaterDrops theme Main Page
« Reply #4 on: January 08, 2005, 08:20:38 pm »

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
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Inserting Page Counter code into WaterDrops theme Main Page
« Reply #5 on: January 08, 2005, 08:25:02 pm »

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.
Logged

vrviji

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Inserting Page Counter code into WaterDrops theme Main Page
« Reply #6 on: January 08, 2005, 08:29:32 pm »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.