Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Addition of html code to index.php  (Read 3571 times)

0 Members and 1 Guest are viewing this topic.

twum

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Addition of html code to index.php
« 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
« Last Edit: January 10, 2005, 10:38:16 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Addition of html code to index.php
« Reply #1 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
Logged

twum

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Addition of html code to index.php
« Reply #2 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
Logged

twum

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Addition of html code to index.php
« Reply #3 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
Logged

jecepede

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Addition of html code to index.php
« Reply #4 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Addition of html code to index.php
« Reply #5 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
Code: [Select]
// load the main template
Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 15 queries.