= 2) { $current_page = substr($current_page, $substr_pos); } } // Get the current host from the request data $current_host = $_REQUEST['URL']; $str_start = 0; for ($i = 0; $i < 3; $i++) { $substr_pos = strpos($current_host, '/'); if ($substr_pos === false) { break; } if ($i < 2) { $current_host = substr($current_host, $substr_pos + 1); $str_start += $substr_pos + 1; } elseif ($i >= 2) { $current_host = substr($_REQUEST['URL'], 0, $substr_pos + $str_start); } } // Update the current URL statistics within the requests tables if ($current_page == '') { $current_page = '/'; } $query = "SELECT `path` FROM " . $table_prefix . "requests WHERE `id` = '$request_id'"; $row = $SQL->selectquery($query); if (is_array($row)) { $current_page = urldecode($current_page); $prev_path = explode('; ', $row['path']); $current_path = $row['path']; end($prev_path); $index = key($prev_path); if ($current_page != $prev_path[$index]) { $query = "UPDATE " . $table_prefix . "requests SET `url` = '$current_page', `title` = '$title', `path` = '$current_path; $current_page' WHERE `id` = '$request_id'"; $SQL->insertquery($query); } } if (!isset($_COOKIE['LiveHelpSession'])) { header('Location: /livehelp/cookies.php?SERVER=' . $_REQUEST['SERVER'] . '&COOKIE=true'); exit(); } // Checks if any users in user table are online if ($error == '') { $query = "SELECT `id` FROM " . $table_prefix . "users WHERE (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`refresh`)) < '$connection_timeout' AND `status` = '1'"; if ($department != '' && $departments == true) { $query .= " AND department LIKE '%$department%'"; } $row = $SQL->selectquery($query); if(!is_array($row)) { header('Location: /livehelp/offline.php?SERVER=' . $_REQUEST['SERVER']); exit(); } } if ($disable_login_details == true) { header('Location: /livehelp/frames.php?URL=' . $_REQUEST['URL'] . '&SERVER=' . $_REQUEST['SERVER']); exit(); } } header('Content-type: text/html; charset=' . CHARSET); $language_file = './locale/' . LANGUAGE_TYPE . '/lang_guest_' . LANGUAGE_TYPE . '.php'; if (file_exists($language_file)) { include($language_file); } else { include('./locale/en/lang_guest_en.php'); } ?>