Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Who's Online Enhancement 1.4


Guest

Recommended Posts

Hi,

 

I'm having a problem with my "Who's Online" module. Every time I hit Refresh, it takes it a long time to refresh and instead of the report I'm getting a Fatal error message:

 

What can be a problem here? Any help would be greatly appreciated.

 

Thanks in advance,

Irina.

Irina,

 

Where are you storing your sessions? And what version of WOE are you using?

 

ed

Edited by medvid
Link to comment
Share on other sites

Irina,

 

Where are you storing your sessions? And what version of WOE are you using?

 

ed

My sessions are set to be stored in mysql and I'm using 1.9 version of WOE. I saw there is an updated 2.0 version of the contribution already. What changed in a new release?

 

Thanks.

Link to comment
Share on other sites

Hi coopco,

hi there.

I thinks i know what happend already.

This is because i not add the related to to the general.php ....

btw, thanks you very much @@~

 

And how u know i install more than 1 contribution :P

I saw your posts in other support threads.

Link to comment
Share on other sites

Hi Guys,

 

I have just installed this great contrib on my development store and I am having the same problem as people a few pages back and as far as I can see it is still unresolved.

 

The problem is that shopping cart contents are not showing when view who's online. I am storing sessions in the database not files.

 

Any ideas please?

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

medvid,

 

I just wanted to say thanks for a great contrib. I have it installed and Zero errors. This contrib lets you see all kinds of info.

 

Also for people who use this I also recomend the visitors, and user tracking with admin. These 3 well tell you everything you need to know and then some about how your store is doing and what you need to do as an owner.

 

Thank you,

Link to comment
Share on other sites

Hi Guys,

 

I have just installed this great contrib on my development store and I am having the same problem as people a few pages back and as far as I can see it is still unresolved.

 

The problem is that shopping cart contents are not showing when view who's online. I am storing sessions in the database not files.

 

Any ideas please?

 

Thanks

 

Mark

Mark,

Do you have sessions set to mysql in BOTH catalog/includes/configure.php AND admin/includes/configure.php?

 

ed

Link to comment
Share on other sites

medvid,

 

I just wanted to say thanks for a great contrib. I have it installed and Zero errors. This contrib lets you see all kinds of info.

 

Also for people who use this I also recomend the visitors, and user tracking with admin. These 3 well tell you everything you need to know and then some about how your store is doing and what you need to do as an owner.

 

Thank you,

Eric,

 

Thank you. Kudos go to the many people who have added to the contrib code and to helping on the forum.

 

ed

Link to comment
Share on other sites

My sessions are set to be stored in mysql and I'm using 1.9 version of WOE. I saw there is an updated 2.0 version of the contribution already. What changed in a new release?

 

Thanks.

Does anybody have any ideas on what might be wrong with my WOE module? Please..., I really need your help.

 

Thanks.

Edited by Irin
Link to comment
Share on other sites

Mark,

Do you have sessions set to mysql in BOTH catalog/includes/configure.php AND admin/includes/configure.php?

 

ed

 

Hi Ed,

 

Yes I have both configure files set to use mysql for the sessions. Any further ideas?

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Hi

 

I have installed the 2.0 version by azer 14/2/06 & do not appear to have any problems (I think)

 

I do not quite understand how it all works though, as the figures on the bottom don't match up. I could have one customer & it shows up twice so I get 1 cust, 2 duplicate ip's = -1 real cust :blink:

 

My admin IP is the third different one I have? Down for Maintenance has another & other sites see me as another again? Probably basic computer stuff but I thought 1 computer=1 IP address?

 

Bots show as a bots with session light, but the table says No under the session column.

 

Some bots are showing as guests but the address show them as search engine or is that right?

 

I think I have a great tool here, which has installed great, but I am not using it to it's full ability, as I do not know what I could do with it. Please could someone explain the "How to use Who's online Enhancement 2.0"?

 

Sorry for being so backward :blush: & thank you for your help. :thumbsup:

 

Julie

Link to comment
Share on other sites

I updated my version of Whos Online and I get this error:

Fatal error: Call to undefined function: get_products() in /hsphere/local/home2/aodfan/alteredmotorsports.com/admin/whos_online.php on line 114

 

I have not modified this file at all, just dropped it in from the contribution, anyone know what the problem would be? This is the code withine the file:

<?php

/*

$Id: whos_online.php,v 2.00 2006/02/14 15:48:55 harley_vb Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright (c) 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

 

/*

Configuration Values

Set these to easily personalize your Whos Online

*/

 

// Seconds that a visitor is considered "active"

$active_time = 300;

// Seconds before visitor is removed from display

$track_time = 900;

 

// Automatic refresh times in seconds and display names

