当前位置: 首页>>代码示例>>PHP>>正文


PHP CSite::GetByID方法代码示例

本文整理汇总了PHP中CSite::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSite::GetByID方法的具体用法?PHP CSite::GetByID怎么用?PHP CSite::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSite的用法示例。


在下文中一共展示了CSite::GetByID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CheckFields

 public static function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     global $DB;
     if ($ACTION != "ADD" && IntVal($ID) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("System error 870164", "ERROR");
         return false;
     }
     if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && (is_array($arFields["SITE_ID"]) && count($arFields["SITE_ID"]) <= 0 || !is_array($arFields["SITE_ID"]) && strlen($arFields["SITE_ID"]) <= 0)) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GS_EMPTY_SITE_ID"), "EMPTY_SITE_ID");
         return false;
     } elseif (is_set($arFields, "SITE_ID")) {
         if (!is_array($arFields["SITE_ID"])) {
             $arFields["SITE_ID"] = array($arFields["SITE_ID"]);
         }
         foreach ($arFields["SITE_ID"] as $v) {
             $dbResult = CSite::GetByID($v);
             if (!$dbResult->Fetch()) {
                 $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $v, GetMessage("SONET_GS_ERROR_NO_SITE")), "ERROR_NO_SITE");
                 return false;
             }
         }
     }
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GS_EMPTY_NAME"), "EMPTY_NAME");
         return false;
     }
     if (is_set($arFields, "SORT") || $ACTION == "ADD") {
         $arFields["SORT"] = intVal($arFields["SORT"]) > 0 ? intVal($arFields["SORT"]) : 100;
     }
     return True;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:31,代码来源:group_subject.php

示例2: CheckFields

 function CheckFields($ACTION, &$arFields)
 {
     global $DB, $USER;
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGPS_EMPTY_NAME"), "ERROR_NO_NAME");
         return false;
     }
     /*
     if (is_set($arFields, "LID") && $ACTION!="ADD")
     	UnSet($arFields["LID"]);
     
     if ((is_set($arFields, "CURRENCY") || $ACTION=="ADD") && strlen($arFields["CURRENCY"])<=0)
     {
     	$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGPS_EMPTY_CURRENCY"), "ERROR_NO_CURRENCY");
     	return false;
     }
     */
     if (is_set($arFields, "LID")) {
         $dbSite = CSite::GetByID($arFields["LID"]);
         if (!$dbSite->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["LID"], GetMessage("SKGPS_NO_SITE")), "ERROR_NO_SITE");
             return false;
         }
     }
     if (is_set($arFields, "ACTIVE") && $arFields["ACTIVE"] != "Y") {
         $arFields["ACTIVE"] = "N";
     }
     if (is_set($arFields, "SORT") && IntVal($arFields["SORT"]) <= 0) {
         $arFields["SORT"] = 100;
     }
     return True;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:32,代码来源:pay_system.php

示例3: init

 function init()
 {
     $this->username = CSalePaySystemAction::GetParamValue("USER");
     $this->pwd = CSalePaySystemAction::GetParamValue("PWD");
     $this->signature = CSalePaySystemAction::GetParamValue("SIGNATURE");
     $this->currency = CSalePaySystemAction::GetParamValue("CURRENCY");
     $this->testMode = CSalePaySystemAction::GetParamValue("TEST") == "Y";
     if ($this->testMode) {
         $this->domain = "sandbox.";
     }
     if (strlen($_REQUEST["token"]) > 0) {
         $this->token = $_REQUEST["token"];
     }
     if (strlen($_REQUEST["PayerID"]) > 0) {
         $this->payerId = $_REQUEST["PayerID"];
     }
     $this->version = "98.0";
     $dbSite = CSite::GetByID(SITE_ID);
     $arSite = $dbSite->Fetch();
     $this->serverName = $arSite["SERVER_NAME"];
     if (strLen($this->serverName) <= 0) {
         if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
             $this->serverName = SITE_SERVER_NAME;
         } else {
             $this->serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
         }
     }
     $this->serverName = (CMain::IsHTTPS() ? "https" : "http") . "://" . $this->serverName;
     if (strlen($this->username) <= 0 || strlen($this->username) <= 0 || strlen($this->username) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("CSalePaySystempaypal: init error", "CSalePaySystempaypal_init_error");
         return false;
     }
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:34,代码来源:pre_payment.php

