$arParams["CACHE_TIME"] = 20; } $arParams["CACHE_FOR_ADMIN"] = $arParams["CACHE_FOR_ADMIN"] != "N"; //Check if we can not cache if (!$arParams["CACHE_FOR_ADMIN"] && $USER->IsAdmin()) { $arParams["CACHE_TIME"] = 0; } elseif ($arParams["CACHE_TYPE"] == "N" || $arParams["CACHE_TYPE"] == "A" && COption::GetOptionString("main", "component_cache_on", "Y") == "N") { $arParams["CACHE_TIME"] = 0; } $arParams["IS_ADMIN"] = $USER->IsAdmin(); $obCache = new CPHPCache(); $cache_id = LANG; if (($tzOffset = CTimeZone::GetOffset()) != 0) { $cache_id .= "_" . $tzOffset; } if ($this->startResultCache()) { if (!CModule::IncludeModule("statistic")) { $this->abortResultCache(); return; } $arResult["STATISTIC"] = CTraffic::GetCommonValues(array(), true); if (!is_array($arResult["STATISTIC"])) { $this->abortResultCache(); return; } $arResult["TODAY"] = GetTime(time(), "SHORT"); $arResult["NOW"] = GetTime(time() + $tzOffset, "FULL"); $arResult["IS_ADMIN"] = $arParams["IS_ADMIN"]; $this->SetResultCacheKeys(array()); $this->IncludeComponentTemplate(); }
function GetLiveFeedData($site_id = "", $lang = "en") { global $MESS; if (($r = CStatisticWS::CheckAuth()) !== False) { return $r; } CComponentUtil::__IncludeLang("/bitrix/components/bitrix/webservice.statistic/", "/component_1.php", $lang); $arFilter = array(); $server_name = COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]); $protocol = CMain::IsHTTPS() ? "https" : "http"; if (strlen($site_id) > 0) { $rsSites = CSite::GetByID($arFields["SITE_ID"]); if ($arSite = $rsSites->Fetch()) { $arFilter = array("SITE_ID" => $site_id); if (strlen($arSite["SERVER_NAME"]) > 0) { $server_name = $arSite["SERVER_NAME"]; } } } $traffic = CTraffic::GetCommonValues($arFilter, true); $strStat = '<table border="0">' . '<tr>' . '<td> </td>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_TODAY") . '</b></td>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . '</b></td>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . '</b></td>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_TOTAL") . '</b></td>' . '</tr>' . '<tr>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_HITS") . '</b></td>' . '<td align="center">' . $traffic["TODAY_HITS"] . '</td>' . '<td align="center">' . $traffic["YESTERDAY_HITS"] . '</td>' . '<td align="center">' . $traffic["B_YESTERDAY_HITS"] . '</td>' . '<td align="center">' . $traffic["TOTAL_HITS"] . '</td>' . '</tr>' . '<tr>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_SESSIONS") . '</b></td>' . '<td align="center">' . $traffic["TODAY_SESSIONS"] . '</td>' . '<td align="center">' . $traffic["YESTERDAY_SESSIONS"] . '</td>' . '<td align="center">' . $traffic["B_YESTERDAY_SESSIONS"] . '</td>' . '<td align="center">' . $traffic["TOTAL_SESSIONS"] . '</td>' . '</tr>' . '<tr>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_HOSTS") . '</b></td>' . '<td align="center">' . $traffic["TODAY_HOSTS"] . '</td>' . '<td align="center">' . $traffic["YESTERDAY_HOSTS"] . '</td>' . '<td align="center">' . $traffic["B_YESTERDAY_HOSTS"] . '</td>' . '<td align="center">' . $traffic["TOTAL_HOSTS"] . '</td>' . '</tr>' . '<tr>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_EVENTS") . '</b></td>' . '<td align="center">' . $traffic["TODAY_EVENTS"] . '</td>' . '<td align="center">' . $traffic["YESTERDAY_EVENTS"] . '</td>' . '<td align="center">' . $traffic["B_YESTERDAY_EVENTS"] . '</td>' . '<td align="center">' . $traffic["TOTAL_EVENTS"] . '</td>' . '</tr>' . (!array_key_exists("SITE_ID", $arFilter) ? '<tr>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_GUESTS") . '</b></td>' . '<td align="center">' . $traffic["TODAY_GUESTS"] . '</td>' . '<td align="center">' . $traffic["YESTERDAY_GUESTS"] . '</td>' . '<td align="center">' . $traffic["B_YESTERDAY_GUESTS"] . '</td>' . '<td align="center">' . $traffic["TOTAL_GUESTS"] . '</td>' . '</tr>' . '<tr>' . '<td><b>' . GetMessage("BX_WS_STAT_LF_NEW_GUESTS") . '</b></td>' . '<td align="center">' . $traffic["TODAY_NEW_GUESTS"] . '</td>' . '<td align="center">' . $traffic["YESTERDAY_NEW_GUESTS"] . '</td>' . '<td align="center">' . $traffic["B_YESTERDAY_NEW_GUESTS"] . '</td>' . '<td align="center"> </td>' . '</tr>' : '') . '</table>'; $strStatText = GetMessage("BX_WS_STAT_LF_HITS") . '#BR#' . GetMessage("BX_WS_STAT_LF_TODAY") . ': ' . $traffic["TODAY_HITS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . ': ' . $traffic["YESTERDAY_HITS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . ': ' . $traffic["B_YESTERDAY_HITS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_TOTAL") . ': ' . $traffic["TOTAL_HITS"] . '#BR#' . '#BR#' . GetMessage("BX_WS_STAT_LF_SESSIONS") . '#BR#' . GetMessage("BX_WS_STAT_LF_TODAY") . ': ' . $traffic["TODAY_SESSIONS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . ': ' . $traffic["YESTERDAY_SESSIONS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . ': ' . $traffic["B_YESTERDAY_SESSIONS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_TOTAL") . ': ' . $traffic["TOTAL_SESSIONS"] . '#BR#' . '#BR#' . GetMessage("BX_WS_STAT_LF_HOSTS") . '#BR#' . GetMessage("BX_WS_STAT_LF_TODAY") . ': ' . $traffic["TODAY_HOSTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . ': ' . $traffic["YESTERDAY_HOSTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . ': ' . $traffic["B_YESTERDAY_HOSTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_TOTAL") . ': ' . $traffic["TOTAL_HOSTS"] . '#BR#' . '#BR#' . GetMessage("BX_WS_STAT_LF_EVENTS") . '#BR#' . GetMessage("BX_WS_STAT_LF_TODAY") . ': ' . $traffic["TODAY_EVENTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . ': ' . $traffic["YESTERDAY_EVENTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . ': ' . $traffic["B_YESTERDAY_EVENTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_TOTAL") . ': ' . $traffic["TOTAL_EVENTS"] . '#BR#' . (!array_key_exists("SITE_ID", $arFilter) ? '#BR#' . GetMessage("BX_WS_STAT_LF_GUESTS") . '#BR#' . GetMessage("BX_WS_STAT_LF_TODAY") . ': ' . $traffic["TODAY_GUESTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . ': ' . $traffic["YESTERDAY_GUESTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . ': ' . $traffic["B_YESTERDAY_GUESTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_TOTAL") . ': ' . $traffic["TOTAL_GUESTS"] . '#BR#' . '#BR#' . GetMessage("BX_WS_STAT_LF_NEW_GUESTS") . '#BR#' . GetMessage("BX_WS_STAT_LF_TODAY") . ': ' . $traffic["TODAY_NEW_GUESTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_YESTERDAY") . ': ' . $traffic["YESTERDAY_NEW_GUESTS"] . '#BR#' . GetMessage("BX_WS_STAT_LF_B_YESTERDAY") . ': ' . $traffic["B_YESTERDAY_NEW_GUESTS"] . '#BR#' : ''); $arResult = array("TITLE" => htmlspecialchars(GetMessage("BX_WS_STAT_LF_TITLE")), "MESSAGE" => htmlspecialchars($strStat), "TEXT_MESSAGE" => htmlspecialchars($strStatText), "URL" => htmlspecialchars($protocol . "://" . $server_name . "/bitrix/admin/stat_list.php?lang=" . $lang)); return $arResult; }
$rsSites = CSite::GetByID($arGadgetParams["SITE_ID"]); if ($arSite = $rsSites->GetNext()) { $arGadget["TITLE"] .= " / [" . $arSite["ID"] . "] " . $arSite["NAME"]; } } $now_date = GetTime(time()); $yesterday_date = GetTime(time() - 86400); $bef_yesterday_date = GetTime(time() - 172800); $arFilter = array(); if ($arGadgetParams["SITE_ID"]) { $arFilter["SITE_ID"] = $arGadgetParams["SITE_ID"]; $strFilterSite = "&site_id=" . $arGadgetParams["SITE_ID"]; } else { $strFilterSite = ""; } $arComm = CTraffic::GetCommonValues($arFilter); $arRows = array("HITS" => array("NAME" => GetMessage("GD_STAT_HITS"), "LINK" => "hit_list.php"), "HOSTS" => array("NAME" => GetMessage("GD_STAT_HOSTS")), "SESSIONS" => array("NAME" => GetMessage("GD_STAT_SESSIONS"), "LINK" => "session_list.php"), "EVENTS" => array("NAME" => GetMessage("GD_STAT_EVENTS"), "LINK" => "event_list.php")); if (!array_key_exists("SITE_ID", $arFilter)) { $arRows["GUESTS"] = array("NAME" => GetMessage("GD_STAT_VISITORS"), "LINK" => "guest_list.php"); } $date_beforeyesterday = ConvertTimeStamp(AddToTimeStamp(array("DD" => -2, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "SHORT"); $date_yesterday = ConvertTimeStamp(AddToTimeStamp(array("DD" => -1, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "SHORT"); $date_today = ConvertTimeStamp(mktime(0, 0, 0, date("n"), date("j"), date("Y")), "SHORT"); if ($arGadgetParams["HIDE_GRAPH"] != "Y") { $iGraphWidth = $arGadgetParams["GRAPH_WIDTH"]; $iGraphHeight = $arGadgetParams["GRAPH_HEIGHT"]; $dateGraph1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => -$arGadgetParams["GRAPH_DAYS"], "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), time()), "SHORT"); $dateGraph2 = ConvertTimeStamp(time(), "SHORT"); $days = CTraffic::DynamicDays($dateGraph1, $dateGraph2, $arFilter["SITE_ID"]); if ($days < 2) { ?>
function SendDailyStatistics() { __SetNoKeepStatistics(); if ($_SESSION["SESS_NO_AGENT_STATISTIC"] != "Y" && !defined("NO_AGENT_STATISTIC")) { global $MESS; $rsSite = CSite::GetDefList(); $arSite = $rsSite->Fetch(); $charset = $arSite["CHARSET"]; $now_full_date = GetTime(time(), "FULL", $arSite["ID"], true); $now_date = GetTime(time(), "SHORT", $arSite["ID"], true); $yesterday_date = GetTime(time() - 86400, "SHORT", $arSite["ID"], true); $bef_yesterday_date = GetTime(time() - 172800, "SHORT", $arSite["ID"], true); $arComm = CTraffic::GetCommonValues(); $adv = CAdv::GetList($a_by, $a_order, array(), $is_filtered, "", $arrGROUP_DAYS, $v); $events = CStatEventType::GetList($e_by = "s_stat", $e_order = "desc", array(), $is_filtered); $referers = CTraffic::GetRefererList($by, $order, array(), $is_filtered); $phrases = CTraffic::GetPhraseList($s_by, $s_order, array(), $is_filtered); $searchers = CSearcher::GetList($f_by = "s_stat", $f_order = "desc", array(), $is_filtered); $OLD_MESS = $MESS; $MESS = array(); IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/statistic/include.php", $arSite["LANGUAGE_ID"]); IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/statistic/admin/stat_list.php", $arSite["LANGUAGE_ID"]); $HTML_HEADER = ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '"> <style> .tablehead1 {background-color:#C2DBED; padding:2px; border-top: 1px solid #A8C2D7; border-bottom: 1px solid #A8C2D7; border-left: 1px solid #A8C2D7;} .tablehead2 {background-color:#C2DBED; padding:2px; border-top: 1px solid #A8C2D7; border-bottom: 1px solid #A8C2D7;} .tablehead3 {background-color:#C2DBED; padding:2px; border-top: 1px solid #A8C2D7; border-bottom: 1px solid #A8C2D7; border-right: 1px solid #A8C2D7;} .tablebody1 {background-color:#F0F1F2; padding:2px; border-left:#B9D3E6 solid 1px; border-bottom:#B9D3E6 solid 1px;} .tablebody2 {background-color:#F0F1F2; padding:2px; border-bottom:#B9D3E6 solid 1px;} .tablebody3 {background-color:#F0F1F2; padding:2px; border-right:#B9D3E6 solid 1px; border-bottom:#B9D3E6 solid 1px;} .tablebodytext {font-family: Arial, Helvetica, sans-serif; font-size:12px; color:#000000;} .tableheadtext {font-family: Arial, Helvetica, sans-serif; font-size:12px; color:#000000;} .tablelinebottom {border-bottom:1pt solid #D1D1D1} .notesmall {font-family: Arial, Helvetica, sans-serif; font-size:11px; color:#008400; font-weight:normal;} .tablebody1_sel {background-color:#E0EBF1; padding:2px; border-left:#B9D3E6 solid 1px; border-bottom:#B9D3E6 solid 1px;} .tablebody2_sel {background-color:#E0EBF1; padding:2px; border-bottom:#B9D3E6 solid 1px;} .tablebody3_sel {background-color:#E0EBF1; padding:2px; border-right:#B9D3E6 solid 1px; border-bottom:#B9D3E6 solid 1px;} </style> </head> <body bgcolor="FFFFFF" leftmargin="2" topmargin="2" marginwidth="2" marginheight="2"> '; $HTML_COMMON = ' <table border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td valign="top" align="center" class="tablehead1" width="48%" nowrap><font class="tableheadtext">' . GetMessage("STAT_VISIT") . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_TODAY") . '</font><br><font class="notesmall">' . $now_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_YESTERDAY") . '</font><br><font class="notesmall">' . $yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_BEFORE_YESTERDAY") . '</font><br><font class="notesmall">' . $bef_yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead3" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_TOTAL_1") . '</font></td> </tr> <tr valign="top"> <td valign="top" class="tablebody1" width="48%" nowrap><font class="tablebodytext">' . GetMessage("STAT_HITS") . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["TODAY_HITS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["YESTERDAY_HITS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["B_YESTERDAY_HITS"] . '</font></td> <td valign="top" align="right" class="tablebody3" width="13%" nowrap><font class="tablebodytext">' . $arComm["TOTAL_HITS"] . ' </font></td> </tr> <tr valign="top"> <td valign="top" class="tablebody1" width="48%" nowrap><font class="tablebodytext">' . GetMessage("STAT_HOSTS") . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["TODAY_HOSTS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["YESTERDAY_HOSTS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["B_YESTERDAY_HOSTS"] . '</font></td> <td valign="top" align="right" class="tablebody3" width="13%" nowrap><font class="tablebodytext">' . $arComm["TOTAL_HOSTS"] . ' </font></td> </tr> <tr valign="top"> <td valign="top" class="tablebody1" width="48%" nowrap><font class="tablebodytext">' . GetMessage("STAT_SESSIONS") . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["TODAY_SESSIONS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["YESTERDAY_SESSIONS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["B_YESTERDAY_SESSIONS"] . '</font></td> <td valign="top" align="right" class="tablebody3" width="13%" nowrap><font class="tablebodytext">' . $arComm["TOTAL_SESSIONS"] . ' </font></td> </tr> <tr valign="top"> <td valign="top" class="tablebody1" width="48%" nowrap><font class="tablebodytext">' . GetMessage("STAT_C_EVENTS") . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["TODAY_EVENTS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["YESTERDAY_EVENTS"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap><font class="tablebodytext">' . $arComm["B_YESTERDAY_EVENTS"] . '</font></td> <td valign="top" align="right" class="tablebody3" width="13%" nowrap><font class="tablebodytext">' . $arComm["TOTAL_EVENTS"] . ' </font></td> </tr> <tr valign="top"> <td valign="top" class="tablebody1" width="48%" nowrap> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="100%"><font class="tablebodytext">' . GetMessage("STAT_GUESTS") . '</font></td> <td width="0%" align="right" class="tablelinebottom" nowrap><font class="tablebodytext">' . GetMessage("STAT_TOTAL") . '</font></td> </tr> <tr> <td></td> <td class="tablelinebottom" align="right" nowrap><font class="tablebodytext">' . GetMessage("STAT_NEW") . '</font></td> </tr> <tr> <td></td> <td align="right" nowrap><font class="tablebodytext">' . GetMessage("STAT_ONLINE") . '</font></td> </tr> </table></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap> <table cellspacing=0 cellpadding=0 width="100%"> <tr><td class="tablelinebottom" align="right" width="100%"><font class="tablebodytext">' . $arComm["TODAY_GUESTS"] . '</font></td></tr> <tr><td class="tablelinebottom" align="right"><font class="tablebodytext">' . $arComm["TODAY_NEW_GUESTS"] . '</font></td></tr> <tr><td align="right"><font class="tablebodytext">' . $arComm["ONLINE_GUESTS"] . '</font></td></tr> </table></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap> <table cellspacing=0 cellpadding=0 width="100%"> <tr><td class="tablelinebottom" align="right" width="100%"><font class="tablebodytext">' . $arComm["YESTERDAY_GUESTS"] . '</font></td></tr> <tr><td class="tablelinebottom" align="right"><font class="tablebodytext">' . $arComm["YESTERDAY_NEW_GUESTS"] . '</font></td></tr> </table></td> <td valign="top" align="right" class="tablebody2" width="13%" nowrap> <table cellspacing=0 cellpadding=0 width="100%"> <tr><td align="right" class="tablelinebottom" width="100%"><font class="tablebodytext">' . $arComm["B_YESTERDAY_GUESTS"] . '</font></td></tr> <tr><td class="tablelinebottom" align="right"><font class="tablebodytext">' . $arComm["B_YESTERDAY_NEW_GUESTS"] . '</font></td></tr> </table></td> <td valign="top" align="right" class="tablebody3" width="13%" nowrap> <table cellspacing=0 cellpadding=0 width="100%"> <tr><td class="tablelinebottom" align="right" width="100%"><font class="tablebodytext">' . $arComm["TOTAL_GUESTS"] . ' </font></td></tr> <tr><td class="tablelinebottom" align="right"><font class="tablebodytext"> </font></td></tr> </table></td> </tr> </table> </td> </tr> </table> '; $HTML_ADV = ' <font class="tablebodytext">' . GetMessage("STAT_ADV") . ' (' . GetMessage("STAT_DIRECT_SESSIONS") . ') (Top 10):</font><br> <table border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td valign="top" align="center" class="tablehead1" width="48%" nowrap><font class="tableheadtext">' . GetMessage("STAT_ADV_NAME") . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_TODAY") . '</font><br><font class="notesmall">' . $now_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_YESTERDAY") . '</font><br><font class="notesmall">' . $yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_BEFORE_YESTERDAY") . '</font><br><font class="notesmall">' . $bef_yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead3" width="13%" nowrap><font class="tableheadtext">' . GetMessage("STAT_TOTAL_1") . '</font></td> </tr> '; $i = 0; $total_SESSIONS_TODAY = 0; $total_SESSIONS_YESTERDAY = 0; $total_SESSIONS_BEF_YESTERDAY = 0; $total_SESSIONS = 0; while ($ar = $adv->Fetch()) { $i++; $total_SESSIONS_TODAY += $ar["SESSIONS_TODAY"]; $total_SESSIONS_YESTERDAY += $ar["SESSIONS_YESTERDAY"]; $total_SESSIONS_BEF_YESTERDAY += $ar["SESSIONS_BEF_YESTERDAY"]; $total_SESSIONS += $ar["SESSIONS"]; if ($i <= 10) { $HTML_ADV .= ' <tr> <td valign="top" class="tablebody1"><font class="tablebodytext">[' . $ar["ID"] . '] ' . $ar["REFERER1"] . ' / ' . $ar["REFERER2"] . '</font></td> <td valign="top" align="right" class="tablebody2"><font class="tablebodytext"> ' . ($ar["SESSIONS_TODAY"] > 0 ? $ar["SESSIONS_TODAY"] : " ") . '</font></td> <td valign="top" align="right" class="tablebody2"><font class="tablebodytext"> ' . ($ar["SESSIONS_YESTERDAY"] > 0 ? $ar["SESSIONS_YESTERDAY"] : " ") . '</font></td> <td valign="top" align="right" class="tablebody2"><font class="tablebodytext"> ' . ($ar["SESSIONS_BEF_YESTERDAY"] > 0 ? $ar["SESSIONS_BEF_YESTERDAY"] : " ") . '</font></td> <td valign="top" align="right" class="tablebody3"><font class="tablebodytext"> ' . ($ar["SESSIONS"] > 0 ? $ar["SESSIONS"] : " ") . '</font></td> </tr> '; } } $HTML_ADV .= ' <tr> <td valign="top" align="right" class="tablebody1_sel" style="padding:3px"><font class="tablebodytext">' . GetMessage("STAT_TOTAL") . '</font></td> <td valign="top" align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext"> ' . ($total_SESSIONS_TODAY > 0 ? $total_SESSIONS_TODAY : " ") . '</font></td> <td valign="top" align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext"> ' . ($total_SESSIONS_YESTERDAY > 0 ? $total_SESSIONS_YESTERDAY : " ") . '</font></td> <td valign="top" align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext"> ' . ($total_SESSIONS_BEF_YESTERDAY > 0 ? $total_SESSIONS_BEF_YESTERDAY : " ") . '</font></td> <td valign="top" align="right" class="tablebody3_sel" style="padding:3px"><font class="tablebodytext"> ' . ($total_SESSIONS > 0 ? $total_SESSIONS : " ") . '</font></td> </table> '; $HTML_EVENTS = ' <font class="tablebodytext">' . GetMessage("STAT_EVENTS_2") . ' (Top 10):</font><br> <table border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td valign="top" align="center" class="tablehead1" width="48%" nowrap><font class="tableheadtext">' . GetMessage("STAT_EVENT") . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap> <font class="tablebodytext">' . GetMessage("STAT_TODAY") . '</font><br><font class="notesmall">' . $now_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap> <font class="tablebodytext">' . GetMessage("STAT_YESTERDAY") . '</font><br><font class="notesmall">' . $yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap> <font class="tablebodytext">' . GetMessage("STAT_BEFORE_YESTERDAY") . '</font><br><font class="notesmall">' . $bef_yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead3" width="13%" nowrap> <font class="tablebodytext">' . GetMessage("STAT_TOTAL_1") . '</font></td> </tr> '; $i = 0; $total_TODAY_COUNTER = 0; $total_YESTERDAY_COUNTER = 0; $total_B_YESTERDAY_COUNTER = 0; $total_TOTAL_COUNTER = 0; while ($er = $events->Fetch()) { $i++; $total_TODAY_COUNTER += intval($er["TODAY_COUNTER"]); $total_YESTERDAY_COUNTER += intval($er["YESTERDAY_COUNTER"]); $total_B_YESTERDAY_COUNTER += intval($er["B_YESTERDAY_COUNTER"]); $total_TOTAL_COUNTER += intval($er["TOTAL_COUNTER"]); if ($i <= 10) { $HTML_EVENTS .= ' <tr valign="top"> <td valign="top" class="tablebody1" width="0%" nowrap><font class="tablebodytext">' . $er["EVENT"] . '</font></td> <td valign="top" align="right" class="tablebody2" width="0%" nowrap><font class="tablebodytext">' . ($er["TODAY_COUNTER"] > 0 ? $er["TODAY_COUNTER"] : " ") . '</font></td> <td valign="top" align="right" class="tablebody2" width="0%" nowrap><font class="tablebodytext">' . ($er["YESTERDAY_COUNTER"] > 0 ? $er["YESTERDAY_COUNTER"] : " ") . '</font></td> <td valign="top" align="right" class="tablebody2" width="0%" nowrap><font class="tablebodytext">' . ($er["B_YESTERDAY_COUNTER"] > 0 ? $er["B_YESTERDAY_COUNTER"] : " ") . '</font></td> <td valign="top" align="right" class="tablebody3" width="0%" nowrap><font class="tablebodytext">' . ($er["TOTAL_COUNTER"] > 0 ? $er["TOTAL_COUNTER"] : " ") . '</font></td> </tr> '; } } $HTML_EVENTS .= ' <tr valign="top"> <td align="right" class="tablebody1_sel" style="padding:3px"><font class="tablebodytext">' . GetMessage("STAT_TOTAL") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TODAY_COUNTER > 0 ? $total_TODAY_COUNTER : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_YESTERDAY_COUNTER > 0 ? $total_YESTERDAY_COUNTER : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_B_YESTERDAY_COUNTER > 0 ? $total_B_YESTERDAY_COUNTER : " ") . '</font></td> <td align="right" class="tablebody3_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TOTAL_COUNTER > 0 ? $total_TOTAL_COUNTER : " ") . '</font></td> </table> '; $HTML_REFERERS = ' <font class="tablebodytext">' . GetMessage("STAT_REFERERS") . ' (Top 10):</font><br> <table border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td valign="top" align="center" class="tablehead1" width="48%" nowrap><font class="tableheadtext">' . GetMessage("STAT_SERVER") . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_TODAY") . '</font><br><font class="notesmall">' . $now_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_YESTERDAY") . '</font><br><font class="notesmall">' . $yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_BEFORE_YESTERDAY") . '</font><br><font class="notesmall">' . $bef_yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead3" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_TOTAL_1") . '</font></td> </tr> '; $i = 0; $total_TODAY_REFERERS = 0; $total_YESTERDAY_REFERERS = 0; $total_B_YESTERDAY_REFERERS = 0; $total_TOTAL_REFERERS = 0; while ($rr = $referers->Fetch()) { $i++; $total_TODAY_REFERERS += $rr["TODAY_REFERERS"]; $total_YESTERDAY_REFERERS += $rr["YESTERDAY_REFERERS"]; $total_B_YESTERDAY_REFERERS += $rr["B_YESTERDAY_REFERERS"]; $total_TOTAL_REFERERS += $rr["TOTAL_REFERERS"]; if ($i <= 10) { $HTML_REFERERS .= ' <tr> <td valign="top" class="tablebody1" nowrap><font class="tablebodytext">' . $rr["SITE_NAME"] . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($rr["TODAY_REFERERS"] > 0 ? $rr["TODAY_REFERERS"] : " ") . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($rr["YESTERDAY_REFERERS"] > 0 ? $rr["YESTERDAY_REFERERS"] : " ") . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($rr["B_YESTERDAY_REFERERS"] > 0 ? $rr["B_YESTERDAY_REFERERS"] : " ") . '</font></td> <td align="right" class="tablebody3"><font class="tablebodytext">' . ($rr["TOTAL_REFERERS"] > 0 ? $rr["TOTAL_REFERERS"] : " ") . '</font></td> </tr> '; } } $HTML_REFERERS .= ' <tr valign="top"> <td align="right" class="tablebody1_sel" style="padding:3px"><font class="tablebodytext">' . GetMessage("STAT_TOTAL") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TODAY_REFERERS > 0 ? $total_TODAY_REFERERS : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_YESTERDAY_REFERERS > 0 ? $total_YESTERDAY_REFERERS : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_B_YESTERDAY_REFERERS > 0 ? $total_B_YESTERDAY_REFERERS : " ") . '</font></td> <td align="right" class="tablebody3_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TOTAL_REFERERS > 0 ? $total_TOTAL_REFERERS : " ") . '</font></td> </table> '; $HTML_PHRASES = ' <font class="tablebodytext">' . GetMessage("STAT_PHRASES") . ' (Top 10):</font><br> <table border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td valign="top" align="center" class="tablehead1" width="48%" nowrap><font class="tableheadtext">' . GetMessage("STAT_PHRASE") . '</td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_TODAY") . '</font><br><font class="notesmall">' . $now_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_YESTERDAY") . '</font><br><font class="notesmall">' . $yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_BEFORE_YESTERDAY") . '</font><br><font class="notesmall">' . $bef_yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead3" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_TOTAL_1") . '</font></td> </tr> '; $i = 0; $total_TODAY_PHRASES = 0; $total_YESTERDAY_PHRASES = 0; $total_B_YESTERDAY_PHRASES = 0; $total_TOTAL_PHRASES = 0; while ($pr = $phrases->GetNext()) { $i++; $total_TODAY_PHRASES += $pr["TODAY_PHRASES"]; $total_YESTERDAY_PHRASES += $pr["YESTERDAY_PHRASES"]; $total_B_YESTERDAY_PHRASES += $pr["B_YESTERDAY_PHRASES"]; $total_TOTAL_PHRASES += $pr["TOTAL_PHRASES"]; if ($i <= 10) { $HTML_PHRASES .= ' <tr valign="top"> <td valign="top" class="tablebody1" width="0%" nowrap><font class="tablebodytext">' . TruncateText($pr["PHRASE"], 50) . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($pr["TODAY_PHRASES"] > 0 ? $pr["TODAY_PHRASES"] : " ") . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($pr["YESTERDAY_PHRASES"] > 0 ? $pr["YESTERDAY_PHRASES"] : " ") . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($pr["B_YESTERDAY_PHRASES"] > 0 ? $pr["B_YESTERDAY_PHRASES"] : " ") . '</font></td> <td align="right" class="tablebody3"><font class="tablebodytext">' . ($pr["TOTAL_PHRASES"] > 0 ? $pr["TOTAL_PHRASES"] : " ") . '</font></td> </tr> '; } } $HTML_PHRASES .= ' <tr valign="top"> <td align="right" class="tablebody1_sel" style="padding:3px"><font class="tablebodytext">' . GetMessage("STAT_TOTAL") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TODAY_PHRASES > 0 ? $total_TODAY_PHRASES : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_YESTERDAY_PHRASES > 0 ? $total_YESTERDAY_PHRASES : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_B_YESTERDAY_PHRASES > 0 ? $total_B_YESTERDAY_PHRASES : " ") . '</font></td> <td align="right" class="tablebody3_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TOTAL_PHRASES > 0 ? $total_TOTAL_PHRASES : " ") . '</font></td> </table> '; $HTML_SEARCHERS = ' <font class="tablebodytext">' . GetMessage("STAT_SITE_INDEXING") . ' (Top 10):</font><br> <table border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td valign="top" align="center" class="tablehead1" width="48%" nowrap><font class="tableheadtext">' . GetMessage("STAT_SEARCHER") . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_TODAY") . '</font><br><font class="notesmall">' . $now_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_YESTERDAY") . '</font><br><font class="notesmall">' . $yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead2" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_BEFORE_YESTERDAY") . '</font><br><font class="notesmall">' . $bef_yesterday_date . '</font></td> <td valign="top" align="center" class="tablehead3" width="13%" nowrap><font class="tablebodytext">' . GetMessage("STAT_TOTAL_1") . '</font></td> </tr> '; $i = 0; $total_TODAY_HITS = 0; $total_YESTERDAY_HITS = 0; $total_B_YESTERDAY_HITS = 0; $total_TOTAL_HITS = 0; while ($fr = $searchers->Fetch()) { $i++; $total_TODAY_HITS += $fr["TODAY_HITS"]; $total_YESTERDAY_HITS += $fr["YESTERDAY_HITS"]; $total_B_YESTERDAY_HITS += $fr["B_YESTERDAY_HITS"]; $total_TOTAL_HITS += $fr["TOTAL_HITS"]; if ($i <= 10) { $HTML_SEARCHERS .= ' <tr valign="top"> <td valign="top" class="tablebody1" width="0%" nowrap><font class="tablebodytext">' . $fr["NAME"] . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($fr["TODAY_HITS"] > 0 ? $fr["TODAY_HITS"] : " ") . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($fr["YESTERDAY_HITS"] > 0 ? $fr["YESTERDAY_HITS"] : " ") . '</font></td> <td align="right" class="tablebody2"><font class="tablebodytext">' . ($fr["B_YESTERDAY_HITS"] > 0 ? $fr["B_YESTERDAY_HITS"] : " ") . '</font></td> <td align="right" class="tablebody3"><font class="tablebodytext">' . ($fr["TOTAL_HITS"] > 0 ? $fr["TOTAL_HITS"] : " ") . '</font></td> </tr> '; } } $HTML_SEARCHERS .= ' <tr valign="top"> <td align="right" class="tablebody1_sel" style="padding:3px"><font class="tablebodytext">' . GetMessage("STAT_TOTAL") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TODAY_HITS > 0 ? $total_TODAY_HITS : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_YESTERDAY_HITS > 0 ? $total_YESTERDAY_HITS : " ") . '</font></td> <td align="right" class="tablebody2_sel" style="padding:3px"><font class="tablebodytext">' . ($total_B_YESTERDAY_HITS > 0 ? $total_B_YESTERDAY_HITS : " ") . '</font></td> <td align="right" class="tablebody3_sel" style="padding:3px"><font class="tablebodytext">' . ($total_TOTAL_HITS > 0 ? $total_TOTAL_HITS : " ") . '</font></td> </table> '; $HTML_FOOTER = ' </body> </html> '; $arEventFields = array("SERVER_TIME" => $now_full_date, "HTML_HEADER" => $HTML_HEADER, "HTML_FOOTER" => $HTML_FOOTER, "HTML_COMMON" => $HTML_COMMON, "HTML_ADV" => $HTML_ADV, "HTML_EVENTS" => $HTML_EVENTS, "HTML_REFERERS" => $HTML_REFERERS, "HTML_PHRASES" => $HTML_PHRASES, "HTML_SEARCHERS" => $HTML_SEARCHERS, "EMAIL_TO" => COption::GetOptionString("main", "email_from", "")); /* echo $HTML_HEADER."<br>"; echo $HTML_FOOTER."<br>"; echo $HTML_COMMON."<br>"; echo $HTML_ADV."<br>"; echo $HTML_EVENTS."<br>"; echo $HTML_REFERERS."<br>"; echo $HTML_PHRASES."<br>"; echo $HTML_SEARCHERS."<br>"; die(); */ CEvent::Send("STATISTIC_DAILY_REPORT", $arSite["ID"], $arEventFields); $MESS = $OLD_MESS; } return "SendDailyStatistics();"; }