// Time and Display Text order must match between the arrays

// "None" is handled separately in the code

$refresh_time = array( 30, 60, 120, 300, 600 );

$refresh_display = array( '0:30', '1:00', '2:00', '5:00', '10:00' );

 

// Images used for status lights

$status_active_cart = 'icon_status_green.gif';

$status_inactive_cart = 'icon_status_red.gif';

$status_active_nocart = 'icon_status_green_light.gif';

$status_inactive_nocart = 'icon_status_red_light.gif';

$status_active_bot = 'icon_status_green_border_light.gif';

$status_inactive_bot = 'icon_status_red_border_light.gif';

 

// Text color used for table entries - different colored text for different users

// Named colors and Hex values should work fine here

$fg_color_bot = 'maroon';

$fg_color_admin = 'darkblue';

$fg_color_guest = 'green';

$fg_color_account = 'blue'; // '#000000'; // Black

 

//Determines status and cart of visitor and displays appropriate icon.

function tep_check_cart($which, $customer_id, $session_id) {

global $cart, $status_active_cart, $status_inactive_cart, $status_active_nocart, $status_inactive_nocart, $status_inactive_bot, $status_active_bot, $active_time;

 

// Pull Session data from the correct source.

if (STORE_SESSIONS == 'mysql') {

$session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $session_id . "'");

$session_data = tep_db_fetch_array($session_data);

$session_data = trim($session_data['value']);

} else {

if ( (file_exists(tep_session_save_path() . '/sess_' . $session_id)) && (filesize(tep_session_save_path() . '/sess_' . $session_id) > 0) ) {

$session_data = file(tep_session_save_path() . '/sess_' . $session_id);

$session_data = trim(implode('', $session_data));

}

}

 

if ($length = strlen($session_data)) {

if (PHP_VERSION < 4) {

$start_id = strpos($session_data, 'customer_id[==]s');

$start_cart = strpos($session_data, 'cart[==]o');

$start_currency = strpos($session_data, 'currency[==]s');

$start_country = strpos($session_data, 'customer_country_id[==]s');

$start_zone = strpos($session_data, 'customer_zone_id[==]s');

} else {

$start_id = strpos($session_data, 'customer_id|s');

$start_cart = strpos($session_data, 'cart|O');

$start_currency = strpos($session_data, 'currency|s');

$start_country = strpos($session_data, 'customer_country_id|s');

$start_zone = strpos($session_data, 'customer_zone_id|s');

}

 

for ($i=$start_cart; $i<$length; $i++) {

if ($session_data[$i] == '{') {

if (isset($tag)) {

$tag++;

} else {

$tag = 1;

}

} elseif ($session_data[$i] == '}') {

$tag--;

} elseif ( (isset($tag)) && ($tag < 1) ) {

break;

}

}

 

$session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));

$session_data_cart = substr($session_data, $start_cart, $i);

$session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));

$session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));

$session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));

 

session_decode($session_data_id);

session_decode($session_data_currency);

session_decode($session_data_country);

session_decode($session_data_zone);

session_decode($session_data_cart);

 

if (PHP_VERSION < 4) {

$broken_cart = $cart;

$cart = new shoppingCart;

$cart->unserialize($broken_cart);

}

 

if (is_object($cart)) {

$products = $cart->get_products(); <-----------------------LINE 114

}

}

 

$which_query = $session_data;

$who_data = tep_db_query("select time_entry, time_last_click

from " . TABLE_WHOS_ONLINE . "

where session_id='" . $session_id . "'");

$who_query = tep_db_fetch_array($who_data);

 

// Determine if visitor active/inactive

$xx_mins_ago_long = (time() - $active_time);

 

// Determine Bot active/inactive

if( $customer_id < 0 ) {

// inactive

if ($who_query['time_last_click'] < $xx_mins_ago_long) {

return tep_image(DIR_WS_IMAGES . $status_inactive_bot, TEXT_STATUS_INACTIVE_BOT);

// active

} else {

return tep_image(DIR_WS_IMAGES . $status_active_bot, TEXT_STATUS_ACTIVE_BOT);

}

}

 

// Determine active/inactive and cart/no cart status

// no cart

if ( sizeof($products) == 0 ) {

// inactive

if ($who_query['time_last_click'] < $xx_mins_ago_long) {

return tep_image(DIR_WS_IMAGES . $status_inactive_nocart, TEXT_STATUS_INACTIVE_NOCART);

// active

} else {

return tep_image(DIR_WS_IMAGES . $status_active_nocart, TEXT_STATUS_ACTIVE_NOCART);

}

// cart

} else {

// inactive

if ($who_query['time_last_click'] < $xx_mins_ago_long) {

return tep_image(DIR_WS_IMAGES . $status_inactive_cart, TEXT_STATUS_INACTIVE_CART);

// active

} else {

return tep_image(DIR_WS_IMAGES . $status_active_cart, TEXT_STATUS_ACTIVE_CART);

}

}

}

 

