function olc_update_whos_online($url = EMPTY_STRING) { if (ISSET_CUSTOMER_ID) { $wo_customer_id = CUSTOMER_ID; $customer_query = olc_db_query(SELECT . "customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . APOS); $customer = olc_db_fetch_array($customer_query); $wo_full_name = addslashes($customer['customers_firstname'] . BLANK . $customer['customers_lastname']); } else { $wo_full_name = $_SESSION['customers_status']['customers_status_name']; $wo_customer_id = 0; } $wo_session_id = olc_session_id(); //$wo_ip_address = getenv('REMOTE_ADDR'); olc_get_ip_info(&$smarty); $wo_ip_address = $_SESSION['CUSTOMERS_IP']; $pos = strpos($wo_ip_address, RPAREN); if ($pos !== false) { $wo_ip_address = substr($wo_ip_address, 0, $pos + 1); } if (!$url) { $url = addslashes(getenv('REQUEST_URI')); } $wo_last_page_url = str_replace(DIR_WS_CATALOG, EMPTY_STRING, $url); $pos = strpos($wo_last_page_url, 'start_debug'); //Eliminate debugger parameters if ($pos === false) { $pos = strpos($wo_last_page_url, 'DBGSESSION'); //Eliminate debugger parameters } if ($pos !== false) { $wo_last_page_url = substr($wo_last_page_url, 0, $pos - 1); } if (USE_AJAX) { $pos = strpos($wo_last_page_url, AJAX_ID); if ($pos !== false) { $wo_last_page_url = substr($wo_last_page_url, 0, $pos - 1) . substr($wo_last_page_url, $pos + strlen(AJAX_ID)); } } $current_time = time(); //Do garbage collection in session db _sess_gc(EMPTY_STRING); //Delete all from "whos_online" without a session entry //olc_db_query(DELETE_FROM . TABLE_WHOS_ONLINE. ' WHERE session_id NOT IN (SELECT sesskey FROM '.TABLE_SESSIONS.RPAREN); $sesskey = TABLE_SESSIONS . '.sesskey'; olc_db_query('DELETE ' . TABLE_WHOS_ONLINE . ' FROM ' . TABLE_WHOS_ONLINE . COMMA_BLANK . TABLE_SESSIONS . ' WHERE ' . TABLE_WHOS_ONLINE . '.session_id = ' . $sesskey . ' AND ' . $sesskey . ' IS NULL'); $sql_data = array('customer_id' => $wo_customer_id, 'full_name' => $wo_full_name, 'session_id' => $wo_session_id, 'time_last_click' => $current_time, 'last_page_url' => $wo_last_page_url); $sql_where = "session_id = '" . $wo_session_id . APOS; $stored_customer_query = olc_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where " . $sql_where); $stored_customer = olc_db_fetch_array($stored_customer_query); if ($stored_customer['count'] > 0) { $sql_action = 'update'; } else { $sql_data = array_merge($sql_data, array('ip_address' => $wo_ip_address, 'time_entry' => $current_time)); $sql_action = 'insert'; $sql_where = EMPTY_STRING; } olc_db_perform(TABLE_WHOS_ONLINE, $sql_data, $sql_action, $sql_where); }
$any_out_of_stock = true; break; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != TRUE_STRING_S) { if ($any_out_of_stock) { olc_redirect(olc_href_link(FILENAME_SHOPPING_CART)); } } } require DIR_WS_INCLUDES . 'header.php'; // // Kunden-IP-Adresse // olc_get_ip_info($smarty); // // Kunden-IP-Adresse // $smarty->assign('DELIVERY_LABEL', olc_address_format($order->delivery['format_id'], $order->delivery, 1, BLANK, HTML_BR)); $smarty->assign('PRODUCTS_EDIT', olc_href_link(FILENAME_SHOPPING_CART, EMPTY_STRING, SSL)); //---PayPal WPP Modification START ---// $use_ec_checkout = $ec_checkout && $ec_enabled; if (!$credit_covers) { $smarty->assign('BILLING_LABEL', olc_address_format($order->billing['format_id'], $order->billing, 1, BLANK, HTML_BR)); if ($use_ec_checkout) { $link_billing = $ec_checkout ? MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE : MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE; } else { $link_billing = olc_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, EMPTY_STRING, SSL); } }