Would you like to see which 'template' your customer is visiting when looking at whos_online ?
I did, and here's what you need to do if you also wish to ....
WHOS ONLINE FOR MULTISITE
Add following column to whos_online in database -
site varchar(50)
/zencart/admin/includes/languages/english/whos_online.php
add -
define('TEXT_SITE', '<strong>Site:</strong> ');
/zencart/admin/whos_online.php
change -
$who_query = $db->Execute("select session_id, time_entry, time_last_click, host_address, user_agent
from " . TABLE_WHOS_ONLINE . "
where session_id='" . $which . "'");
to -
$who_query = $db->Execute("select session_id, time_entry, time_last_click, host_address, user_agent, site
from " . TABLE_WHOS_ONLINE . "
where session_id='" . $which . "'");
change -
$sql = "select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id, host_address, user_agent
from " . TABLE_WHOS_ONLINE . " :where: order by :orderby:";
to -
$sql = "select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id, host_address, user_agent, site
from " . TABLE_WHOS_ONLINE . " :where: order by :orderby:";
change -
echo TEXT_SESSION_ID . zen_output_string_protected($whos_online->fields['session_id']) . '<br />' .
TEXT_HOST . zen_output_string_protected($whos_online->fields['host_address']) . '<br />' .
TEXT_USER_AGENT . zen_output_string_protected($whos_online->fields['user_agent']) . '<br />';
to -
echo TEXT_SESSION_ID . zen_output_string_protected($whos_online->fields['session_id']) . '<br />' .
TEXT_HOST . zen_output_string_protected($whos_online->fields['host_address']) . '<br />' .
TEXT_SITE . zen_output_string_protected($whos_online->fields['site']) . '<br />' .
TEXT_USER_AGENT . zen_output_string_protected($whos_online->fields['user_agent']) . '<br />';
/zencart/includes/functions/whos_online.php
change -
$wo_user_agent = substr(zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']), 0, 254);
to -
$wo_user_agent = substr(zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']), 0, 254);
$wo_site = SITE_NAME;
change -
$sql = "update " . TABLE_WHOS_ONLINE . "
set customer_id = '" . (int)$wo_customer_id . "',
full_name = '" . zen_db_input($wo_full_name) . "',
ip_address = '" . zen_db_input($wo_ip_address) . "',
time_last_click = '" . zen_db_input($current_time) . "',
last_page_url = '" . zen_db_input($wo_last_page_url) . "',
host_address = '" . zen_db_input($_SESSION['customers_host_address']) . "',
user_agent = '" . zen_db_input($wo_user_agent) . "'
where session_id = '" . zen_db_input($wo_session_id) . "' and ip_address='" . zen_db_input($wo_ip_address) . "'";
to -
$sql = "update " . TABLE_WHOS_ONLINE . "
set customer_id = '" . (int)$wo_customer_id . "',
full_name = '" . zen_db_input($wo_full_name) . "',
ip_address = '" . zen_db_input($wo_ip_address) . "',
time_last_click = '" . zen_db_input($current_time) . "',
last_page_url = '" . zen_db_input($wo_last_page_url) . "',
host_address = '" . zen_db_input($_SESSION['customers_host_address']) . "',
user_agent = '" . zen_db_input($wo_user_agent) . "',
site = '" . zen_db_input($wo_site) . "'
where session_id = '" . zen_db_input($wo_session_id) . "' and ip_address='" . zen_db_input($wo_ip_address) . "'";
change -
$sql = "insert into " . TABLE_WHOS_ONLINE . "
(customer_id, full_name, session_id, ip_address, time_entry,
time_last_click, last_page_url, host_address, user_agent)
values ('" . (int)$wo_customer_id . "', '" . zen_db_input($wo_full_name) . "', '"
. zen_db_input($wo_session_id) . "', '" . zen_db_input($wo_ip_address)
. "', '" . zen_db_input($current_time) . "', '" . zen_db_input($current_time)
. "', '" . zen_db_input($wo_last_page_url)
. "', '" . zen_db_input($_SESSION['customers_host_address'])
. "', '" . zen_db_input($wo_user_agent)
. "')";
to -
$sql = "insert into " . TABLE_WHOS_ONLINE . "
(customer_id, full_name, session_id, ip_address, time_entry,
time_last_click, last_page_url, host_address, user_agent, site)
values ('" . (int)$wo_customer_id . "', '" . zen_db_input($wo_full_name) . "', '"
. zen_db_input($wo_session_id) . "', '" . zen_db_input($wo_ip_address)
. "', '" . zen_db_input($current_time) . "', '" . zen_db_input($current_time)
. "', '" . zen_db_input($wo_last_page_url)
. "', '" . zen_db_input($_SESSION['customers_host_address'])
. "', '" . zen_db_input($wo_user_agent)
. "', '" . zen_db_input($wo_site)
. "')";