本文整理汇总了PHP中Server::Visitors方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::Visitors方法的具体用法?PHP Server::Visitors怎么用?PHP Server::Visitors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server::Visitors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetUsersHTML
function GetUsersHTML()
{
$html_users = "";
$html_user = IOStruct::GetFile(TEMPLATE_HTML_STATS_USERS_USER);
$html_url = IOStruct::GetFile(TEMPLATE_HTML_STATS_USERS_URL);
$html_body = IOStruct::GetFile(TEMPLATE_HTML_STATS_USERS_BODY);
$html_body = str_replace("<!--status-->", $this->Closed ? "<!--lang_stats_status_closed-->" : "<!--lang_stats_status_open-->", $html_body);
$vcount = Visitor::Build(true, $d = " WHERE `entrance`>='" . DBManager::RealEscape($this->Delimiters[0]) . "' AND `entrance`<='" . DBManager::RealEscape($this->Delimiters[1]) . "'", " LIMIT " . StatisticProvider::$MaxUsersAmount, $this->Delimiters[0]);
$count = 1;
foreach (Server::$Visitors as $visitor) {
$user = $html_user;
$user = str_replace("<!--entrance-->", date("H:i:s", $visitor->FirstActive), $user);
$user = str_replace("<!--exit-->", date("H:i:s", $visitor->ExitTime), $user);
$user = str_replace("<!--visits-->", max($visitor->VisitsDay, $visitor->Visits), $user);
$user = str_replace("<!--visits_day-->", $visitor->VisitsDay, $user);
$user = str_replace("<!--system-->", !empty($visitor->OperatingSystem) ? $visitor->OperatingSystem : "<!--lang_stats_unknown-->", $user);
$user = str_replace("<!--browser-->", !empty($visitor->Browser) ? $visitor->Browser : "<!--lang_stats_unknown-->", $user);
$user = str_replace("<!--country_name-->", !empty($visitor->GeoCountryName) ? $visitor->GeoCountryName : "<!--lang_stats_unknown-->", $user);
$user = str_replace("<!--city-->", !empty($visitor->GeoCity) ? $visitor->GeoCity : "<!--lang_stats_unknown-->", $user);
$user = str_replace("<!--region-->", $visitor->GeoRegion, $user);
$user = str_replace("<!--isp-->", str_replace("'", "", $visitor->GeoISP), $user);
$user = str_replace("<!--ip-->", $visitor->IP, $user);
$user = str_replace("<!--host-->", str_replace("'", "", $visitor->Host), $user);
$user = str_replace("<!--id-->", $visitor->UserId, $user);
$user = str_replace("<!--vclass-->", max($visitor->VisitsDay, $visitor->Visits) == 1 ? "vn" : ($visitor->VisitsDay > 1 ? "vm" : "vs"), $user);
$urls = "";
$id = 1;
$oid = 1;
$bcount = 1;
foreach ($visitor->Browsers as $browser) {
if ($browser->Overlay || empty($browser->History)) {
continue;
}
$ucount = 0;
foreach ($browser->History as $hurl) {
if ($id == 1 && !Is::Null($hurl->Referrer->GetAbsoluteUrl()) && $hurl->Referrer->GetAbsoluteUrl() != $hurl->Url->GetAbsoluteUrl()) {
$url = $html_url;
$url = str_replace("<!--page-->", "Referrer: <a href=\"" . @htmlentities(StatisticProvider::$Dereferrer . $hurl->Referrer->GetAbsoluteUrl(), ENT_QUOTES, 'UTF-8') . "\" target=\"_blank\"><b>" . @htmlentities($hurl->Referrer->GetAbsoluteUrl(), ENT_QUOTES, 'UTF-8') . "</b></a>", $url);
$url = str_replace("<!--entrance-->", " ", $url);
$url = str_replace("<!--id-->", " ", $url);
$url = str_replace("<!--oid-->", $oid++, $url);
$urls .= $url;
}
$urls = str_replace("<!--exit-->", date("H:i:s", $hurl->Entrance), $urls);
$url = $html_url;
$url = str_replace("<!--page-->", "<!--lang_stats_browser--> " . $bcount . ": <a href=\"" . htmlentities(StatisticProvider::$Dereferrer . $hurl->Url->GetAbsoluteUrl(), ENT_QUOTES, 'UTF-8') . "\" target=\"_blank\"><b>" . @htmlentities($hurl->Url->GetAbsoluteUrl(), ENT_QUOTES, 'UTF-8') . "</b></a>", $url);
$url = str_replace("<!--entrance-->", date("H:i:s", $hurl->Entrance), $url);
$url = str_replace("<!--id-->", $id++, $url);
$url = str_replace("<!--oid-->", $oid++, $url);
$urls .= $url;
$ucount++;
}
if ($ucount > 0) {
$bcount++;
}
if ($browser->Type == BROWSER_TYPE_CHAT) {
$urls = str_replace("<!--exit-->", date("H:i:s", $browser->LastActive + Server::$Configuration->File["timeout_track"]), $urls);
} else {
$urls = str_replace("<!--exit-->", date("H:i:s", $browser->LastActive), $urls);
}
}
$user = str_replace("<!--pages-->", $id - 1 . ($id - 1 == 0 ? "?" : ""), $user);
$html_users .= $user . str_replace("<!--exit-->", date("H:i:s", $visitor->ExitTime), $urls);
$html_users = str_replace("<!--number-->", $count++, $html_users);
}
$html_body = str_replace("<!--visitors-->", $html_users, $html_body);
$html_body = str_replace("<!--amount-->", $vcount, $html_body);
Server::$Visitors = array();
Visitor::Build();
return $html_body;
}
示例2: UpdateUserManagement
static function UpdateUserManagement($_prefix)
{
if (OperatorRequest::IsValidated() && Is::Defined("VALIDATED_FULL_LOGIN") && OperatorRequest::IsAdministrator(true)) {
Logging::SecurityLog("ServerManager::UpdateUserManagement", "", CALLER_SYSTEM_ID);
$count = 0;
while (isset($_POST["p_operators_" . $count . "_id"])) {
if (!empty($_POST["p_operators_" . $count . "_delete"])) {
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `id`='" . DBManager::RealEscape($_POST["p_operators_" . $count . "_id"]) . "' LIMIT 1;");
} else {
$did = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->AppDeviceId : "";
$abm = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->AppBackgroundMode : false;
$aos = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->AppOS : "";
$lac = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->LastActive : 0;
$fac = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->FirstActive : 0;
$wcl = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->ClientWeb : 0;
$acl = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->AppClient : 0;
$sta = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->Status : 2;
$tok = !empty(Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]) ? Server::$Operators[$_POST["p_operators_" . $count . "_system_id"]]->Token : "";
DBManager::Execute(true, "REPLACE INTO `" . $_prefix . DATABASE_OPERATORS . "` (`id`, `system_id`, `token`, `fullname`, `description`, `email`, `permissions`, `webspace`, `password`, `status`, `level`, `visitor_file_sizes`, `groups`, `groups_status`, `groups_hidden`,`reposts`, `languages`, `auto_accept_chats`, `login_ip_range`, `websites_users`, `websites_config`, `bot`, `wm`, `wmohca`,`first_active`,`last_active`,`sign_off`,`lweb`,`lapp`,`mobile_os`,`mobile_device_id`,`mobile_background`,`mobile_ex`,`max_chats`) VALUES ('" . DBManager::RealEscape($_POST["p_operators_" . $count . "_id"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_system_id"]) . "','" . DBManager::RealEscape($tok) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_fullname"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_description"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_email"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_permissions"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_webspace"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_password"]) . "','" . $sta . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_level"]) . "','','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_groups"]) . "','','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_groups_hidden"]) . "','','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_languages"]) . "',0,'" . DBManager::RealEscape($_POST["p_operators_" . $count . "_lipr"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_websites_users"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_websites_config"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_bot"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_wm"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_wmohca"]) . "'," . $fac . "," . $lac . "," . intval(empty($_POST["p_operators_" . $count . "_deac"]) ? 0 : 2) . "," . intval($wcl ? 1 : 0) . "," . intval($acl ? 1 : 0) . ",'" . DBManager::RealEscape($aos) . "','" . DBManager::RealEscape($did) . "'," . intval($abm ? 1 : 0) . ",'" . DBManager::RealEscape(@$_POST["p_operators_" . $count . "_mobile_ex"]) . "'," . intval(@$_POST["p_operators_" . $count . "_max_chats"]) . ");");
}
if (!empty($_POST["p_operators_" . $count . "_pp"])) {
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_PROFILE_PICTURES . "` WHERE `webcam`='0' AND `internal_id`='" . DBManager::RealEscape($_POST["p_operators_" . $count . "_system_id"]) . "';");
if ($_POST["p_operators_" . $count . "_pp"] != "DEFAULT") {
DBManager::Execute(true, "INSERT INTO `" . $_prefix . DATABASE_PROFILE_PICTURES . "` (`id` ,`internal_id`,`time` ,`webcam` ,`data`) VALUES ('" . DBManager::RealEscape(getId(32)) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_system_id"]) . "','" . DBManager::RealEscape(time()) . "',0,'" . DBManager::RealEscape($_POST["p_operators_" . $count . "_pp"]) . "');");
}
}
$count++;
}
$count = 0;
while (isset($_POST["p_groups_" . $count . "_id"])) {
if (!empty($_POST["p_groups_" . $count . "_delete"])) {
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_GROUPS . "` WHERE `id`='" . DBManager::RealEscape($_POST["p_groups_" . $count . "_id"]) . "' LIMIT 1;");
} else {
$f_functions = "000000";
$result = DBManager::Execute(true, "SELECT * FROM `" . $_prefix . DATABASE_GROUPS . "` WHERE `id`='" . DBManager::RealEscape($_POST["p_groups_" . $count . "_id"]) . "' LIMIT 1;");
if ($row = DBManager::FetchArray($result)) {
$f_functions = $row["functions"];
}
$f_functions = !empty($_POST["p_groups_" . $count . "_functions"]) ? $_POST["p_groups_" . $count . "_functions"] : $f_functions;
DBManager::Execute(true, "REPLACE INTO `" . $_prefix . DATABASE_GROUPS . "` (`id`, `dynamic`, `description`, `external`, `internal`, `created`, `email`, `standard`, `opening_hours`, `functions`, `chat_inputs_hidden`, `ticket_inputs_hidden`, `chat_inputs_required`, `ticket_inputs_required`, `chat_inputs_masked`, `ticket_inputs_masked`, `chat_inputs_cap`, `ticket_inputs_cap`, `max_chats`, `visitor_filters`, `chat_vouchers_required`, `pre_chat_js`, `post_chat_js`, `ticket_email_out`, `ticket_email_in`, `ticket_handle_unknown`, `chat_email_out`,`ticket_assignment`,`priorities`,`priority_sleep`) VALUES ('" . DBManager::RealEscape($_POST["p_groups_" . $count . "_id"]) . "',0,'" . DBManager::RealEscape($_POST["p_groups_" . $count . "_description"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_external"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_internal"]) . "'," . time() . ",'" . DBManager::RealEscape($_POST["p_groups_" . $count . "_email"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_standard"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_opening_hours"]) . "','" . DBManager::RealEscape($f_functions) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_hidden"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_hidden"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_required"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_required"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_masked"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_masked"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_cap"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_cap"]) . "'," . intval($_POST["p_groups_" . $count . "_max_chats"]) . ",'" . DBManager::RealEscape($_POST["p_groups_" . $count . "_visitor_filters"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_vouchers_required"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_pre_js"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_post_js"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_email_out"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_email_in"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_email_handling"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_email_out"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_assign"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_priorities"]) . "'," . intval($_POST["p_groups_" . $count . "_ps"]) . ");");
}
SocialMediaChannel::DeleteByGroup($_prefix, $_POST["p_groups_" . $count . "_id"]);
$count++;
}
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_OPERATOR_LOGINS . "`;");
Server::$Operators = Server::$Groups = Server::$Visitors = null;
Server::InitDataBlock(array("INTERNAL", "GROUPS", "VISITOR"));
ServerManager::UpdatePredefinedMessages($_prefix);
ServerManager::UpdateSignatures($_prefix);
ServerManager::UpdateSocialMedia($_prefix);
if (!empty($_POST["p_operators_0_id"])) {
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_AUTO_REPLIES . "` WHERE NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `system_id` = `" . $_prefix . DATABASE_AUTO_REPLIES . "`.`owner_id`) AND NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_GROUPS . "` WHERE `id` = `" . $_prefix . DATABASE_AUTO_REPLIES . "`.`owner_id`)");
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_PROFILE_PICTURES . "` WHERE NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `system_id` = `" . $_prefix . DATABASE_PROFILE_PICTURES . "`.`internal_id`);");
DBManager::Execute(true, "DELETE FROM `" . $_prefix . DATABASE_PROFILES . "` WHERE NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `system_id` = `" . $_prefix . DATABASE_PROFILES . "`.`id`);");
if (isset($_POST[POST_INTERN_EDIT_USER])) {
$combos = explode(";", $_POST[POST_INTERN_EDIT_USER]);
for ($i = 0; $i < count($combos); $i++) {
if (strpos($combos[$i], ",") !== false) {
$vals = explode(",", $combos[$i]);
if (strlen($vals[1]) > 0) {
Server::$Operators[$vals[0]]->ChangePassword($vals[1]);
}
if ($vals[2] == 1) {
Server::$Operators[$vals[0]]->SetPasswordChangeNeeded();
}
}
}
}
}
CacheManager::Flush();
Server::$Response->SetStandardResponse(1, "");
}
}
示例3: processCancelInvitation
function processCancelInvitation()
{
if (isset($_POST[POST_INTERN_PROCESS_CANCEL_INVITATION])) {
$users = explode(POST_ACTION_VALUE_SPLITTER, utf8_decode($_POST[POST_INTERN_PROCESS_CANCEL_INVITATION]));
foreach ($users as $uid) {
if (isset(Server::$Visitors[$uid])) {
Server::$Visitors[$uid]->ForceUpdate();
}
DBManager::Execute(true, "UPDATE `" . DB_PREFIX . DATABASE_CHAT_REQUESTS . "` SET `closed`=1,`canceled`='" . DBManager::RealEscape(CALLER_SYSTEM_ID) . "' WHERE `canceled`='' AND `accepted`=0 AND `declined`=0 AND `receiver_user_id`='" . DBManager::RealEscape($uid) . "';");
}
Server::$Visitors = null;
Server::InitDataBlock(array("VISITOR"));
}
}
示例4: Build
static function Build($_fullList = false, $_sqlwhere = "", $_limit = "", $_created = 0)
{
Server::InitDataBlock(array("COUNTRIES"));
if (!$_fullList && !empty(CacheManager::$ActiveManager) && CacheManager::$ActiveManager->GetData(DATA_CACHE_KEY_VISITORS, Server::$Visitors)) {
return count(Server::$Visitors);
}
Server::$Visitors = $tvisitors = $tbrowsers = array();
if (!$_fullList) {
$_sqlwhere = " WHERE `last_active`>" . DBManager::RealEscape(time() - Server::$Configuration->File["timeout_track"]);
}
$result = DBManager::Execute(true, "SELECT *,`t1`.`id` AS `id` FROM `" . DB_PREFIX . DATABASE_VISITORS . "` AS `t1` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_BROWSERS . "` AS `t2` ON `t1`.`browser`=`t2`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_CITIES . "` AS `t3` ON `t1`.`city`=`t3`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_REGIONS . "` AS `t4` ON `t1`.`region`=`t4`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_ISPS . "` AS `t5` ON `t1`.`isp`=`t5`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_SYSTEMS . "` AS `t6` ON `t1`.`system`=`t6`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_RESOLUTIONS . "` AS `t8` ON `t1`.`resolution`=`t8`.`id`" . $_sqlwhere . " ORDER BY `entrance` ASC" . $_limit . ";");
if ($result) {
while ($row = DBManager::FetchArray($result)) {
$fa = $row["entrance"];
if (isset($tvisitors[$row["id"]])) {
$fa = min($tvisitors[$row["id"]]->FirstActive, $fa);
}
if (!empty(Server::$Countries[$row["country"]])) {
$row["countryname"] = Server::$Countries[$row["country"]];
}
if (!isset($vcount[$row["id"]])) {
$vcount[$row["id"]] = 0;
}
$vcount[$row["id"]]++;
$row["dcount"] = $vcount[$row["id"]];
$visitor = new Visitor($row["id"]);
$visitor->Load($row);
$visitor->FirstActive = $fa;
$tvisitors[$row["id"]] = $visitor;
$tvisitors[$row["id"]]->FirstActive = min($tvisitors[$row["id"]]->FirstActive, $row["entrance"]);
}
$minEntrance = time();
if ($_fullList) {
$result = DBManager::Execute(true, $d = "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_BROWSERS . "` WHERE `created` > " . intval($_created) . " ORDER BY `created` ASC;");
} else {
$result = DBManager::Execute(true, $d = "SELECT `t1`.*,`t2`.`h_fullname`,`t2`.`h_email`,`t2`.`h_company`,`t2`.`h_phone`,`t2`.`h_customs`,`t2`.`h_text` FROM `" . DB_PREFIX . DATABASE_VISITOR_BROWSERS . "` AS `t1` INNER JOIN `" . DB_PREFIX . DATABASE_USER_DATA . "` AS `t2` ON `t1`.`data_id`=`t2`.`id` WHERE `last_active` > " . intval(time() - Server::$Configuration->File["timeout_track"]) . " ORDER BY `created` ASC;");
}
if ($result) {
while ($row = DBManager::FetchArray($result)) {
if (isset($tvisitors[$row["visitor_id"]]) && ($tvisitors[$row["visitor_id"]]->VisitId == $row["visit_id"] || $_fullList)) {
$browser = $tvisitors[$row["visitor_id"]]->CreateBrowser($row, false, false);
$tbrowsers[$browser->BrowserId] = $browser;
$minEntrance = min($minEntrance, $row["created"]);
}
}
}
if ($_fullList) {
if ($result = DBManager::Execute(true, "SELECT `" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "_sorted`.`browser_id`,`" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "_sorted`.`title` as `url_title`,`treftitle`.`title` as `ref_title`,`turldom`.`domain` as `url_dom`,`turlpath`.`path` as `url_path`,`trefdom`.`domain` as `ref_dom`,`trefpath`.`path` as `ref_path`,`entrance`,`params`,`untouched`,`ref_untouched` FROM (SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "` ORDER BY `entrance` ASC) AS `" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "_sorted` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_PAGES . "` AS `turl` ON `" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "_sorted`.`url`=`turl`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_PAGES . "` AS `tref` ON `" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "_sorted`.`referrer`=`tref`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_DOMAINS . "` AS `trefdom` ON `tref`.`domain`=`trefdom`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_DOMAINS . "` AS `turldom` ON `turl`.`domain`=`turldom`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_PATHS . "` AS `trefpath` ON `tref`.`path`=`trefpath`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_PATHS . "` AS `turlpath` ON `turl`.`path`=`turlpath`.`id` INNER JOIN `" . DB_PREFIX . DATABASE_VISITOR_DATA_TITLES . "` AS `treftitle` ON `tref`.`title`=`treftitle`.`id`;")) {
while ($row = DBManager::FetchArray($result)) {
if (isset($tbrowsers[$row["browser_id"]])) {
$tbrowsers[$row["browser_id"]]->History[] = new HistoryURL($row);
}
}
}
} else {
if ($result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_CHATS . "` WHERE (`status`>0 OR `waiting`=1) ORDER BY `first_active` ASC;")) {
while ($row = DBManager::FetchArray($result)) {
if (isset($tbrowsers[$row["browser_id"]]) && get_class($tbrowsers[$row["browser_id"]]) == "VisitorChat") {
$tbrowsers[$row["browser_id"]]->Status = CHAT_STATUS_OPEN;
$tbrowsers[$row["browser_id"]]->LastActive = time();
$tbrowsers[$row["browser_id"]]->Members = array();
if (empty($row["external_close"])) {
$tbrowsers[$row["browser_id"]]->FirstCall = !empty($row["exit"]);
$tbrowsers[$row["browser_id"]]->SetValues($row, false);
} else {
$tbrowsers[$row["browser_id"]]->SetValues($row, true);
}
if ($tbrowsers[$row["browser_id"]]->Status > CHAT_STATUS_OPEN) {
$tbrowsers[$row["browser_id"]]->LoadMembers();
}
}
}
}
if ($result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_BROWSER_URLS . "` WHERE `entrance` >= " . intval($minEntrance) . " ORDER BY `entrance` ASC;")) {
while ($row = DBManager::FetchArray($result)) {
if (isset($tbrowsers[$row["browser_id"]])) {
$tbrowsers[$row["browser_id"]]->History[] = new HistoryURL($row, true);
}
}
}
}
foreach ($tbrowsers as $i => $browser) {
$tbrowsers[$i]->SetFirstCall(count($browser->History) == 0);
if (isset($tvisitors[$browser->UserId])) {
if ($_fullList && count($browser->History) == 0) {
continue;
}
$tvisitors[$browser->UserId]->Browsers[count($tvisitors[$browser->UserId]->Browsers)] = $browser;
}
}
foreach ($tvisitors as $vid => $visitor) {
if (count($visitor->Browsers) > 0) {
Server::$Visitors[$vid] = $visitor;
}
}
if (!$_fullList && !empty(CacheManager::$ActiveManager)) {
CacheManager::$ActiveManager->SetData(DATA_CACHE_KEY_VISITORS, Server::$Visitors, true);
}
}
return count($tvisitors);
//.........这里部分代码省略.........