[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * whos_online sidebox - displays how many guests/members are online currently 4 * 5 * @package templateSystem 6 * @copyright Copyright 2003-2005 Zen Cart Development Team 7 * @copyright Portions Copyright 2003 osCommerce 8 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 9 * @version $Id: whos_online.php 2718 2005-12-28 06:42:39Z drbyte $ 10 */ 11 12 // test if box should display 13 $show_whos_online= false; 14 $show_whos_online= true; 15 $n_guests = 0; 16 $n_members = 0; 17 18 // Set expiration time, default is 1200 secs (20 mins) 19 $xx_mins_ago = (time() - 1200); 20 21 $db->Execute("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'"); 22 23 $whos_online_query = $db->Execute("select customer_id from " . TABLE_WHOS_ONLINE); 24 while (!$whos_online_query->EOF) { 25 if (!$whos_online_query->fields['customer_id'] == 0) $n_members++; 26 if ($whos_online_query->fields['customer_id'] == 0) $n_guests++; 27 28 $user_total = sprintf($whos_online_query->RecordCount()); 29 30 $whos_online_query->MoveNext(); 31 } 32 33 if ($user_total == 1) { 34 $there_is_are = BOX_WHOS_ONLINE_THEREIS . ' '; 35 } else { 36 $there_is_are = BOX_WHOS_ONLINE_THEREARE . ' '; 37 } 38 39 if ($n_guests == 1) { 40 $word_guest = ' ' . BOX_WHOS_ONLINE_GUEST; 41 } else { 42 $word_guest = ' ' . BOX_WHOS_ONLINE_GUESTS; 43 } 44 45 if ($n_members == 1) { 46 $word_member = ' ' . BOX_WHOS_ONLINE_MEMBER; 47 } else { 48 $word_member = ' ' . BOX_WHOS_ONLINE_MEMBERS; 49 } 50 51 if (($n_guests >= 1) && ($n_members >= 1)) { 52 $word_and = ' ' . BOX_WHOS_ONLINE_AND . ' <br />'; 53 } else { 54 $word_and = ""; 55 } 56 57 $textstring = $there_is_are; 58 if ($n_guests >= 1) $textstring .= $n_guests . $word_guest; 59 60 $textstring .= $word_and; 61 if ($n_members >= 1) $textstring .= $n_members . $word_member; 62 63 $textstring .= ' ' . BOX_WHOS_ONLINE_ONLINE; 64 65 66 $whos_online[] = $textstring; 67 68 // only show if either the tutorials are active or additional links are active 69 if (sizeof($whos_online) > 0) { 70 require($template->get_template_dir('tpl_whos_online.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whos_online.php'); 71 72 $title = BOX_HEADING_WHOS_ONLINE; 73 $title_link = false; 74 require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); 75 } 76 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |