include a code snippet in the pagefooter function? include a code snippet in the pagefooter function?
 

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

include a code snippet in the pagefooter function?

Started by michael singer, January 17, 2005, 09:16:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michael singer

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.

session_start(); @include 'tpro.php';

so far i included this code like this:

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


Joachim Müller

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

nol33t

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:


@include 'tpro.php';


-matt-

michael singer

thank you for the help!

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

michael