示例4: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     /*
     		if ((is_set($arFields, "TYPE") || $ACTION=="ADD") && strlen($arFields["TYPE"]) <= 0)
     		{
     			$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GSP_EMPTY_TYPE"), "EMPTY_TYPE");
     			return false;
     		}
     */
     if ((is_set($arFields, "PATH") || $ACTION == "ADD") && strlen($arFields["PATH"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GSP_EMPTY_PATH"), "EMPTY_PATH");
         return false;
     } elseif (is_set($arFields, "PATH")) {
         $arFields["PATH"] = trim(str_replace("\\", "/", $arFields["PATH"]));
     }
     if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && strlen($arFields["SITE_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GSP_EMPTY_SITE_ID"), "EMPTY_SITE_ID");
         return false;
     } elseif (is_set($arFields, "SITE_ID")) {
         $dbResult = CSite::GetByID($arFields["SITE_ID"]);
         if (!$dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["SITE_ID"], GetMessage("BLG_GSP_ERROR_NO_SITE")), "ERROR_NO_SITE");
             return false;
         }
     }
     return True;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:27,代码来源:blog_site_path.php

示例5: AddGoogleAnaliticsEcommerceCode

    function AddGoogleAnaliticsEcommerceCode($orderId, $arOrder, $arParams){

        global $APPLICATION;

        if(isset($_SESSION['GA_ORDER_ID']) && $_SESSION['GA_ORDER_ID'] == $orderId) return;

        $gaOutput = array();

        $arSite = CSite::GetByID($arOrder['LID'])->Fetch();

        $gaOutput[] = "<script>";
        $gaOutput[] = "ga('require', 'ecommerce', 'ecommerce.js');";

        $gaOutput[] = sprintf(
            "ga('ecommerce:addTransaction', {
                'id': '%s',
                'affiliation': '%s',
                'revenue': '%s',
                'shipping': '%s',
                'tax': ''
            });",
            $orderId,
            $arSite['NAME'],
            $arOrder['PRICE'],
            $arOrder['PRICE_DELIVERY']
        );

        $dbBasket = CSaleBasket::GetList(
            array("NAME" => "ASC"),
            array("ORDER_ID" => $orderId)
        );

        while($basketItem = $dbBasket->fetch()){

            $gaOutput[] = sprintf(
                "ga('ecommerce:addItem', {
                    'id': '%s',
                    'name': '%s',
                    'sku': '%s',
                    'category': '',
                    'price': '%s',
                    'quantity': '%s'
                });",
                $orderId,
                $basketItem['NAME'],
                $basketItem['PRODUCT_ID'],
                $basketItem['PRICE'],
                $basketItem['QUANTITY']
            );

        }

        $gaOutput[] = "ga('ecommerce:send');";
        $gaOutput[] = "</script>";

        $APPLICATION->AddHeadString(implode("\n", $gaOutput), true);

        $_SESSION['GA_ORDER_ID'] = $orderId;

    }
开发者ID:nycmic,项目名称:bittest,代码行数:60,代码来源:init.php

示例6: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = false)
 {
     global $DB, $USER;
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen(trim($arFields["NAME"])) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGP_NO_NAME_TP"), "ERROR_NO_NAME");
         return false;
     }
     $arMsg = array();
     if ($ID === false && !is_set($arFields, "LID") || is_set($arFields, "LID") && (is_array($arFields["LID"]) && count($arFields["LID"]) <= 0 || !is_array($arFields["LID"]) && strlen($arFields["LID"]) <= 0)) {
         //$this->LAST_ERROR .= GetMessage("SKGP_BAD_SITE_NA")."<br>";
         $arMsg[] = array("id" => "LID", "text" => GetMessage("SKGP_BAD_SITE_NA"));
     } elseif (is_set($arFields, "LID")) {
         if (!is_array($arFields["LID"])) {
             $arFields["LID"] = array($arFields["LID"]);
         }
         foreach ($arFields["LID"] as $v) {
             $r = CSite::GetByID($v);
             if (!$r->Fetch()) {
                 //$this->LAST_ERROR .= str_replace("#ID#", $arFields["LID"], GetMessage("SKGP_NO_SITE"));
                 $arMsg[] = array("id" => "LID", "text" => GetMessage("MAIN_EVENT_BAD_SITE"));
             }
         }
     }
     if (!empty($arMsg)) {
         $e = new CAdminException($arMsg);
         $GLOBALS["APPLICATION"]->ThrowException($e);
         return false;
     }
     return True;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:30,代码来源:person_type.php

