coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: michael singer on January 17, 2005, 09:16:19 AM

Title: include a code snippet in the pagefooter function?
Post by: michael singer 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.

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

Title: Re: include a code snippet in the pagefooter function?
Post by: Joachim Müller 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
Title: Re: include a code snippet in the pagefooter function?
Post by: nol33t 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:


@include 'tpro.php';


-matt-
Title: Re: include a code snippet in the pagefooter function?
Post by: michael singer 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