本文整理汇总了PHP中CSite::GetDefList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSite::GetDefList方法的具体用法?PHP CSite::GetDefList怎么用?PHP CSite::GetDefList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSite
的用法示例。
在下文中一共展示了CSite::GetDefList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetSiteByAcceptLanguage
function GetSiteByAcceptLanguage($compare_site_id = false)
{
$site_id = false;
$arUserLang = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
$rsSites = CSite::GetDefList();
while ($arSite = $rsSites->Fetch()) {
$last_site_id = $arSite["ID"];
if ($arSite["DEF"] == "Y") {
$site_id = $arSite["ID"];
}
$arSites[] = $arSite;
}
if (is_array($arUserLang)) {
foreach ($arUserLang as $user_lid) {
$user_lid = strtolower(substr($user_lid, 0, 2));
foreach ($arSites as $arSite) {
$sid = $compare_site_id ? strtolower($arSite["ID"]) : strtolower($arSite["LANGUAGE_ID"]);
if ($user_lid == $sid) {
return $arSite["ID"];
}
}
}
}
if (strlen($site_id) <= 0) {
return $last_site_id;
}
return $site_id;
}
示例2: InitStep
function InitStep()
{
$this->SetTitle(GetMessage("WW_STEP1"));
$this->SetNextStep("step2");
$this->SetStepID("step1");
$this->SetFinishStep("install");
$this->SetCancelStep("cancel");
$dbSite = CSite::GetDefList();
if ($arSite = $dbSite->Fetch()) {
CModule::IncludeModule("sale");
$arCurr = CSaleLang::GetByID($arSite["LID"]);
$wizard =& $this->GetWizard();
$wizard->SetDefaultVars(array("siteID" => $arSite["ID"], "orderEmail" => "order@" . $arSite["SERVER_NAME"], "saveBasket" => 30, "currencyID" => $arCurr["CURRENCY"]));
}
}
示例3: GetDefSite
function GetDefSite($LID = false)
{
if (strlen($LID) > 0) {
$dbSite = CSite::GetByID($LID);
if ($dbSite->Fetch()) {
return $LID;
}
}
$dbDefSites = CSite::GetDefList();
if ($arDefSite = $dbDefSites->Fetch()) {
return $arDefSite["LID"];
}
return false;
}
示例4: BlockVisitorActivity
//.........这里部分代码省略.........
)
{
// если установлен максимальный интервал времени для стэка защиты то
$DEFENCE_DELAY = intval(COption::GetOptionString("statistic", "DEFENCE_DELAY"));
$STACK_TIME = COption::GetOptionString("statistic", "DEFENCE_STACK_TIME");
$MAX_STACK_HITS = COption::GetOptionString("statistic", "DEFENCE_MAX_STACK_HITS");
if (intval($STACK_TIME)>0)
{
// если лимит активности уже превышался то
if (strlen($_SESSION["SESS_GRABBER_STOP_TIME"])>0)
{
// если время задержки еще не истекло то
if ((time()-$_SESSION["SESS_GRABBER_STOP_TIME"])<=$DEFENCE_DELAY)
{
// держим дальше
$_SESSION["SESS_GRABBER_DEFENCE_STACK"] = array();
return true;
}
else // иначе
{
// обнуляем время блокирования
$_SESSION["SESS_GRABBER_STOP_TIME"] = "";
}
}
// запомним время текущего хита в стэке
$_SESSION["SESS_GRABBER_DEFENCE_STACK"][] = time();
// почистим стэк до заданного максимального интервала времени
$first_element = reset($_SESSION["SESS_GRABBER_DEFENCE_STACK"]);
$stmp = time();
$current_stack_length = $stmp-$first_element;
while(is_array($_SESSION["SESS_GRABBER_DEFENCE_STACK"]) && $current_stack_length>$STACK_TIME && count($_SESSION["SESS_GRABBER_DEFENCE_STACK"])>0)
{
$first_element = array_shift($_SESSION["SESS_GRABBER_DEFENCE_STACK"]);
$current_stack_length = $stmp-$first_element;
}
$STACK_HITS = count($_SESSION["SESS_GRABBER_DEFENCE_STACK"]);
// проверим стэк на превышение максимального кол-ва хитов
if (intval($STACK_HITS)>$MAX_STACK_HITS)
{
// инициализируем превышение активности
$stmp = time();
$_SESSION["SESS_GRABBER_STOP_TIME"] = $stmp;
if(COption::GetOptionString("statistic", "DEFENCE_LOG") === "Y")
CEventLog::Log("WARNING", "STAT_ACTIVITY_LIMIT", "statistic", "", GetMessage("STAT_DEFENCE_LOG_MESSAGE", array(
"#ACTIVITY_TIME_LIMIT#" => intval($STACK_TIME),
"#ACTIVITY_HITS#" => intval($STACK_HITS),
"#ACTIVITY_EXCEEDING#" => (intval($STACK_HITS) - intval($MAX_STACK_HITS)),
)));
// если в этой сессии письмо еще не отсылали то
if ($_SESSION["ACTIVITY_EXCEEDING_NOTIFIED"]!="Y")
{
if (intval($_SESSION["SESS_SESSION_ID"])>0)
$SESSION_LINK = "/bitrix/admin/session_list.php?lang=". $arSite["LANGUAGE_ID"]."&find_id=".$_SESSION["SESS_SESSION_ID"]."&find_id_exact_match=Y&set_filter=Y";
if (intval($_SESSION["SESS_GUEST_ID"])>0)
$VISITOR_LINK = "/bitrix/admin/guest_list.php?lang=". $arSite["LANGUAGE_ID"]."&find_id=".$_SESSION["SESS_GUEST_ID"]."&find_id_exact_match=Y&set_filter=Y";
$arr = explode(".",$_SERVER["REMOTE_ADDR"]);
$STOPLIST_LINK = "/bitrix/admin/stoplist_edit.php?lang=". $arSite["LANGUAGE_ID"]."&net1=".intval($arr[0])."&net2=".intval($arr[1])."&net3=". intval($arr[2])."&net4=".intval($arr[3])."&user_agent=".urlencode($_SERVER["HTTP_USER_AGENT"]);
if (intval($_SESSION["SESS_SEARCHER_ID"])>0)
$SEARCHER_LINK = "/bitrix/admin/hit_searcher_list.php?lang=". $arSite["LANGUAGE_ID"]."&find_searcher_id=".$_SESSION["SESS_SEARCHER_ID"]."&set_filter=Y";
$arEventFields = array(
"ACTIVITY_TIME_LIMIT" => intval($STACK_TIME),
"ACTIVITY_HITS" => intval($STACK_HITS),
"ACTIVITY_HITS_LIMIT" => intval($MAX_STACK_HITS),
"ACTIVITY_EXCEEDING" => (intval($STACK_HITS) - intval($MAX_STACK_HITS)),
"CURRENT_TIME" => GetTime($stmp,"FULL",$arSite["ID"]),
"DELAY_TIME" => $DEFENCE_DELAY,
"USER_AGENT" => $_SERVER["HTTP_USER_AGENT"],
"SESSION_ID" => $_SESSION["SESS_SESSION_ID"],
"SESSION_LINK" => $SESSION_LINK,
"SERACHER_ID" => $_SESSION["SESS_SEARCHER_ID"],
"SEARCHER_NAME" => $_SESSION["SESS_SEARCHER_NAME"],
"SEARCHER_LINK" => $SEARCHER_LINK,
"VISITOR_ID" => $_SESSION["SESS_GUEST_ID"],
"VISITOR_LINK" => $VISITOR_LINK,
"STOPLIST_LINK" => $STOPLIST_LINK,
"EMAIL_TO" => COption::GetOptionString("main", "email_from", ""),
);
if (defined("SITE_ID") && strlen(SITE_ID)>0) $site_id = SITE_ID;
else
{
$rsSite = CSite::GetDefList();
$arSite = $rsSite->Fetch();
$site_id = $arSite["ID"];
}
CEvent::Send("STATISTIC_ACTIVITY_EXCEEDING", $site_id, $arEventFields);
$_SESSION["ACTIVITY_EXCEEDING_NOTIFIED"] = "Y";
}
}
}
}
}
return false;
}
示例5: SendDailyStatistics
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%">
//.........这里部分代码省略.........