PowerPhlogger documentation

complete counter hosting tool

PowerPhlogger 2.1.4d
last changed on: 06/15/2001
Copyright (c) 2000, 2001 Philip Iezzi <php@iezzi.ch>

 

This is no complete documentation of the features and functionality of PowerPhlogger. It just covers parts of it and is always getting updated. If you wish to add a section or complete an incomplete section, you're welcome to take part of this documentation. Just send me your changes and I'm going to include them in this file.


visibility

PowerPhlogger is able to make the counter visible on each user's site. Users are not required to run PHP on their server. There are other possibilities to make your counter visible. Since version 2.1.4 PowerPhlogger supports even text-output - it's each user's own choice how to display their counter.
It's pretty hard to figure out how to do this correctly, so please read this documentation.

[1] userprofile settings

When you log into your account, you'll find a tab 'userprofile'. That's the place where you can change all basic settings of your account.
You'll find a checkbox 'visible'. This is the global switch for all counter images/text on your whole site. If you uncheck this, you won't be able to make your counter visible at any place. Default is checked and most of you probably better keep it checked.
Below you'll find a pulldown-menu that contains TrueType-fonts. These fonts are used for your counter image creation. Other counter scripts often use premade images and you only got a choice between a limited number of styles. - Not in PowerPhlogger! In PowerPhlogger you can choose your own TrueType fonts for your counter image. If you can't find a suitable font just upload new ones into your ttf_fonts/ directory.
below you'll find two color-palettes. The first one sets the foreground color, the color of the letters. The second one sets the background-color. If you check the 'transparent background'-checkbox, your background color will be transparent.Still you should set a matching background-color to make your counter image look smoothly.
On the left side of the color-palettes you'll find an input-field that accepts all three kind of color-notations:

plain-text:   blue
RGB:          00+00+255
Hexadecimal:  #0000FF

Don't forget the insert the '+' if you use RGB format and don't forget to enter '#' before a hexadecimal string.
By clicking on 'Save configuration' your result will be displayed on the bottom (sample image).

[2] pphlogger.js - visitor tracking

In order to track you're visitor you have uploaded the file pphlogger.js to your server. This transfers all the visitor's data to PowerPhlogger which could be located on another machine that supports PHP. I'm not going to explain how exactly this file acts but I want to make clear how to use it to make your counter visible.
Default is set to invisible. No matter if you checked 'visible' in your userprofile or not!
The checkbox 'visible' in your userprofile is just kind of a global switch that turns off all visibility. The visibility still has to be set on each page where you want it to show up!
Users that use PowerPhlogger already since early versions remember to set the variable 'showme=1'. Actually this is still gonna work but it is deprecated. Now we use two variables: showme = 'y|n' and st = 'js|img'.
That's the valid values of the st varible:

st='js'      for text output (DEFAULT)
st='img'     for image output

If you wish to make it visible, you need to set showme = 'y'

showme='n'   invisible (DEFAULT)
showme='y'   visible

Ok, basically your PowerPhlogger code that you insert on each page, looks like this:

 <script language="JavaScript" src="pphlogger.js"></SCRIPT> 
 <noscript><IMG src="http://www.your_domain.com/pphlogger/pphlogger.php?id=phpee_com&st=img"></noscript> 

As default is showme = 'n' and st = 'js' your counter would be completely invisible. In order to change mode insert another line before those two lines:

 <script>showme='y'; st='js'</SCRIPT>
 <script language="JavaScript" src="pphlogger.js"></SCRIPT>
 <noscript><IMG src="http://www.your_domain.com/pphlogger/pphlogger.php?id=phpee_com&st=img"></noscript> 

This example would make your counter visible and show it as text. Same thing with image-output, just change the st variable to 'img' - then you'll be able to see the nice image you have created in you userprofile.
I do not recommend to use the combination st='y'; showme='n' as this would output a 1x1 pixel image. It's cleaner to handle invisibility through the 'js'-Output = nothing!

calling pphlogger.php directly from PHP:

You would be able to call pphlogger.php directly from PHP if your site is hosted on the same server as PowerPhlogger is. The advantage would be, that PowerPhlogger would just track every visitor, even if search-bots that do not call any Javascript or images.
Still, I do not recommend to use this method as it hasn't been tested yet. If you call PowerPhlogger by PHP you have to make sure, the code is placed at the top of your 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.
There is another disadvantage: By calling pphlogger.php through PHP you won't be able to track the visitor's screen resolution and color depth. Instead of those values, you'll just find a zero-value in your logs.

use the following code:

<?
$id = "username";
$rel_path = "/home/your_domain/htdocs/pphlogger/"; // relative or absolute path to your PP-directory
$st = 'php';
include($rel_path."pphlogger.php");
?>

If you do not place this code on completely on top of your script/page, you would get the following error:
Warning: Cannot add header information - headers already sent by ...

[3] showhits.php

Above you found a description of how to make the counter visible on your page. Let's say you put the PowerPhlogger-code in the footer of your pages and you wish to display it somewhere else on your page... or let's say you would like to show the number of people currently online or the number of hits of the current day.
showhits.php can do a lot!
Its purpose is just to display different information and not to track visitors. showhits.php will not alter anything in your database.
There are 3 different ways to display showhits.php:

st='js'      for text output (DEFAULT)
st='php'     for text output (if PowerPhlogger is located on the same server)
st='img'     for image output

The appropriate usage for those 3 modes are:

The variable showme has no meaning in showhits.php - it is always set to 'y'. If you would not like to make it visible, you wouldn't call this script, right?! This script is only meant to display stuff, that's why it is always visible.

There's a couple of more things that showhits.php can display. It can output today's hits, today's pageimpressions, this month's hits/pageimpressions, current online users, amount of customers, total pageimpressions, download hits etc.
For, you just need to add another variable the code that has been described above: type

----------------------------------------------------------------------------
 type=   hits | pageviews | today | todayviews | month | monthviews |
         onlineusr | customers | mpdl
 mpdl=   /your_url


         description:
         hits:       shows total hits (default)
         pageviews:  shows total pageimpressions
         today:      shows today's hits
         todayviews: shows today's pageimpressions
         month:      shows current month's hits
         monthviews: shows current month's pageimpressions
         onlineusr:  shows current online users
         customers:  shows amount of activated useraccounts
----------------------------------------------------------------------------

Let's make an example: You wish to display the current online users as text in your page:

Now, lets say you wish to display how many times /files/myfile.zip got downloaded. You wish to display this as an image (sure, you can display it also as txt using Javascript or PHP !):

 

Ok, I hope that was clear enough.


last modified on 15 June 2001