[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 whos_online.php

Zen Cart 源代码 whos_online.php




下载文件

文件名: whos_online.php
文件类型: PHP文件
文件大小: 24.09 KiB
MD5: 3fcd8aef085ad46ec1b74ceca0bbd5b4

whos_online.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2010 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: whos_online.php 17070 2010-07-29 20:52:40Z drbyte $
  8.  */
  9.  
  10. // highlight bots
  11. function zen_check_bot($checking) {
  12.   // googlebot.com and google.com
  13.   if (empty($checking)) {
  14.     return true;
  15.   } else {
  16.     return false;
  17.   }
  18. }
  19.  
  20. // host for current ip
  21. function zen_check_quantity($which) {
  22.   global $db;
  23.   $which_query = $db->Execute("select sesskey, value
  24.                                   from " . TABLE_SESSIONS . "
  25.                                   where sesskey= '" . $which . "'");
  26.  
  27.  
  28.   $who_query = $db->Execute("select session_id, time_entry, time_last_click, host_address, user_agent
  29.                                 from " . TABLE_WHOS_ONLINE . "
  30.                                 where session_id='" . $which . "'");
  31.  
  32.   // longer than 2 minutes light color
  33.   $xx_mins_ago_long = (time() - WHOIS_TIMER_INACTIVE);
  34.  
  35.   $chk_cart_status = base64_decode($which_query->fields['value']);
  36.   switch (true) {
  37.     case ($which_query->RecordCount() == 0):
  38.     if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
  39.       return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif');
  40.     } else {
  41.       return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  42.     }
  43.     break;
  44.     case (strstr($chk_cart_status,'"contents";a:0:')):
  45.     if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
  46.       return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif');
  47.     } else {
  48.       return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  49.     }
  50.     break;
  51.     case (!strstr($chk_cart_status,'"contents";a:0:')):
  52.     if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
  53.       return zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif');
  54.     } else {
  55.       return zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
  56.     }
  57.     break;
  58.   }
  59. }
  60.  
  61. // time since last click
  62. function zen_check_minutes($the_time_last_click) {
  63.   $the_seconds = (time() - $the_time_last_click);
  64.   $the_time_since= gmdate('H:i:s', $the_seconds);
  65.   return $the_time_since;
  66. }
  67.  
  68.   require('includes/application_top.php');
  69.  
  70.   require(DIR_WS_CLASSES . 'currencies.php');
  71.   $currencies = new currencies();
  72.  
  73.   // same time_entry as time_last_click for 600 seconds = 10 minutes assumed to have left immediately
  74.   $xx_mins_ago_dead = (time() - WHOIS_TIMER_DEAD);
  75.  
  76.   // remove after how many seconds? default= 1200 = 20 minutes
  77.   $xx_mins_ago = (time() - WHOIS_TIMER_REMOVE);
  78.  
  79. // remove entries that have expired
  80.   $db->Execute("delete from " . TABLE_WHOS_ONLINE . "
  81.                where time_last_click < '" . $xx_mins_ago . "'
  82.                or (time_entry=time_last_click
  83.                and time_last_click < '" . $xx_mins_ago_dead . "')");
  84. ?>
  85. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  86. <html <?php echo HTML_PARAMS; ?>>
  87. <head>
  88. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  89. <title><?php echo TITLE; ?></title>
  90. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  91. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  92. <script language="javascript" src="includes/menu.js"></script>
  93. <script language="javascript" src="includes/general.js"></script>
  94. <script type="text/javascript">
  95.   <!--
  96.   function init()
  97.   {
  98.     cssjsmenu('navbar');
  99.     if (document.getElementById)
  100.     {
  101.       var kill = document.getElementById('hoverJS');
  102.       kill.disabled = true;
  103.     }
  104.   }
  105.   // -->
  106. </script>
  107. </head>
  108. <body onLoad="init()">
  109. <!-- header //-->
  110. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  111. <!-- header_eof //-->
  112.  
  113. <!-- body //-->
  114. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  115.   <tr>
  116. <!-- body_text //-->
  117.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  118.       <tr>
  119.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  120.           <tr>
  121.             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  122.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  123.           </tr>
  124.           <tr>
  125.             <td class="smallText" colspan="2">
  126.             <?php echo
  127.               '<a href="' . zen_href_link(FILENAME_WHOS_ONLINE . '.php', zen_get_all_get_params()) . '" class="menuBoxContentLink">' .
  128.   '<b><u>' . WHOS_ONLINE_REFRESH_LIST_TEXT . '</u></b>' . '</a>' .
  129.   '&nbsp;&nbsp;' . WHOS_ONLINE_LEGEND_TEXT . '&nbsp;' .
  130.   zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . '&nbsp;' . WHOS_ONLINE_ACTIVE_TEXT . '&nbsp;&nbsp;' .
  131.   zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . '&nbsp;' . WHOS_ONLINE_INACTIVE_TEXT . '&nbsp;&nbsp;' .
  132.   zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . '&nbsp;' . WHOS_ONLINE_ACTIVE_NO_CART_TEXT . '&nbsp;&nbsp;' .
  133.   zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif') . '&nbsp;' . WHOS_ONLINE_INACTIVE_NO_CART_TEXT . '<br>' .
  134.   WHOS_ONLINE_INACTIVE_LAST_CLICK_TEXT . '&nbsp;' . WHOIS_TIMER_INACTIVE . 's' .
  135.   '&nbsp;||&nbsp;' . WHOS_ONLINE_INACTIVE_ARRIVAL_TEXT . '&nbsp;' .
  136.   WHOIS_TIMER_DEAD . 's&nbsp;' . WHOS_ONLINE_REMOVED_TEXT;
  137.             ?>
  138.             </td>
  139.           </tr>
  140.           <tr>
  141.             <td class="smallText" colspan="2">
  142. <?php
  143.           $listing= $_GET['listing'];
  144.           switch ($listing) {
  145.               case "full_name-desc":
  146.               $order = "full_name DESC, LPAD(ip_address,11,'0')";
  147.               break;
  148.               case "full_name":
  149.               $order = "full_name, LPAD(ip_address,11,'0')";
  150.               break;
  151.               case "ip_address":
  152.               $order = "ip_address, session_id";
  153.               break;
  154.               case "ip_address-desc":
  155.               $order = "ip_address DESC, session_id";
  156.               break;
  157.               case "time_last_click-desc":
  158.               $order = "time_last_click DESC, LPAD(ip_address,11,'0')";
  159.               break;
  160.               case "time_last_click":
  161.               $order = "time_last_click, LPAD(ip_address,11,'0')";
  162.               break;
  163.               case "time_entry-desc":
  164.               $order = "time_entry DESC, LPAD(ip_address,11,'0')";
  165.               break;
  166.               case "time_entry":
  167.               $order = "time_entry, LPAD(ip_address,11,'0')";
  168.               break;
  169.               case "last_page_url-desc":
  170.               $order = "last_page_url DESC, LPAD(ip_address,11,'0')";
  171.               break;
  172.               case "last_page_url":
  173.               $order = "last_page_url, LPAD(ip_address,11,'0')";
  174.               break;
  175.               case "session_id":
  176.               $order = "session_id, ip_address";
  177.               break;
  178.               case "session_id-desc":
  179.               $order = "session_id DESC, ip_address";
  180.               break;
  181.               default:
  182.               $order = "time_entry, LPAD(ip_address,11,'0')";
  183.           }
  184.  
  185.   $whos_online = $db->Execute("select customer_id, full_name, ip_address, time_entry, time_last_click,
  186.                                      last_page_url, session_id, host_address, user_agent
  187.                               from " . TABLE_WHOS_ONLINE . "
  188.                               order by $order");
  189.  
  190.   $total_sess = $whos_online->RecordCount();
  191.   echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess);
  192. ?>
  193.             </td>
  194.           </tr>
  195.           <tr>
  196.             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  197.           </tr>
  198.         </table></td>
  199.       </tr>
  200.       <tr>
  201.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  202.           <tr>
  203.             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  204.               <tr class="dataTableHeadingRowWhois">
  205.                 <td class="dataTableHeadingContentWhois"><?php echo TABLE_HEADING_ONLINE; ?></td>
  206.                 <td class="dataTableHeadingContentWhois" align="center"><?php echo TABLE_HEADING_CUSTOMER_ID; ?></td>
  207.  
  208.                 <td class="dataTableHeadingContentWhois" align="center">
  209.                   <?php echo (($listing=='full_name-desc' or $listing=='full_name') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_FULL_NAME . '</span>' : TABLE_HEADING_FULL_NAME); ?>&nbsp;
  210.                   <br><a href="<?php echo "$PHP_SELF?listing=full_name"; ?>"><?php echo ($listing=='full_name' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  211.                   &nbsp;<a href="<?php echo "$PHP_SELF?listing=full_name-desc"; ?>"><?php echo ($listing=='full_name-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  212.                 </td>
  213.                 <td class="dataTableHeadingContentWhois" align="center">
  214.                   <?php echo (($listing=='ip_address-desc' or $listing=='ip_address') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_IP_ADDRESS . '</span>' : TABLE_HEADING_IP_ADDRESS); ?>&nbsp;
  215.                   <br><a href="<?php echo "$PHP_SELF?listing=ip_address"; ?>"><?php echo ($listing=='ip_address' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  216.                   &nbsp;<a href="<?php echo "$PHP_SELF?listing=ip_address-desc"; ?>"><?php echo ($listing=='ip_address-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  217.                 </td>
  218.                 <td class="dataTableHeadingContentWhois" align="center">
  219.                   <?php echo (($listing=='session_id-desc' or $listing=='session_id') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_SESSION_ID . '</span>' : TABLE_HEADING_SESSION_ID); ?>&nbsp;
  220.                   <br><a href="<?php echo "$PHP_SELF?listing=session_id"; ?>"><?php echo ($listing=='session_id' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  221.                   &nbsp;<a href="<?php echo "$PHP_SELF?listing=session_id-desc"; ?>"><?php echo ($listing=='session_id-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  222.                 </td>
  223.                 <td class="dataTableHeadingContentWhois" align="center">
  224.                   <?php echo (($listing=='time_entry-desc' or $listing=='time_entry') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_ENTRY_TIME . '</span>' : TABLE_HEADING_ENTRY_TIME); ?>&nbsp;
  225.                   <br><a href="<?php echo "$PHP_SELF?listing=time_entry"; ?>"><?php echo ($listing=='time_entry' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  226.                   &nbsp;<a href="<?php echo "$PHP_SELF?listing=time_entry-desc"; ?>"><?php echo ($listing=='time_entry-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  227.                 </td>
  228.                 <td class="dataTableHeadingContentWhois" align="center">
  229.                   <?php echo (($listing=='time_last_click-desc' or $listing=='time_last_click') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_LAST_CLICK . '</span>' : TABLE_HEADING_LAST_CLICK); ?>&nbsp;
  230.                   <br><a href="<?php echo "$PHP_SELF?listing=time_last_click"; ?>"><?php echo ($listing=='time_last_click' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  231.                   &nbsp;<a href="<?php echo "$PHP_SELF?listing=time_last_click-desc"; ?>"><?php echo ($listing=='time_last_click-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  232.                 </td>
  233.                 <td class="dataTableHeadingContentWhois" align="center">
  234.                   <?php echo (($listing=='last_page_url-desc' or $listing=='last_page_url') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_LAST_PAGE_URL . '</span>' : TABLE_HEADING_LAST_PAGE_URL); ?>&nbsp;
  235.                   <br><a href="<?php echo "$PHP_SELF?listing=last_page_url"; ?>"><?php echo ($listing=='last_page_url' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  236.                   &nbsp;<a href="<?php echo "$PHP_SELF?listing=last_page_url-desc"; ?>"><?php echo ($listing=='last_page_url-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  237.                 </td>
  238.               </tr>
  239. <?php
  240.   $ip_array = array();
  241.   $d=0;
  242.   while (!$whos_online->EOF) {
  243.     $time_online = (time() - $whos_online->fields['time_entry']);
  244.     if ( ((!$_GET['info']) || (@$_GET['info'] == $whos_online->fields['session_id'])) && (!$info) ) {
  245.       $info = $whos_online->fields['session_id'];
  246.       $ip_address = $whos_online->fields['ip_address'];
  247.       $full_name = $whos_online->fields['full_name'];
  248.     }
  249.  
  250. // Check for duplicates
  251.     if (in_array($whos_online->fields['ip_address'], $ip_array)) {
  252.       $d++;
  253.     } else {
  254.       $ip_array[] = $whos_online->fields['ip_address'];
  255.     }
  256.  
  257. // Check for bots
  258.     $is_a_bot=zen_check_bot($whos_online->fields['session_id']);
  259.   if ($whos_online->fields['session_id'] == $info) {
  260.       if ($is_a_bot==true) {
  261.         echo '              <tr class="dataTableRowSelectedBot">' . "\n";
  262.       } else {
  263.         echo '              <tr class="dataTableRowSelectedWhois">' . "\n";
  264.       }
  265.   } else {
  266.     if ($is_a_bot==true) {
  267.         echo '              <tr class="dataTableRowBot" onmouseover="this.className=\'dataTableRowOverBot\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRowBot\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online->fields['session_id'], 'NONSSL') . '\'">' . "\n";
  268.       } else {
  269.         echo '              <tr class="dataTableRowWhois" onmouseover="this.className=\'dataTableRowOverWhois\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRowWhois\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online->fields['session_id'], 'NONSSL') . '\'">' . "\n";
  270.       }
  271.   }
  272. ?>
  273.                 <td class="dataTableContentWhois"><?php echo zen_check_quantity($whos_online->fields['session_id']) . '&nbsp;' . gmdate('H:i:s', $time_online); ?></td>
  274.                 <td class="dataTableContentWhois" align="center">
  275.                   <?php
  276.                     if ($whos_online->fields['customer_id'] != 0) {
  277.                       echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $whos_online->fields['customer_id'] . '&action=edit', 'NONSSL') . '"><u>' . $whos_online->fields['customer_id'] . '</u></a>';
  278.                     } else {
  279.                       echo $whos_online->fields['customer_id'];
  280.                     }
  281.                   ?>
  282.                 </td>
  283.                 <td class="dataTableContentWhois" nowrap="nowrap">
  284.                   <?php
  285.                     if ($whos_online->fields['customer_id'] != 0) {
  286.                       echo '<a href="' . zen_href_link(FILENAME_ORDERS, 'cID=' . $whos_online->fields['customer_id'], 'NONSSL') . '">' . '<u>' . $whos_online->fields['full_name'] . '</u></a>';
  287.                     } else {
  288.                       echo $whos_online->fields['full_name'];
  289.                     }
  290.                   ?>
  291.                 </td>
  292.                 <td class="dataTableContentWhois" align="left"><a href="http://whois.domaintools.com/<?php echo $whos_online->fields['ip_address']; ?>" target="new"><?php echo '<u>' . $whos_online->fields['ip_address'] . '</u>'; ?></a></td>
  293.                 <td class="dataTableContentWhois"><?php echo date('H:i:s', $whos_online->fields['time_entry']); ?></td>
  294.                 <td class="dataTableContentWhois" align="center"><?php echo date('H:i:s', $whos_online->fields['time_last_click']); ?></td>
  295.                 <td class="dataTableContentWhois" colspan="2">&nbsp;</td>
  296.               </tr>
  297. <?php
  298.   // show host name
  299.   if (WHOIS_SHOW_HOST=='1') {
  300.     if ($whos_online->fields['session_id'] == $info) {
  301.     if ($is_a_bot==true) {
  302.         echo '              <tr class="dataTableRowSelectedBot">' . "\n";
  303.       } else {
  304.         echo '              <tr class="dataTableRowSelectedWhois">' . "\n";
  305.       }
  306.     } else {
  307.       if ($is_a_bot==true) {
  308.         echo '              <tr class="dataTableRowBot" onmouseover="this.className=\'dataTableRowOverBot\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRowBot\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online->fields['session_id'], 'NONSSL') . '\'">' . "\n";
  309.       } else {
  310.         echo '              <tr class="dataTableRowWhois" onmouseover="this.className=\'dataTableRowOverWhois\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRowWhois\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online->fields['session_id'], 'NONSSL') . '\'">' . "\n";
  311.       }
  312.   }
  313. ?>
  314.                 <td class="dataTableContentWhois" colspan=3 valign="top">&nbsp;&nbsp;<?php echo TIME_PASSED_LAST_CLICKED . '<br />&nbsp;&nbsp;&nbsp;&nbsp;' . zen_check_minutes($whos_online->fields['time_last_click']); ?> ago</td>
  315.                 <td class="dataTableContentWhois" colspan=5 valign="top">
  316.                   <?php
  317.                     echo TEXT_SESSION_ID . $whos_online->fields['session_id'] . '<br />' .
  318.                     TEXT_HOST . $whos_online->fields['host_address'] . '<br />' .
  319.                     TEXT_USER_AGENT . $whos_online->fields['user_agent'] . '<br />';
  320.                     if (preg_match('/^(.*)' . zen_session_name() . '=[a-f,0-9]+[&]*(.*)/i', $whos_online->fields['last_page_url'], $array)) {
  321.                       echo $array[1] . $array[2];
  322.                     } else {
  323.                       echo "<a href='" . $whos_online->fields['last_page_url'] . "' target=new>" . '<u>' . $whos_online->fields['last_page_url'] . '</u>' . "</a>";
  324.                     }
  325.                   ?>
  326.                 </td>
  327.  
  328.               </tr>
  329. <?php
  330.   } // show host
  331. ?>
  332.               <tr>
  333.                <td colspan="8"><?php echo zen_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
  334.               </tr>
  335.  
  336. <?php
  337.   $whos_online->MoveNext();
  338.   }
  339.   if (!$d) {
  340.     $d=0;
  341.   }
  342.   $total_dupes = $d;
  343.   $total_sess = $whos_online->RecordCount();
  344.   $ip_unique = sizeof($ip_array);
  345.   $total_cust = $total_sess - $total_dupes;
  346. ?>
  347.               <tr>
  348.                 <td colspan="8"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  349.               </tr>
  350. <?php
  351. // repeat legend when whois >=
  352.   if ($whos_online->RecordCount() >= WHOIS_REPEAT_LEGEND_BOTTOM) {
  353. ?>
  354.               <tr>
  355.                 <td class="smallText" colspan="8">Legend: <?php echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . " Active cart &nbsp;&nbsp;" . zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . " Inactive cart &nbsp;&nbsp;" . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . " Active no cart &nbsp;&nbsp;" .  zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif') . " Inactive no cart " . "<br>Inactive is Last Click >= " . WHOIS_TIMER_INACTIVE . "s" . " &nbsp; || Inactive since arrival > " . WHOIS_TIMER_DEAD . "s will be removed";?></td>
  356.               </tr>
  357. <?php
  358.   }
  359. ?>
  360.               <tr>
  361.                 <td class="smallText" colspan="8"><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess); print "<br>Duplicate IP Addresses: $total_dupes<br>Total Unique Users: $total_cust.";?></td>
  362.               </tr>
  363.             </table></td>
  364. <?php
  365.   $heading = array();
  366.   $contents = array();
  367.   if ($info) {
  368.     $heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>');
  369.     $tag = 0;
  370.     $session_data = '';
  371.     if (STORE_SESSIONS == 'db') {
  372.       $session_data = $db->Execute("select value from " . TABLE_SESSIONS . "
  373.                                    WHERE sesskey = '" . $info . "'");
  374.  
  375.       $session_data = trim($session_data->fields['value']);
  376.     } else {
  377.       if ( (file_exists(zen_session_save_path() . '/sess_' . $info)) && (filesize(zen_session_save_path() . '/sess_' . $info) > 0) ) {
  378.         $session_data = file(zen_session_save_path() . '/sess_' . $info);
  379.         $session_data = trim(implode('', $session_data));
  380.       }
  381.     }
  382.  
  383.     $hardenedStatus = FALSE;
  384.     $suhosinExtension = extension_loaded('suhosin');
  385.     $suhosinSetting = strtoupper(@ini_get('suhosin.session.encrypt'));
  386.  
  387. //    if (!$suhosinExtension) {
  388.       if (strpos($session_data, 'cart|O') == 0) $session_data = base64_decode($session_data);
  389.       if (strpos($session_data, 'cart|O') == 0) $session_data = '';
  390. //    }
  391.  
  392.     // uncomment the following line if you have suhosin enabled and see errors on the cart-contents sidebar
  393.     //$hardenedStatus = ($suhosinExtension == TRUE || $suhosinSetting == 'On' || $suhosinSetting == 1) ? TRUE : FALSE;
  394.     if ($session_data != '' && $hardenedStatus == TRUE) $session_data = '';
  395.  
  396.     if ($length = strlen($session_data)) {
  397.       $start_id = (int)strpos($session_data, 'customer_id|s');
  398.       $start_currency = (int)strpos($session_data, 'currency|s');
  399.       $start_country = (int)strpos($session_data, 'customer_country_id|s');
  400.       $start_zone = (int)strpos($session_data, 'customer_zone_id|s');
  401.       $start_cart = (int)strpos($session_data, 'cart|O');
  402.       $end_cart = (int)strpos($session_data, '|', $start_cart+6);
  403.       $end_cart = (int)strrpos(substr($session_data, 0, $end_cart), ';}');
  404.  
  405.       $session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));
  406.       $session_data_cart = substr($session_data, $start_cart, ($end_cart - $start_cart+2));
  407.       $session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));
  408.       $session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));
  409.       $session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));
  410.  
  411.       session_decode($session_data_id);
  412.       session_decode($session_data_currency);
  413.       session_decode($session_data_country);
  414.       session_decode($session_data_zone);
  415.       session_decode($session_data_cart);
  416.  
  417.       if (is_object($_SESSION['cart'])) {
  418.         $contents[] = array('text' => $full_name . ' - ' . $ip_address . '<br />' . $info);
  419.         $products = $_SESSION['cart']->get_products();
  420.         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
  421.           $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . zen_get_product_path($products[$i]['id']) . '&pID=' . $products[$i]['id']) . '">' . $products[$i]['name'] . '</a>');
  422.         }
  423.  
  424.         if (sizeof($products) > 0) {
  425.           $contents[] = array('text' => zen_draw_separator('pixel_black.gif', '100%', '1'));
  426.           $contents[] = array('align' => 'right', 'text'  => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($_SESSION['cart']->show_total(), true, $_SESSION['currency']));
  427.         } else {
  428.           $contents[] = array('text' => TEXT_EMPTY_CART);
  429.         }
  430.       }
  431.     }
  432.   }
  433.  
  434.   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  435.     echo '            <td width="25%" valign="top">' . "\n";
  436.  
  437.     $box = new box;
  438.     echo $box->infoBox($heading, $contents);
  439.  
  440.     echo '            </td>' . "\n";
  441.   }
  442. ?>
  443.           </tr>
  444.         </table></td>
  445.       </tr>
  446.     </table></td>
  447. <!-- body_text_eof //-->
  448.   </tr>
  449. </table>
  450. <!-- body_eof //-->
  451.  
  452. <!-- footer //-->
  453. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  454. <!-- footer_eof //-->
  455. <br>
  456. </body>
  457. </html>
  458. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


cron