forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: ashleyXcore on August 07, 2006, 08:51:35 pm

Title: Using PHP includes with Coppermine
Post by: ashleyXcore on August 07, 2006, 08:51:35 pm
Okay, I hope this is in the right forum.

I want to use this script (http://scripts.inexistent.org/refericious/) to track my referrers, but I need to include this piece of code at the top of all pages (or in a header file):

Code: [Select]
<?php if(basename($_SERVER['SCRIPT_FILENAME']) != 'referrers.php'){ include('dir/referrers.php'); } ?>
Where can I put this? I have tried putting it in a couple places but I get sql errors or something, I'm obviously going about it wrong. Help me?
Title: Re: Using PHP includes with Coppermine
Post by: Joachim Müller on August 07, 2006, 10:03:15 pm
You can't include a script that modifies the headers or messes with the database connection. As suggested in the docs, you could use the custom_header for inclusion of PHP scripts in cpg1.4.x. In cpg1.3.x, there are other methods in cpg1.3.x that enable you toinclude scripts (you need to add the include to the pageheader function). However, you can't include all sort of scripts. What you're up to won't work, sorry.
Title: Re: Using PHP includes with Coppermine
Post by: ashleyXcore on August 08, 2006, 09:31:57 am
Oh, okay  :/
Thanks.