pphlogger and coppermine pphlogger and coppermine
 

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

pphlogger and coppermine

Started by michael singer, November 25, 2004, 07:44:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michael singer

does anyone use the pphlogger statistic script?
i really like it and use it for my gallery. the current version is 2.2.5. http://pphlogger.phpee.com/
it works with a js code snippet, but it would also works with pure php implementation (to track visitors who turned off javascript). unfortunately i didn't succeed in implementing it yet. a php snippet should have to be put on the top of the tracked page (...?).

documentation: http://pphlogger.phpee.com/doc.html

does anyone have any (php) experiences with pphlogger?


Joachim Müller

add the JS snippet to themes/yourtheme/template.html
To use php includes, search the forum for "custom footer" (might not work for all scripts though, as you mustn't modify the http header).

Joachim

michael singer

thank you for your reply, joachim.

i have searched the forum. the only problem is, that the following code should be placed "on top" of a page (which page?):

<?php 
$id 
"username";define('PPHL_SCRIPT_PATH''/home/your_domain/htdocs/pphlogger/'); // relative (e.g. "pphlogger/") or absolute path to your PP-directory$st = 'phpjs'; 
// $showme = 'y';include(PPHL_SCRIPT_PATH."pphlogger.php"); 
?>


the documentation of pphlogger http://pphlogger.phpee.com/doc.html says the following:
"Please make sure, the code is definitely placed at the top of your script/page! As PowerPhlogger sets cookies each time a visitor enters or reloads your pages, it's not possible to call pphlogger.php after some other output."

michael

Joachim Müller

that's a no-no: the script you're attempting to use tries to manipulate the http header by settings/reading a cookie of it's own. You can't do that, simpy because coppermine relies on usage of cookies as well. If your logging script has already manipulated the http header, coppermine can't - you'll get a php error and coppermine won't work the way it is expected to. Bottom line is: you can not use the script phplogger together with coppermine the way you intend to. Sorry. Use the JavaScript method instead.

Joachim

michael singer

thank you for the explanation, joachim.
so, i'll keep to the javascript method.

thank you for patience!

michael

nol33t

just installed TrackPro v1.0 ( GNU Licence ), it's in php, and working great with CPG

michael singer

#6
Quote from: nol33t on January 06, 2005, 04:21:18 PM
just installed TrackPro v1.0 ( GNU Licence ), it's in php, and working great with CPG

@ nol33t:

very interesting.
could you please tell me where you added the line of code


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


for tracking ALL hits of your visitors?





nol33t

at the first line of the pagefooter() function in the theme.php file located in your theme directory

and to reply to your next question if you try that  ;) , to keep the "entry page" in trackpro working, i changed one line in the tpro.php file:

i replaced

$entry = $PHP_SELF;


with


$entry = $_SERVER["REQUEST_URI"];


However with that trick ( puting the line in the pagefooter() ), there's a slide effect: you'll get really ALL hits from a visitor, meaning not only one per "HTTP SESSION" (hope i'm clear here), but that's what I wanted  ;D

michael singer

wow! this is - fanstatic!

very nice script, great trick, works wonderfully, thank you a lot!

with your mod trackpro works even better than pphlogger, because it logs really EVERY single hit of a visitor with full URI!
(hopefully it will also work with the upcoming version trackpro 2.0!)

thank you very much again!



michael singer

i just want to add, that i didn't put the code

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

at the very first line of the pagefooter() function, because while doing so i got some error messages on my index page.

so, finally this is the way it workes perfectly for me:

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();
  }


i thought this might be useful for those who are interested in this website tracking script.
btw, it has to be said, that this way of tracking every single hit causes an enormous amount of data, if the robots.txt is not properly configured.
for example, the visits of the alexa webcrawler caused me 4.300 database entries in a few minutes.

michael