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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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