/* Display the details about a visitor */

function display_details() {

global $whos_online, $is_bot, $is_admin, $is_guest, $is_account;

 

// Display Name

echo '<b>' . TABLE_HEADING_FULL_NAME . ':</b> ' . $whos_online['full_name'];

echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';

// Display Customer ID for non-bots

if ( !$is_bot ){

echo '<b>' . TABLE_HEADING_CUSTOMER_ID . ':</b> ' . $whos_online['customer_id'];

echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';

}

 

// original code of 2.8 :

echo '<b>' . TABLE_HEADING_IP_ADDRESS . ':</b> ' . $whos_online['ip_address']; // commenter for whois by azer v1.9

 

// Display IP Address modified by azer for 1.9, to be tested if it doesnt work comment the ligne using variable and uncomment the whois url hardcoded ligne

// whois url hardcoded : echo '<b>' . TABLE_HEADING_IP_ADDRESS . ':</b> ' . "<a href='http://www.dnsstuff.com/tools/whois.ch?ip=$whos_online[ip_address]' target='_new'>" . $whos_online['ip_address'] . "</a>";

// whois url with variable added in admin : echo '<b>' . TABLE_HEADING_IP_ADDRESS . ':</b> ' . "<a href='" . AZER_WHOSONLINE_WHOIS_URL . $whos_online['ip_address'] . "' target='_new'>" . $whos_online['ip_address'] . "</a>";

 

 

echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';

// Display User Agent

echo '<b>' . TEXT_USER_AGENT . ':</b> ' . $whos_online['user_agent'];

echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';

// Display Session ID. Bots with no Session ID, have it set to their IP address. Don't display these.

if ( $whos_online['session_id'] != $whos_online['ip_address'] ) {

echo '<b>' . TEXT_OSCID . ':</b> ' . $whos_online['session_id'];

echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';

}

// Display Referer if available

if($whos_online['http_referer'] != "" ) {

echo '<b>' . TABLE_HEADING_HTTP_REFERER . ':</b> ' . $whos_online['http_referer'];

echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';

}

}

 

 

// Time to remove old entries

$xx_mins_ago = (time() - $track_time);

 

// remove entries that have expired

tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

 

<!-- WOL 1.6 - Cleaned up refresh -->

<?php if( $_SERVER["QUERY_STRING"] > 0 ){ ?>

<meta http-equiv="refresh" content="<?php echo $_SERVER["QUERY_STRING"];?>;URL=whos_online.php?<?php echo $_SERVER["QUERY_STRING"];?>">

<?php } ?>

<!-- WOL 1.6 EOF -->

 

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="bottom" class="pageHeading">

<?php echo HEADING_TITLE; ?>

<br clear="all"><br><span class="smallText" style="color:#909090"><? echo TEXT_SET_REFRESH_RATE; ?>: </span>

<span style="font-size: 10px; color:#0000CC">

<!-- For loop displays refresh time links -->

<?php

echo '<a class="menuBoxContentLink" href="whos_online.php"><b> ' . TEXT_NONE_ . ' </b></a>';

foreach ($refresh_time as $key => $value) {

echo ' ? <a class="menuBoxContentLink" href="whos_online.php?' . $value . '"><b>' . $refresh_display[$key] . '</b></a>';

}

?>

</span>

 

<!-- Display Profile links -->

<br clear="all">

<span class="smallText" style="color:#909090"><?php echo TEXT_PROFILE_DISPLAY; ?>:

<span style="font-size: 10px; color:#0000CC">

<a href="whos_online.php" class="menuBoxContentLink"><b><?php echo TEXT_NONE_; ?></b></a> ?

<a href="whos_online.php?showAll" class="menuBoxContentLink"><b><? echo TEXT_ALL; ?></b></a> ?

<a href="whos_online.php?showBots" class="menuBoxContentLink"><b><? echo TEXT_BOTS; ?></b></a> ?

<a href="whos_online.php?showCust" class="menuBoxContentLink"><b><? echo TEXT_CUSTOMERS; ?></b></a>

</span></span>

</td>

<!-- Status Legend - Uses variables for image names -->

<td align="right" class="smallText" valign="bottom">

<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="smallText"><?php echo

tep_image(DIR_WS_IMAGES . $status_active_cart, TEXT_STATUS_ACTIVE_CART) . ' ' . TEXT_STATUS_ACTIVE_CART . ' ';

?></td>

