Advanced search  

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

Pages: [1]   Go Down

Author Topic: pphlogger and coppermine  (Read 6734 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
pphlogger and coppermine
« on: November 25, 2004, 07:44:59 am »

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?

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: pphlogger and coppermine
« Reply #1 on: December 03, 2004, 04:20:17 pm »

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
Logged

michael singer

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
Re: pphlogger and coppermine
« Reply #2 on: December 04, 2004, 12:31:44 am »

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?):

Code: [Select]
<?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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: pphlogger and coppermine
« Reply #3 on: December 05, 2004, 12:35:11 pm »

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
Logged

michael singer

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
Re: pphlogger and coppermine
« Reply #4 on: December 05, 2004, 02:44:17 pm »

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

thank you for patience!

michael
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: pphlogger and coppermine
« Reply #5 on: January 06, 2005, 04:21:18 pm »

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

michael singer

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
Re: pphlogger and coppermine
« Reply #6 on: January 06, 2005, 09:31:25 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

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


for tracking ALL hits of your visitors?




« Last Edit: January 06, 2005, 09:49:11 pm by michael singer »
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: pphlogger and coppermine
« Reply #7 on: January 06, 2005, 10:44:50 pm »

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
Code: [Select]
$entry = $PHP_SELF;

with

Code: [Select]
$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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
trackpro and coppermine
« Reply #8 on: January 06, 2005, 11:26:12 pm »

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!


Logged

michael singer

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
  • random image from: www.a-visual-notebook.at
    • a visual notebook
Re: pphlogger and coppermine
« Reply #9 on: January 07, 2005, 10:36:10 pm »

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

Code: [Select]
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:

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

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

Logged
Pages: [1]   Go Up
 

Page created in 0.039 seconds with 20 queries.