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: include a code snippet in the pagefooter function?  (Read 3699 times)

0 Members and 1 Guest are viewing this topic.

michael singer

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
include a code snippet in the pagefooter function?
« on: January 17, 2005, 09:16:19 am »

i want to put this code (which calls the website tracking script that i use, "trackpro") into the pagefooter function, so that every single hit is counted.

Code: [Select]
session_start(); @include 'tpro.php';
so far i included this code like this:

Code: [Select]
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;
    session_start(); @include 'tpro.php';
    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
  }

this works most of the time, but sometimes (!) it doesn't, and i get database errors.
could you please help me to include the above line of code in the pagefooter function more properly? i really like trackpro, and i think it could be also interesting for other coppermine users. unfortunately i haven't found the the best way for inclusion yet.

any help would be very much appreciated!

thank you

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: include a code snippet in the pagefooter function?
« Reply #1 on: January 18, 2005, 05:58:05 am »

did you search the board for "custom header" or "custom footer" already? There are many posts, as users have requested to find out about the usage of tracking code before.

Joachim
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: include a code snippet in the pagefooter function?
« Reply #2 on: February 01, 2005, 12:24:53 am »

just posted about it on the french board: try removing session_start()

session_start() sets some HTTP headers which is the source of the problem, and anyway the way you ( and i too ) implemented trackpro makes the call to it unuseful

just let:

Code: [Select]
@include 'tpro.php';

-matt-

michael singer

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
Re: include a code snippet in the pagefooter function?
« Reply #3 on: February 07, 2005, 11:17:49 am »

thank you for the help!

removing session_start() seems to work!
thank you for the hint, matt!

michael
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.