<td class="smallText"><?php echo

tep_image(DIR_WS_IMAGES . $status_inactive_cart, TEXT_STATUS_INACTIVE_CART) . ' ' . TEXT_STATUS_INACTIVE_CART . ' ';

?></td>

</tr>

<tr>

<td class="smallText"><?php echo

tep_image(DIR_WS_IMAGES . $status_active_nocart, TEXT_STATUS_ACTIVE_NOCART) . ' ' . TEXT_STATUS_ACTIVE_NOCART .' ';

?></td>

<td class="smallText"><?php echo

tep_image(DIR_WS_IMAGES . $status_inactive_nocart, TEXT_STATUS_INACTIVE_NOCART) . ' ' . TEXT_STATUS_INACTIVE_NOCART . ' ';

?></td>

</tr>

<tr>

<td class="smallText"><?php echo

tep_image(DIR_WS_IMAGES . $status_active_bot, TEXT_STATUS_ACTIVE_BOT) . ' ' . TEXT_STATUS_ACTIVE_BOT . ' ';

?></td>

<td class="smallText"><?php echo

tep_image(DIR_WS_IMAGES . $status_inactive_bot, TEXT_STATUS_INACTIVE_BOT) . ' ' . TEXT_STATUS_INACTIVE_BOT . ' ';

?></td>

</tr>

</table>

</td>

</tr>

</table></td>

</tr>

<tr>

<td class="pageHeading" align="center"><script language="JavaScript">

<!-- Begin

Stamp = new Date();

document.write('<font size="2" face="Arial" color="blue"><?php echo TEXT_LAST_REFRESH. ' '; ?>');

var Hours;

var Mins;

var Time;

Hours = Stamp.getHours();

if (Hours >= 12) {

Time = " p.m.";

}

else {

Time = " a.m.";

}

if (Hours > 12) {

Hours -= 12;

}

if (Hours == 0) {

Hours = 12;

}

Mins = Stamp.getMinutes();

if (Mins < 10) {

Mins = "0" + Mins;

}

document.write(' ' + Hours + ":" + Mins + Time + '</font>');

// End -->

</script>

</td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" colspan="2" nowrap align="center"><?php echo TABLE_HEADING_ONLINE; ?></td>

<td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_FULL_NAME; ?></td>

<td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_IP_ADDRESS; ?></td>

<td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_ENTRY_TIME; ?></td>

<td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_LAST_CLICK; ?></td>

<td class="dataTableHeadingContent" width="200"><?php echo TABLE_HEADING_LAST_PAGE_URL; ?> </td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_USER_SESSION; ?> </td>

<td class="dataTableHeadingContent" align="center" nowrap><?php echo TABLE_HEADING_HTTP_REFERER; ?> </td>

</tr>

 

<?php

// Order by is on Last Click. Also initialize total_bots and total_admin counts

$whos_online_query = tep_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent, session_id from " . TABLE_WHOS_ONLINE . ' order by time_last_click DESC');

$total_bots=0;

$total_admin=0;

$total_guests=0;

$total_loggedon=0;

 

while ($whos_online = tep_db_fetch_array($whos_online_query)) {

 

$time_online = ($whos_online['time_last_click'] - $whos_online['time_entry']);

if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $whos_online['session_id']))) && !isset($info)) {

$info = $whos_online['session_id'];

}

 

/* BEGIN COUNT MOD */

if ($old_array['ip_address'] == $whos_online['ip_address']) {

$i++;

}

/* END COUNT MOD */

 

if ($whos_online['session_id'] == $info) {

if($whos_online['http_referer'] != "")

{

$http_referer_url = $whos_online['http_referer'];

}

echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";

} else {

echo '<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_WHOS_ONLINE, tep_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online['session_id'], 'NONSSL') . '\'">' . "\n";

}

 

// Display Status

// Check who it is and set values

$is_bot = $is_admin = $is_guest = $is_account = false;

// Bot detection

if ($whos_online['customer_id'] < 0) {

$total_bots++;

$fg_color = $fg_color_bot;

$is_bot = true;

// Admin detection

} elseif ($whos_online['ip_address'] == tep_get_ip_address() ) { //$_SERVER["REMOTE_ADDR"]) {

$total_admin++;

$fg_color = $fg_color_admin;

$is_admin = true;

// Guest detection (may include Bots not detected by Prevent Spider Sessions/spiders.txt)

} elseif ($whos_online['customer_id'] == 0) {

$fg_color = $fg_color_guest;

$is_guest = true;

$total_guests++;

// Everyone else (should only be account holders)

} else {

$fg_color = $fg_color_account;

$is_account = true;

$total_loggedon++;

}

?>

<!-- Status Light Column -->

