Addition of html code to index.php Addition of html code to index.php
 

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

Addition of html code to index.php

Started by twum, January 09, 2005, 11:48:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

twum

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

Joachim Müller

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

twum

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

twum

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

jecepede

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

Joachim Müller

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