Whos Online Script

Hi

What did you set for $C[‘whois_url’] ? is set at default, i didnt change that.

Nothing in the script was changed other than adding my DB details,
I think i will wait till i sort out my new site that will be in php i think that
cause im trying to include it in html files this is the problem :frowning:

As for the records showing millions, i was playing :slight_smile:

This script only supports PHP files in a template site at this time.

Later on I might add a feature to support tracking html page activity by using a very small image pixel hit.

Hi Mike

Did you see my post about the W3 validation errors?

I see that Jack (http://stillweather.com/whos-online.php) has the W3 errors too.

Best regards,

Henrik

Ps. I have tried to change the timeformat to Danish standard - how do I change the time from 12-hour format to 24 hour format?

www.silkeborg-vejret.dk/whos-online.php

Don’t go by my site for the errors…LOL, I have other issues that I’m slowly getting through! One other minor glitch I have noticed a couple of times…If the “Last URL” is a long address, such as my wu page the entire page gets bumped down very low. So low in fact I could not take a screen shot of it.

Now for a funny story regarding this script…My daughter is studying abroad in Spain. This morning I was looking at the new page and noticied a visitor from Spain viewing the WebCam…Hmmmmm got on AIM asked my daughter if she was looking at the WebCam and YES she was. It freaked her out that I knew what she was doing…LOL. Turns out she was showing her host family the website because she is coming home on Friday and wanted to share the site with them. Too funny!

Regards,

Jack

I think the validation problem might be cause by some empty rows that somehow got inserted in the database.
Do you have any empty rows in your database whos_online table? can you possibly browse it with phpMyAdmin?
I made a new version to possibly fix the validation problem, but I cannot access my server to test it or upload the new zip file. :frowning:

time format setting will be in my next version…

I might post it here temporarily in a few minutes.

Thanks Mike…i do have the settings.php file for other things, so thats in place.

As for the php4, I’ll let you know in a few hours if it works if no one else has by then.

Hi Mike

Thanks for your reply.

There dosent seem to be any empty rows in my database - see attached pic.

Best regards,

Henrik


Great script up and running. and thanks MCHALLIS

BTrip

dito

There will be a new version today, will post later

Version: 1.01 14-Dec-2008

  • I moved all the settings to a include-whos-online-settings.php to help make updates easier
  • fixed missing language setting TEXT_VISITORS_ONLINE_NOW
  • added more error traps, one to catch a missing spiders.txt
  • try to fix extra on whos-online page messing up HTML validation.
  • added date and time format settings

Jack, these settings are for you, try lowering the numbers to like 150 wrap the words

// three of the strings can be auto wordwrapped
$C[‘lasturl_wordwrap_chars’] = 175; // <= set to number of characters to wrap to
$C[‘useragent_wordwrap_chars’] = 250; // <= set to number of characters to wrap to
$C[‘referer_wordwrap_chars’] = 250; // <= set to number of characters to wrap to

Tried that Mike and got the same…captured below.

All are currently set to 150.

Regards,

Jack


Jack, the table overflow too wide problem …
that is why I force my whos-online.php page to be on a wide template css

Problem:
sometimes the ‘Last page url’ is too long and the whos-online.php page overflows the template really wide

Solution:

(carterlake php weather template users)
This is a whose-online mod to force the whose-online.php page to use wide css,
the rest of your site can stay on a narrow theme or what ever the visitor has selected (narrow or wide).

Put this code at the very bottom of the Settings.php, but before the closing PHP tag:

Code:

 // the code below will force your whose-online.php page to use a wide css template
 if ( isset($C['filename_whos_online']) && preg_match("/".$C['filename_whos_online']."/i", $SITE['REQURI']) ){
   $SITE['CSSscreen'] = str_replace ('-narrow.css','-wide.css',$SITE['CSSscreen']);  
 }

(any other php template users)
The whose online page displays best on a wide css style template page

Three of the strings can be auto wordwrapped, look in the include-whos-online-settings.php file
lower the lasturl_wordwrap_chars to like 75

// three of the strings can be auto wordwrapped
$C['lasturl_wordwrap_chars']   = 175; // <= set to number of characters to wrap to
$C['useragent_wordwrap_chars'] = 250; // <= set to number of characters to wrap to
$C['referer_wordwrap_chars']   = 250; // <= set to number of characters to wrap to

Hi again

I have removed it from the html site and installed it on my “in progress” site
http://www.northantsweather.com/weather/wxindex.php

Most problems that i had have been resolved, but sadly if you look at the top
of the page my DB name is still showing, I have installed it exactly per your
instructions…

I think its coming from this (below) as thats all thats in the header from the script


require ('include-whos-online-header.php');
  $whos_online_records = update_whos_online();

oh and the IP lookup aint working still http://www.northantsweather.com/weather/whos-online.php
should i change the default lookup URL, i have


$C['whois_url'] = 'http://www.showmyip.com/?ip=';

Version: 1.01 - 14-Dec-2008

  • I moved all the settings to a include-whos-online-settings.php to help make updates easier
  • fixed missing language setting TEXT_VISITORS_ONLINE_NOW
  • added more error traps, one to catch a missing spiders.txt
  • fixed extra on whos-online page messing up HTML validation.
  • added date and time format settings

upgrading from version 1.00 requires reading the readme.txt again, the steps have changed
database requires no changes.

Download
http://www.642weather.com/weather/scripts/whos-online.zip

Bashy, please start over with my new version. It has better instructions in the readme.txt and a couple more error checks to find problems.

Ok just started over again with the new updated version and i also added the new
include-style-switcher.php and i got 2 wee issues, the stats are not showing a time
but i think thats because i think i got this part wrong , i wanted the date to be 28/12/08
$C[‘date_time_format’] = ‘d-m-Y h:i a T’; but i dont think thats working some how?

Also (this could be related) the http://www.northantsweather.com/weather/whos-online.php
is showing a fatal error now, is this because the date format is incorrect?

Sorry to be a pain in the rear end :frowning:

Hi Mike

I updated your new version and is passes W3 validation :smiley:

But it does not show the time in 24-hour format - I have theese settings in the include-whos-online-settings.php:

$C[‘time_format’] = ‘H:i T’; // see PHP: date - Manual

$C[‘date_time_format’] = ‘d-m-Y H:i T’; // see PHP: date - Manual

Best regards,

Henrik

bashy, did you upload all the new php files from the zip file?
include-whos-online-page.php in particular because it has the new function your error says it cannot find

about the dat time problems, i will check again, i did this coding without having a server to try it on.

Hi again

I tried adding this to my page:

$myTZ = ‘Copenhagen/Europe’;
putenv(“TZ=$myTZ”);

and this

$myTZ = ‘DK’;
putenv(“TZ=$myTZ”);

But that only moved the time one hour back and still in 12-hour format.

Best regards,

HEnrik