<td class="dataTableContent" align="left" valign="top">

<?php echo ' ' . tep_check_cart($whos_online['session_id'], $whos_online['customer_id'], $whos_online['session_id']); ?>

</td>

 

<!-- Time Online Column -->

<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">

<?php echo gmdate('H:i:s', $time_online); ?>

</font> </td>

 

<!-- Name Column -->

<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">

<?php

// WOL 1.6 Restructured to Check for Guest or Admin

if ( $is_guest || $is_admin )

{

echo $whos_online['full_name'] . ' ';

// Check for Bot

} elseif ( $is_bot ) {

// Tokenize UserAgent and try to find Bots name

$tok = strtok($whos_online['full_name']," ();/");

while ($tok) {

if ( strlen($tok) > 3 )

if ( !strstr($tok, "mozilla") &&

!strstr($tok, "compatible") &&

!strstr($tok, "msie") &&

!strstr($tok, "windows")

) {

echo "$tok";

break;

}

$tok = strtok(" ();/");

}

// Check for Account

} elseif ( $is_account ) {

// echo '<a HREF="customers.php?selected_box=customers&cID=' . $whos_online['customer_id'] . '&action=edit">' . $whos_online['full_name'] . '</a>';

?>

<a HREF="<?php echo ('customers.php?selected_box=customers&cID=' . $whos_online['customer_id'] . '&action=edit"');?>">

<font color="<?php echo $fg_color; ?>"> <?php echo $whos_online['full_name'];?> </font></a>

<?php

} else {

echo TEXT_ERROR;

}

?>

</font> </td>

 

<!-- IP Address Column -->

<td class="dataTableContent" valign="top">

<?php

// Show 'Admin' instead of IP for Admin

if ( $is_admin )

echo TEXT_ADMIN;

else {

// Show IP with link to IP checker

// echo '<a HREF="http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '" target="_blank">

?>

<a HREF="<?php echo ('http://www.showmyip.com/?ip=' . $whos_online['ip_address']);?>" target="_blank">

<font color="<?php echo $fg_color; ?>">

<?php

echo $whos_online['ip_address'];

}

?>

</font></a>

 

</td>

 

<!-- Time Entry Column -->

<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">

<?php echo date('H:i:s', $whos_online['time_entry']); ?>

</font></td>

 

<!-- Last Click Column -->

<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">

<?php echo date('H:i:s', $whos_online['time_last_click']); ?>

</font> </td>

 

<!-- Last URL Column -->

<td class="dataTableContent" valign="top">

<?php

$temp_url_link = $whos_online['last_page_url'];

