PHPee.com PHP development forum
How to add PPHlogger code to a php page?

 
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger Support
View previous topic :: View next topic  
Author Message
oeconom



Joined: 24 Sep 2004
Posts: 5
Location: Germany

PostPosted: Wed Oct 13, 2004 6:17 pm    Post subject: How to add PPHlogger code to a php page? Reply with quote
Hi there,
perhaps the question is a little bit silly, but I'm just a php novice...
How and where do I add the logger code to an php page (e.g. to logg the access to my linpha photo album)?
Thanks in advance,
Felix
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 927
Location: London, UK

PostPosted: Wed Oct 13, 2004 7:01 pm    Post subject: Reply with quote
It depends in what way you want to log the page.
The JS code can go anywhere.
The PHP code needs to go at the top of the page before any output.
The PHPJS code also needs to do the same as the PHP version.

The manual details this: http://pphlogger.phpee.com/doc.html#implement

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
michael singer



Joined: 03 Dec 2004
Posts: 4
Location: Vienna (Austria)

PostPosted: Fri Dec 03, 2004 5:50 pm    Post subject: Reply with quote
my website is powered by coppermine 1.3.2.
i'd really like to get pphlogger running by PHPJs code, but i don't understand, where and on which php-page the code has to be put.
a php page looks like:

Code:
.
.
.
.
.
?>


so where do i have to put the code:

Code:
$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");
?>


i have tried to put it on top of theme.php in coppermine, but all i got were errors.

could anybody help me?
is anybody running pphlogger with coppermine?

thank you!
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 927
Location: London, UK

PostPosted: Fri Dec 03, 2004 8:05 pm    Post subject: Reply with quote
You're on your own here, i've never used coppermine.

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
michael singer



Joined: 03 Dec 2004
Posts: 4
Location: Vienna (Austria)

PostPosted: Fri Dec 03, 2004 9:44 pm    Post subject: Reply with quote
hi sdjl,

thanks for the quick reply!
you may never have used coppermine, but my question would be the same concerning any other php gallery or CMS, e.g. "mambo" (CMS) or "Gallery" or "Exhibit Engine" (galleries).

the basic structure is of these scripts is quite similar in a way: there is always a template or theme section with something like theme.php, and there is the index.php and so on.

so, on WHICH php-file and WHERE exactly should the php pphlogger code be placed?

does "on top" mean this way:

Code:
$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");
?>
.
.
.
.
.
?>
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 927
Location: London, UK

PostPosted: Fri Dec 03, 2004 10:45 pm    Post subject: Reply with quote
I have no idea what template file you would need to edit as that would be determinded by the templating system you are using.
You may also find it's impossible to use pphlogger with the system because of PHP code being executed before the pphlogger call.

Yes, on the top means at the top, with no whitespace.

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
lionel
Moderator


Joined: 09 Dec 2003
Posts: 121
Location: Costa Blanca, Spain

PostPosted: Fri Dec 03, 2004 11:38 pm    Post subject: Reply with quote
at some point the templating system will have to write key parts of the html page, namely the header elements and closing elements, the page will break without these.
Try finding where the head is written into the page and you can include the js code after the opening , i had to do this for a forum Smile
Back to top
View user's profile Send private message Visit poster's website
michael singer



Joined: 03 Dec 2004
Posts: 4
Location: Vienna (Austria)

PostPosted: Sat Dec 04, 2004 12:02 am    Post subject: Reply with quote
thank you for your help,

i'll try again.

to lionel:
i have no problem with the js code, it works fine. but i didn't succeed in implementing the pphlogger php/js code yet (to keep track of visitors who have disabled js on their browsers).

thanks, anyway!
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 927
Location: London, UK

PostPosted: Sat Dec 04, 2004 12:23 pm    Post subject: Reply with quote
Just to point out to you, if Javascript is disabled in the browser, the image call inside the
Back to top
View user's profile Send private message Visit poster's website
michael singer



Joined: 03 Dec 2004
Posts: 4
Location: Vienna (Austria)

PostPosted: Sat Dec 04, 2004 1:06 pm    Post subject: Reply with quote
this was new to me.
thank you for the hint, sdjl!

(but then, what sense does php implementation of pphlogger code make anyway?)

pphlogger is a great script, very useful and reliable, i'm using it daily. my great respect!
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 927
Location: London, UK

PostPosted: Sat Dec 04, 2004 2:15 pm    Post subject: Reply with quote
The PHP implementation is for if you can't use Javascript for one reason or another.
It does a better job of picking up search engine hits as well compared to the JS version.

Do bear in mind (assuming you haven't read the documents..) You can only use the PHP version if the site being tracked is on the same server as the installation of pphlogger.
It may also be worth noting, that the PHP version probably won't work if you have safe mode running.

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger Support All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11
Theme design based on Team 101 Designs, modified by Philip Iezzi