示例7: CSeoPageChecker

 function CSeoPageChecker($site, $url, $get = true, $check_errors = true)
 {
     global $APPLICATION;
     if (CModule::IncludeModule('search')) {
         $this->bSearch = true;
     } else {
         $APPLICATION->ThrowException(GetMessage('SEO_ERROR_NO_SEARCH'));
     }
     // don't return false or set bError!
     $this->__bCheckErrors = $check_errors;
     $this->__site = $site;
     $dbRes = CSite::GetByID($this->__site);
     if ($arRes = $dbRes->Fetch()) {
         $this->__lang = $arRes['LANGUAGE_ID'];
         $this->__server_name = $arRes['SERVER_NAME'];
         if (strlen($this->__server_name) <= 0) {
             $this->__server_name = COption::GetOptionString('main', 'server_name', '');
         }
         if (strlen($this->__server_name) > 0) {
             $this->__url = 'http://' . $this->__server_name . $url;
             return $get ? $this->GetHTTPData() : true;
         } else {
             $this->bError = true;
             $APPLICATION->ThrowException(str_replace('#SITE_ID#', $this->__site, GetMessage('SEO_ERROR_NO_SERVER_NAME')));
             return false;
         }
     }
     return false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:29,代码来源:seo_page_checker.php

示例8: cp_fetch_site_info

function cp_fetch_site_info($site_id = 0)
{
    static $info;
    if (!isset($info)) {
        $rsSites = CSite::GetByID(coalesce($site_id, SITE_ID));
        $info = $rsSites->Fetch();
    }
    return $info;
}
开发者ID:ASDAFF,项目名称:bitrix_lib,代码行数:9,代码来源:bitrix_lib.php

示例9: getMailTo

 /**
  * getMailTo
  * Отправитель по-умолчанию
  *
  * @return str
  */
 public static function getMailTo()
 {
     static $mailTo;
     if (empty($mailTo)) {
         $rsSites = CSite::GetByID(SITE_ID);
         $arSite = $rsSites->Fetch();
         $mailTo = empty($arSite['EMAIL']) ? DEFAULT_EMAIL_TO : $arSite['EMAIL'];
     }
     return $mailTo;
 }
开发者ID:ASDAFF,项目名称:bitrix-snippets,代码行数:16,代码来源:class.Helper.php

示例10: GetIncludeSitePage

 function GetIncludeSitePage($site)
 {
     if (strlen($site) <= 0) {
         return false;
     }
     $db_site = CSite::GetByID($site);
     if ($arSite = $db_site->Fetch()) {
         $arSite["DIR"] = RTrim($arSite["DIR"], ' \\/');
         $cur_page = GetPagePath();
         if (strlen($arSite["DIR"]) > 0) {
             global $REQUEST_URI;
             $REQUEST_URI = $arSite["DIR"] . $cur_page;
             $_SERVER["REQUEST_URI"] = $REQUEST_URI;
             return $_SERVER["DOCUMENT_ROOT"] . $REQUEST_URI;
         }
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:mainpage.php

示例11: processActionCreateDefaultProcesses

 protected function processActionCreateDefaultProcesses()
 {
     try {
         $defaultSiteId = CSite::GetDefSite();
         $iterator = CSite::GetByID($defaultSiteId);
         $site = $iterator->Fetch();
         $defaultLang = $site ? $site['LANGUAGE_ID'] : 'en';
         if ($defaultLang == 'ua') {
             $defaultLang = 'ru';
         }
         \Bitrix\Lists\Importer::installProcesses($defaultLang, $this->request->getPost('siteId'));
     } catch (Exception $e) {
         $this->errorCollection->add(array(new Error($e->getMessage())));
     }
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $this->sendJsonSuccessResponse();
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:19,代码来源:ajax.php

示例12: CheckFields

 function CheckFields($arFields, $ID = false)
 {
     global $DB;
     $arMsg = array();
     if ((is_set($arFields, "NAME") || $ID === false) && strlen(trim($arFields["NAME"])) <= 0) {
         $arMsg[] = array("id" => "NAME", "text" => GetMessage("LEARNING_BAD_NAME"));
     }
     if (is_set($arFields, "ACTIVE_FROM") && strlen($arFields["ACTIVE_FROM"]) > 0 && !$DB->IsDate($arFields["ACTIVE_FROM"], false, LANG, "FULL")) {
         $arMsg[] = array("id" => "ACTIVE_FROM", "text" => GetMessage("LEARNING_BAD_ACTIVE_FROM"));
     }
     if (is_set($arFields, "ACTIVE_TO") && strlen($arFields["ACTIVE_TO"]) > 0 && !$DB->IsDate($arFields["ACTIVE_TO"], false, LANG, "FULL")) {
         $arMsg[] = array("id" => "ACTIVE_TO", "text" => GetMessage("LEARNING_BAD_ACTIVE_TO"));
     }
     if (is_set($arFields, "PREVIEW_PICTURE") && is_array($arFields["PREVIEW_PICTURE"])) {
         $error = CFile::CheckImageFile($arFields["PREVIEW_PICTURE"]);
         if (strlen($error) > 0) {
             $arMsg[] = array("id" => "PREVIEW_PICTURE", "text" => $error);
         }
     }
     //Sites
     if ($ID === false && !is_set($arFields, "SITE_ID") || is_set($arFields, "SITE_ID") && (!is_array($arFields["SITE_ID"]) || empty($arFields["SITE_ID"]))) {
         $arMsg[] = array("id" => "SITE_ID[]", "text" => GetMessage("LEARNING_BAD_SITE_ID"));
     } elseif (is_set($arFields, "SITE_ID")) {
         $tmp = "";
         foreach ($arFields["SITE_ID"] as $lang) {
             $res = CSite::GetByID($lang);
             if (!$res->Fetch()) {
                 $tmp .= "'" . $lang . "' - " . GetMessage("LEARNING_BAD_SITE_ID_EX") . "<br>";
             }
         }
         if ($tmp != "") {
             $arMsg[] = array("id" => "SITE_ID[]", "text" => $tmp);
         }
     }
     if (!empty($arMsg)) {
         $e = new CAdminException($arMsg);
         $GLOBALS["APPLICATION"]->ThrowException($e);
         return false;
     }
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:41,代码来源:course.php

示例13: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     global $DB, $arSocNetUserEvents;
     if ($ACTION != "ADD" && IntVal($ID) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("System error 870164", "ERROR");
         return false;
     }
     if ((is_set($arFields, "USER_ID") || $ACTION == "ADD") && IntVal($arFields["USER_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UE_EMPTY_USER_ID"), "EMPTY_USER_ID");
         return false;
     } elseif (is_set($arFields, "USER_ID")) {
         $dbResult = CUser::GetByID($arFields["USER_ID"]);
         if (!$dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UE_ERROR_NO_USER_ID"), "ERROR_NO_USER_ID");
             return false;
         }
     }
     if ((is_set($arFields, "EVENT_ID") || $ACTION == "ADD") && strlen($arFields["EVENT_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UE_EMPTY_EVENT_ID"), "EMPTY_EVENT_ID");
         return false;
     } elseif (is_set($arFields, "EVENT_ID") && !in_array($arFields["EVENT_ID"], $arSocNetUserEvents)) {
         $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["EVENT_ID"], GetMessage("SONET_UE_ERROR_NO_EVENT_ID")), "ERROR_NO_EVENT_ID");
         return false;
     }
     if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && strlen($arFields["SITE_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UE_EMPTY_SITE_ID"), "EMPTY_SITE_ID");
         return false;
     } elseif (is_set($arFields, "SITE_ID")) {
         $dbResult = CSite::GetByID($arFields["SITE_ID"]);
         if (!$dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["SITE_ID"], GetMessage("SONET_UE_ERROR_NO_SITE")), "ERROR_NO_SITE");
             return false;
         }
     }
     if ((is_set($arFields, "ACTIVE") || $ACTION == "ADD") && $arFields["ACTIVE"] != "Y" && $arFields["ACTIVE"] != "N") {
         $arFields["ACTIVE"] = "Y";
     }
     return True;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:39,代码来源:user_events.php

示例14: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GG_EMPTY_NAME"), "EMPTY_NAME");
         return false;
     } elseif (is_set($arFields, "NAME")) {
         $dbResult = CBlogGroup::GetList(array(), array("NAME" => $arFields["NAME"], "!ID" => $ID, "SITE_ID" => $arFields["SITE_ID"]), false, false, array("ID"));
         if ($dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GG_DUBLICATE_NAME"), "DUBLICATE_NAME");
             return false;
         }
     }
     if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && strlen($arFields["SITE_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GG_EMPTY_SITE_ID"), "EMPTY_SITE_ID");
         return false;
     } elseif (is_set($arFields, "SITE_ID")) {
         $dbResult = CSite::GetByID($arFields["SITE_ID"]);
         if (!$dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["SITE_ID"], GetMessage("BLG_GG_ERROR_NO_SITE")), "ERROR_NO_SITE");
             return false;
         }
     }
     return True;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:24,代码来源:blog_group.php

示例15: basename

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule('sale')) {
    return;
}
$siteID = $arParams["site_id"];
if (strlen($arParams["site_id"]) <= 0) {
    $siteID = "s1";
}
$dbSite = CSite::GetByID($siteID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
$bRus = false;
if ($lang == "ru") {
    $bRus = true;
}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__), $lang));
$dbLocation = CSaleLocation::GetList(array("ID" => "ASC"), array("LID" => $lang));
if ($arLocation = $dbLocation->Fetch()) {
    $arLocationArr = array();
    $arLocation4Delivery = array();
    do {
        $arLocationArr[] = $arLocation["ID"];
    } while ($arLocation = $dbLocation->Fetch());
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:step18.php


注:本文中的CSite::GetByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。