if (eregi('^(.*)' . tep_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) {

$temp_url_display = $array[1] . $array[2];

} else {

$temp_url_display = $whos_online['last_page_url'];

}

// WOL 1.6 - Removes osCid from the Last Click URL and the link

if ( $osCsid_position = strpos($temp_url_display, "osCsid") )

$temp_url_display = substr_replace($temp_url_display, "", $osCsid_position - 1 );

if ( $osCsid_position = strpos($temp_url_link, "osCsid") )

$temp_url_link = substr_replace($temp_url_link, "", $osCsid_position - 1 );

 

// alteration for last url product name eof

if (strpos($temp_url_link,'product_info.php')) {

$temp=str_replace('product_info.php','',$temp_url_link);

$temp=str_replace('/?','',$temp);

$temp=str_replace('?','',$temp);

$parameters=split("&",$temp);

 

$i=0;

while($i < count($parameters)) {

$a=split("=",$parameters[$i]);

if ($a[0]="products_id") { $products_id=$a[1]; }

$i++;

}

$product_query=tep_db_query("select products_name from products_description where products_id='" . $products_id . "' and language_id = '" . $languages_id . "'");

$product = tep_db_fetch_array($product_query);

 

$display_link = $product['products_name'].' <I>(Product)</I>';

}elseif (strpos($temp_url_link,'?cPath=')) {

$temp=str_replace('index.php?','',$temp_url_link);

$temp=str_replace('?','',$temp);

$temp=str_replace('/','',$temp);

$parameters=split("&",$temp);

 

$i=0;

while($i < count($parameters)) {

$a=split("=",$parameters[$i]);

if ($a[0]=="cPath") { $cat=$a[1]; }

$i++;

}

 

$parameters=split("_",$cat);

 

//$cat_list='';

$i=0;

while($i < count($parameters)) {

$category_query=tep_db_query("select categories_name from categories_description where categories_id='" . $parameters[$i] . "' and language_id = '" . $languages_id . "'");

$category = tep_db_fetch_array($category_query);

if ($i>0) { $cat_list.=' / '.$category['categories_name']; } else { $cat_list=$category['categories_name']; }

 

$i++;

}

$display_link = $cat_list.' <I>(Category)</I>';

} else {

$display_link = $temp_url_display;

}

 

// alteration for last url product name eof

?>

<a HREF="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . $temp_url_link; ?>" target=\"_blank\">

<font color="<?php echo $fg_color; ?>">

<?php

// echo $temp_url_display;

echo $display_link; // alteration for last url product name

?>

</font>

</a>

</td>

 

<!-- osCsid? Column -->

<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">

<?php

if($whos_online['session_id'] != $whos_online['ip_address']) {

echo TEXT_IN_SESSION;

} else {

echo TEXT_NO_SESSION;

}

?>

</font></td>

 

<!-- Referer? Column -->

<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">

<?php

if($whos_online['http_referer'] == "") {

echo TEXT_HTTP_REFERER_NOT_FOUND;

} else {

echo TEXT_HTTP_REFERER_FOUND;

}

?>

</font></td>

</tr>

 

<tr class="dataTableRow">

<td class="dataTableContent" colspan="3"></td>

<td class="dataTableContent" colspan="6"><font color="<?php echo $fg_color; ?>">

<?php

// Display Details for All

if ( $_SERVER["QUERY_STRING"] == showAll ) {

display_details();

}

// Display Details for Bots

else if( $_SERVER["QUERY_STRING"] == showBots ){

if ( $is_bot ) {

display_details();

}

}

// Display Details for Customers

 &

Link to comment
Share on other sites

Hi

 

I have installed the 2.0 version by azer 14/2/06 & do not appear to have any problems (I think)

 

I do not quite understand how it all works though, as the figures on the bottom don't match up. I could have one customer & it shows up twice so I get 1 cust, 2 duplicate ip's = -1 real cust :blink:

 

My admin IP is the third different one I have? Down for Maintenance has another & other sites see me as another again? Probably basic computer stuff but I thought 1 computer=1 IP address?

 

Bots show as a bots with session light, but the table says No under the session column.

 

Some bots are showing as guests but the address show them as search engine or is that right?

 

I think I have a great tool here, which has installed great, but I am not using it to it's full ability, as I do not know what I could do with it. Please could someone explain the "How to use Who's online Enhancement 2.0"?

 

Sorry for being so backward :blush: & thank you for your help. :thumbsup:

 

Julie

Julie,

The customer counting code doesn't work quite right. WOE 1.3 sorted visitor's by IP address and the counters were written to take advantage of that. In 1.4, I changed the sort to be time based. That messed up the counting and isn't hasn't been fixed yet. On a side note, 1 computer doesn't have to equal 1 customer if 2 people on 2 computers are both behind the same firewall. Often the IP address is the firewall, not the individual computer's IP address.

 

A session is generated to store the customer's info like their login and cart. Bots should not have session or they will fill their search engines with session ids for your site which is bad.

 

Bots may show up as guests if your osCommerce install doesn't recognize them as bots. Install the spiders.txt contribution to have the latest and greatest bot name list, and keep it up to date.

 

Using WOE is easy and addictive. The main idea is to watch it occasionally to get a feel for how visitors (bots and people) traverse your site. On one site I know, customers browse for multiple minutes and then leave, rarely buying. On another site, they come in and either buy the item they searched for or leave immediately. This has helped suggest ways to implement advertising, info on the site, etc.

 

Good luck,

ed

Link to comment
Share on other sites

I updated my version of Whos Online and I get this error:

Fatal error: Call to undefined function: get_products() in /hsphere/local/home2/aodfan/alteredmotorsports.com/admin/whos_online.php on line 114

 

I have not modified this file at all, just dropped it in from the contribution, anyone know what the problem would be? This is the code withine the file:

Where do you store your sessions (catalog AND admin)?

What settings do you have in admin under Configuration->Sessions?

Is the function get_products() in admin/includes/classes/shopping_cart.php?

 

ed

Link to comment
Share on other sites

Julie,

The customer counting code doesn't work quite right. WOE 1.3 sorted visitor's by IP address and the counters were written to take advantage of that. In 1.4, I changed the sort to be time based. That messed up the counting and isn't hasn't been fixed yet. On a side note, 1 computer doesn't have to equal 1 customer if 2 people on 2 computers are both behind the same firewall. Often the IP address is the firewall, not the individual computer's IP address.

 

A session is generated to store the customer's info like their login and cart. Bots should not have session or they will fill their search engines with session ids for your site which is bad.

 

Bots may show up as guests if your osCommerce install doesn't recognize them as bots. Install the spiders.txt contribution to have the latest and greatest bot name list, and keep it up to date.

 

Using WOE is easy and addictive. The main idea is to watch it occasionally to get a feel for how visitors (bots and people) traverse your site. On one site I know, customers browse for multiple minutes and then leave, rarely buying. On another site, they come in and either buy the item they searched for or leave immediately. This has helped suggest ways to implement advertising, info on the site, etc.

 

Good luck,

ed

 

Thanks Ed

 

How is this install recognising my IP address because it is different to the one Down for maintenance recognises? :blink:

 

Which bit should I look at for the sessions on bots? The lights say bot with session, but the column says no. When I look at "all" the bot does not have an oscsid number. So does that mean it is OK. I do have the spiders.txt & keep it up to date, but it is still showing some as guests. When I click on the IP address it either comes up with ! which i presume is a proper customer, or takes me so a new window with the bot/search engine details. This is showing guest too.

 

I do not have a robots.txt yet as what should be in it varies greatly & I'm a little confused. I have asked on another thread but haven't come to a conclusion yet. I should do that too. :blush:

 

Thanks for your help. I absorb all the advise I can get.

 

Julie

Link to comment
Share on other sites

Thanks Ed

 

How is this install recognising my IP address because it is different to the one Down for maintenance recognises? :blink:

 

Which bit should I look at for the sessions on bots? The lights say bot with session, but the column says no. When I look at "all" the bot does not have an oscsid number. So does that mean it is OK. I do have the spiders.txt & keep it up to date, but it is still showing some as guests. When I click on the IP address it either comes up with ! which i presume is a proper customer, or takes me so a new window with the bot/search engine details. This is showing guest too.

 

I do not have a robots.txt yet as what should be in it varies greatly & I'm a little confused. I have asked on another thread but haven't come to a conclusion yet. I should do that too. :blush:

 

Thanks for your help. I absorb all the advise I can get.

 

Julie

Julie,

 

WOE makes a standard HTTP check for the IP address. I don't know how the Down for Maintenance does it.

 

The alternate text for the lights incorrectly says "with sessions". If the Details view is correct.

 

When you say a bot shows as a guest, how do you know it is a bot?

 

I suggest checking out the robots.txt contrib. It is a seperate issue from the spiders.txt but is useful to use.

 

ed

Link to comment
Share on other sites

Hi Ed,

 

Yes I have both configure files set to use mysql for the sessions. Any further ideas?

 

Thanks

 

Mark

Mark,

 

What are the settings under Configuration->Sessions in admin?

 

ed

Link to comment
Share on other sites

Does anybody have any ideas on what might be wrong with my WOE module? Please..., I really need your help.

 

Thanks.

Irina,

 

I don't know what is different between 1.9 and 2.0. I'm only at 1.8. A few people have posted that they are having none (or few) problems with 2.0.

 

What are the settings under Configuration->Sessions in admin?

 

ed

Link to comment
Share on other sites

Irina,

 

I don't know what is different between 1.9 and 2.0. I'm only at 1.8. A few people have posted that they are having none (or few) problems with 2.0.

 

What are the settings under Configuration->Sessions in admin?

 

ed

Ed,

 

In my Configuration-> Sessions I have the following settings:

Allow AutoLogon Cookie false

Session Directory /var/www/store/oscommerce/sessions/

Force Cookie Use False

Check SSL Session ID False

Check User Agent False

Check IP Address False

Prevent Spider Sessions True

Recreate Session False

Allow AutoLogon Cookie

Most of the time I'm getting the following message in my WOE after clicking Refresh, and it also takes a while to refresh the screen. Although, sometimes it refreshes itself in just a second.
Fatal error: Maximum execution time of 160 seconds exceeded in /var/www/store/osCommerce/admin/whos_online.php on line 94
I ran out of ideas what might be wrong here. I tried to upload the original files but getting the same error. I'll appreciate if somebody could help me to fix it. It really bothering a lot.

 

Thanks.

Edited by Irin
Link to comment
Share on other sites

Where do you store your sessions (catalog AND admin)?

What settings do you have in admin under Configuration->Sessions?

Is the function get_products() in admin/includes/classes/shopping_cart.php?

 

ed

 

Sessions are in /tmp on both catalog and admin.

Here are the settings that I have in admin under Configuration>Sessions:

settings.gif

Yes, that function is in that file.

 

Dont know what else, what file(s) do you need me to post?

 

Thanks

Link to comment
Share on other sites

Hi there,

 

Looks like a great contribution thus far from wht ive seen on it.

 

Ive followed the instructions, ran the sql code and im getting the following errors:

 

1054 - Unknown column 'user_agent' in 'field list'

 

select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent, session_id from whos_online order by time_last_click DESC

 

Im presently using whos online enhancement 2.0

Things still to do before going "live" in no real order...

Change "buy now buttons" css styles

Change "lets see what we have here" into something meaningfull

Main logo of the website

Sort out currency to make site UK only (at present)

Remove "xx requests since" stuff

Update mainpage :D

Move shopping cart status into header

Add in stock status to product listing page

Define styles for product listing standardisation

Change CSS background for Headings

Increase Category size headings

Used mods so far:- basic_design_pack1mk7 | Google XML sitemap w admin | Paypal IPN v 1.2 | Feedmachine | pricematch_1_3_1 | Dynamic Sitemap 1.6 | Whos online Enhancement | Easypopulate 2.72

 

Each one that I solve I;ll be putting a post on the forum in a "completed shop" thread that Im writing up

Link to comment
Share on other sites

Hi there,

 

Looks like a great contribution thus far from wht ive seen on it.

 

Ive followed the instructions, ran the sql code and im getting the following errors:

 

1054 - Unknown column 'user_agent' in 'field list'

 

select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent, session_id from whos_online order by time_last_click DESC

 

Im presently using whos online enhancement 2.0

 

 

I wish I could edit my posts lol.

SOLVED

 

I was confused where it mentions option 2a, i wasnt sure if you had to run option 2b.

Things still to do before going "live" in no real order...

Change "buy now buttons" css styles

Change "lets see what we have here" into something meaningfull

Main logo of the website

Sort out currency to make site UK only (at present)

Remove "xx requests since" stuff

Update mainpage :D

Move shopping cart status into header

Add in stock status to product listing page

Define styles for product listing standardisation

Change CSS background for Headings

Increase Category size headings

Used mods so far:- basic_design_pack1mk7 | Google XML sitemap w admin | Paypal IPN v 1.2 | Feedmachine | pricematch_1_3_1 | Dynamic Sitemap 1.6 | Whos online Enhancement | Easypopulate 2.72

 

Each one that I solve I;ll be putting a post on the forum in a "completed shop" thread that Im writing up

Link to comment
Share on other sites

Mark,

 

What are the settings under Configuration->Sessions in admin?

 

ed

 

Hi Ed,

 

Sorry for taking so long to get back to this, my settings are as follows:

 

Session Directory /tmp

Force Cookie Use False

Check SSL Session ID False

Check User Agent False

Check IP Address False

Prevent Spider Sessions True

Recreate Session False

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Hello again

 

One quick question:

 

In configure.php I have this -

 

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

 

my sessions are stored in a folder called /sessions but my Who's Online isn't working properly (as per my previous posts).

 

I'm pretty sure that sessions are the problem, would the above be that problem?

Thanks for any help/comments.

 

Regards,

 

Lewis Hill

Link to comment
Share on other sites

Hi there!

 

I would really like to install this contrib so I can keep track of visitors online but I have a couple questions first since right now I am live and I don't want to take the risk unless I know the details.

 

 

First question -- Do I have to have the regular Who's Online contrib installed to use this one? I don't want the stats shown to visitors on the catalog side, just to me on the admin side.

 

 

Second question -- The readme file hasn't been updated since 3 versions ago. Is there any new readme file or any alterations that aren't in the current read me file because I don't want to install it wrong.

 

 

 

Thanks for anything you can help me with!

 

-- Sarah

Link to comment
Share on other sites

Hi There,

 

Ive been using this for the last week and only just realised that its not chaning the ip address to the name of a bot as listed in my spiders.txt

 

for example

 

00:13:43 Guest 66.249.65.130 09:53:26 10:07:09 /shop/thermaltake-armor-va8000swa-aluminum-window-pi-63.html Yes Not Found

Name: Guest

 

ID: 0

 

IP Address: 66.249.65.130

 

User Agent:

 

osCsid:

 

Clicking on the ip address shows it as gigablast.com and i know that I've had a few sniffs from google bot.

 

As Sarah above me said, the documents havent been updated so is there anything I need to do. Ive had apoke around in here for an answr but not found anything yet.

Things still to do before going "live" in no real order...

Change "buy now buttons" css styles

Change "lets see what we have here" into something meaningfull

Main logo of the website

Sort out currency to make site UK only (at present)

Remove "xx requests since" stuff

Update mainpage :D

Move shopping cart status into header

Add in stock status to product listing page

Define styles for product listing standardisation

Change CSS background for Headings

Increase Category size headings

Used mods so far:- basic_design_pack1mk7 | Google XML sitemap w admin | Paypal IPN v 1.2 | Feedmachine | pricematch_1_3_1 | Dynamic Sitemap 1.6 | Whos online Enhancement | Easypopulate 2.72

 

Each one that I solve I;ll be putting a post on the forum in a "completed shop" thread that Im writing up

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...