supposing your store was at
mydomain.co.uk/productshop/

when viewing Who’s Online
if you have a visitor looking at a particular product
the URL likely to be seen is something like this
/productshop/index.php?main_page=product_info&cPath=18&products_id=278
or if they are looking at a category listing
the URL likely to be seen is something like this
/productshop/index.php?main_page=index&cPath=6

if you have lots of categories and lots of products, if you are like me, the chances are you still won’t know what they are looking at, unless you click on the URL !
so i put together some lines of code that adds an extra line to each visitors information, (solving the problem).

First I transcribed all of my categories and products to a couple of arrays and saved that list in a file called productslist.php ~ (to be perfectly honest, i did not know how to retrieve these from the database so i went with what i knew to just get it done and dusted).

example:
PHP Code:
// $including = true; 
if (!$avariablename){ exit("direct access not permitted");}
// setting the categories into array;
// $categstr[1]="";
$categstr[2]="nuts";
$categstr[3]="bolts";
$categstr[4]="washers";
................
etc etc and......
// setting the products into array;
$productstr[1]="Big Fat One";
$productstr[2]="Short Fat One";
$productstr[4]="Long Thin One";
$productstr[5]="Short Thin One";
................
etc etc........... 
I then inserted the lines below into whos_online.php
starting at line 324 for ZC_1.3.9h
and starting at line 418 for ZC_1.5


PHP Code:
// bof url to category and product   
$avariablenametrue;
$idst=stripos($whos_online->fields['last_page_url'],"products_id=");
$finprodidstrsubstr($whos_online->fields['last_page_url'],$idst,17);    
require_once 
'productslist.php';
$finprodidstr2substr($whos_online->fields['last_page_url'],$idst,16);
$prodnum=substr($finprodidstr2,12);     
if (
$productstr[$prodnum]!=""){ echo '<b>'."Product: ".'</b>'.$productstr[$prodnum];}
else { 
$thst=stripos($whos_online->fields['last_page_url'],"Path=");
$fincatthstrsubstr($whos_online->fields['last_page_url'],$thst,9);
$fincatthstr2substr($whos_online->fields['last_page_url'],$thst,8);
$catnum=substr($fincatthstr2,5);    
if (
$categstr[$catnum]!=""){ echo '<b>'."Category: ".'</b>'.$categstr[$catnum];}}
// eof url to category and product 
and that’s it.
Now I don't have to click the URL any more (and with ZC_1.5, i don't even need to click refresh, life should be simpler, y/n?)!!

if you plan to use this in your whos_online.php file it’s important that you get your numbers right!
too small a string length and you’ll cut off those digits found in the 100’s or 1000’s and be identifying the wrong products!

it does not take too much imagination to set-up this for other URLs too, e.g. images etc. (i could have shown you how, just thought i'd keep the example simple!)

IMPORTANT: Don’t forget to keep an unadulterated backup copy of your whos_online.php file.

If anyone wants to add a version where one can pick out the relevant info from the database, please feel free to show me/others!!