coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: twum on January 09, 2005, 11:48:11 PM

Title: Addition of html code to index.php
Post by: twum on January 09, 2005, 11:48:11 PM
Hi,

I just managed to install Coppermine and it all went well. No issues.

What I'd now like to do, is to add some javascript code to the index.php page. This code is from nedstats. I looked in the file, but it's all php and I don't really know where to add the code.

Can anyone help me out here? Or maybe I have to add the code to another page that is included?

Thanks a lot in advance.
twum
Title: Re: Addition of html code to index.php
Post by: Joachim Müller on January 09, 2005, 11:54:07 PM
If you want to add JavaScript/HTML code to every coppermine page, simply edit themes/yourtheme/template.html accordingly. To add code on index.php only (not on any other coppermine page like displayimage.php or thumbnails.php), edit anycontent.php (using a text editor) and enable the display of "anycontent" as suggested in the docs: http://coppermine.sourceforge.net/manual.php#changing

Joachim
Title: Re: Addition of html code to index.php
Post by: twum on January 10, 2005, 12:02:31 AM
Hi Gaugau,

Thanks very much for the fast reply. I'll give both options a shot and let you know how it goes.

regards
twum
Title: Re: Addition of html code to index.php
Post by: twum on January 10, 2005, 10:36:16 AM
Hi Joachim,

I tried out both options and got them to work. I chose however the anycontent.php option, so that the stats code is only on the index page. Most visitors will be going thru the index page anyways, so I think that's the best place to be, otherwise each page is registered and that's not what I want, at this moment.

Thanks again and till my next question......... ;)
twum
Title: Re: Addition of html code to index.php
Post by: jecepede on January 28, 2005, 02:25:47 PM
Aloha !

I tried this option for a www.nedstat.nl counter... and it works good....
Actually it works to good !

If I browse my gallery for about five minutes, I am bound to hit my main page a couple of times.... this means I get a couple of hits !
Now in phpBB I can just set a cookie in the browser. If the cookie exits, only the netstad link is show, and nedstat does NOT count...

Where (and how) can I insert the php-code to add the cookie ????




Greets


Jessy
Title: Re: Addition of html code to index.php
Post by: Joachim Müller on January 28, 2005, 04:12:16 PM
cookies are being handled in the file header, before any output is sent. You will have to tweak include/init.inc.php accordingly - just search that file for "cookie" and add your cookie routine accordingly. A good place to add it would be right before // load the main template

Joachim