Execute("select sesskey, value from " . TABLE_SESSIONS . " where sesskey= '" . $which . "'"); $who_query = $db->Execute("select session_id, time_entry, time_last_click, host_address, user_agent from " . TABLE_WHOS_ONLINE . " where session_id='" . $which . "'"); // longer than 2 minutes light color $xx_mins_ago_long = (time() - WHOIS_TIMER_INACTIVE); switch (true) { case ($which_query->RecordCount() == 0): if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) { return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif'); } else { return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif'); } break; case (strstr($which_query->fields['value'],'"contents";a:0:')): if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) { return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif'); } else { return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif'); } break; case (!strstr($which_query->fields['value'],'"contents";a:0:')): if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) { return zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif'); } else { return zen_image(DIR_WS_IMAGES . 'icon_status_green.gif'); } break; } } // time since last click function zen_check_minutes($the_time_last_click) { $the_seconds = (time() - $the_time_last_click); $the_time_since= gmdate('H:i:s', $the_seconds); return $the_time_since; } require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); // same time_entry as time_last_click for 600 seconds = 10 minutes assumed to have left immediately $xx_mins_ago_dead = (time() - WHOIS_TIMER_DEAD); // remove after how many seconds? default= 1200 = 20 minutes $xx_mins_ago = (time() - WHOIS_TIMER_REMOVE); // remove entries that have expired $db->Execute("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "' or (time_entry=time_last_click and time_last_click < '" . $xx_mins_ago_dead . "')"); ?> > <?php echo TITLE; ?>
' . '' . WHOS_ONLINE_REFRESH_LIST_TEXT . '' . '' . '  ' . WHOS_ONLINE_LEGEND_TEXT . ' ' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . ' ' . WHOS_ONLINE_ACTIVE_TEXT . '  ' . zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . ' ' . WHOS_ONLINE_INACTIVE_TEXT . '  ' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . ' ' . WHOS_ONLINE_ACTIVE_NO_CART_TEXT . '  ' . zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif') . ' ' . WHOS_ONLINE_INACTIVE_NO_CART_TEXT . '
' . WHOS_ONLINE_INACTIVE_LAST_CLICK_TEXT . ' ' . WHOIS_TIMER_INACTIVE . 's' . ' || ' . WHOS_ONLINE_INACTIVE_ARRIVAL_TEXT . ' ' . WHOIS_TIMER_DEAD . 's ' . WHOS_ONLINE_REMOVED_TEXT; ?>
Execute("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 . " order by $order"); $total_sess = $whos_online->RecordCount(); echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess); ?>
'' . TABLE_HEADING_SHOPPING_CART . ''); if (STORE_SESSIONS == 'db') { $session_data = $db->Execute("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'"); $session_data = trim($session_data->fields['value']); } else { if ( (file_exists(zen_session_save_path() . '/sess_' . $info)) && (filesize(zen_session_save_path() . '/sess_' . $info) > 0) ) { $session_data = file(zen_session_save_path() . '/sess_' . $info); $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)); // fix nnobo bug $session_data_cart = substr($session_data, $start_cart, $i - $start_cart); $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($_SESSION['cart'])) { $contents[] = array('text' => $full_name . ' - ' . $ip_address . '
' . $info); $products = $_SESSION['cart']->get_products(); for ($i = 0, $n = sizeof($products); $i < $n; $i++) { $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . '' . $products[$i]['name'] . ''); // cPath=23&pID=74 } if (sizeof($products) > 0) { $contents[] = array('text' => zen_draw_separator('pixel_black.gif', '100%', '1')); $contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($_SESSION['cart']->show_total(), true, $_SESSION['currency'])); } else { $contents[] = array('text' => TEXT_EMPTY_CART); } } } } if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { echo ' ' . "\n"; } ?>
EOF) { $time_online = (time() - $whos_online->fields['time_entry']); if ( ((!$_GET['info']) || (@$_GET['info'] == $whos_online->fields['session_id'])) && (!$info) ) { $info = $whos_online->fields['session_id']; $ip_address = $whos_online->fields['ip_address']; $full_name = $whos_online->fields['full_name']; } // Check for duplicates if (in_array($whos_online->fields['ip_address'], $ip_array)) { $d++; } else { $ip_array[] = $whos_online->fields['ip_address']; } // Check for bots $is_a_bot=zen_check_bot($whos_online->fields['session_id']); if ($whos_online->fields['session_id'] == $info) { if ($is_a_bot==true) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } } else { if ($is_a_bot==true) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } } ?> fields['session_id'] == $info) { if ($is_a_bot==true) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } } else { if ($is_a_bot==true) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } } ?> MoveNext(); } if (!$d) { $d=0; } $total_dupes = $d; $total_sess = $whos_online->RecordCount(); $ip_unique = sizeof($ip_array); $total_cust = $total_sess - $total_dupes; ?> = if ($whos_online->RecordCount() >= WHOIS_REPEAT_LEGEND_BOTTOM) { ?>
' . TABLE_HEADING_FULL_NAME . '' : TABLE_HEADING_FULL_NAME); ?> 
">' . 'Asc' . '' : '' . 'Asc' . ''); ?>   ">' . 'Desc' . '' : '' . 'Desc' . ''); ?> 
' . TABLE_HEADING_IP_ADDRESS . '' : TABLE_HEADING_IP_ADDRESS); ?> 
">' . 'Asc' . '' : '' . 'Asc' . ''); ?>   ">' . 'Desc' . '' : '' . 'Desc' . ''); ?> 
' . TABLE_HEADING_SESSION_ID . '' : TABLE_HEADING_SESSION_ID); ?> 
">' . 'Asc' . '' : '' . 'Asc' . ''); ?>   ">' . 'Desc' . '' : '' . 'Desc' . ''); ?> 
' . TABLE_HEADING_ENTRY_TIME . '' : TABLE_HEADING_ENTRY_TIME); ?> 
">' . 'Asc' . '' : '' . 'Asc' . ''); ?>   ">' . 'Desc' . '' : '' . 'Desc' . ''); ?> 
' . TABLE_HEADING_LAST_CLICK . '' : TABLE_HEADING_LAST_CLICK); ?> 
">' . 'Asc' . '' : '' . 'Asc' . ''); ?>   ">' . 'Desc' . '' : '' . 'Desc' . ''); ?> 
' . TABLE_HEADING_LAST_PAGE_URL . '' : TABLE_HEADING_LAST_PAGE_URL); ?> 
">' . 'Asc' . '' : '' . 'Asc' . ''); ?>   ">' . 'Desc' . '' : '' . 'Desc' . ''); ?> 
fields['session_id']) . ' ' . gmdate('H:i:s', $time_online); ?> fields['customer_id'] != 0) { echo '' . $whos_online->fields['customer_id'] . ''; } else { echo $whos_online->fields['customer_id']; } ?> fields['customer_id'] != 0) { echo '' . '' . $whos_online->fields['full_name'] . ''; } else { echo $whos_online->fields['full_name']; } ?> ' . $whos_online->fields['ip_address'] . ''; ?> fields['time_entry']); ?> fields['time_last_click']); ?>  
      ' . zen_check_minutes($whos_online->fields['time_last_click']); ?> ago fields['session_id'] . '
' . TEXT_HOST . $whos_online->fields['host_address'] . '
' . TEXT_USER_AGENT . $whos_online->fields['user_agent'] . '
'; if (eregi('^(.*)' . zen_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online->fields['last_page_url'], $array)) { echo $array[1] . $array[2]; } else { echo "" . '' . $whos_online->fields['last_page_url'] . '' . ""; } ?>
Legend: Inactive is Last Click >= " . WHOIS_TIMER_INACTIVE . "s" . "   || Inactive since arrival > " . WHOIS_TIMER_DEAD . "s will be removed";?>
Duplicate IP Addresses: $total_dupes
Total Unique Users: $total_cust.";?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '