本文整理汇总了PHP中CSite::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSite::GetList方法的具体用法?PHP CSite::GetList怎么用?PHP CSite::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSite
的用法示例。
在下文中一共展示了CSite::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstallDB
function InstallDB()
{
global $APPLICATION, $DB, $errors;
if (!$DB->Query("SELECT 'x' FROM b_adv_banner", true)) {
$EMPTY = "Y";
} else {
$EMPTY = "N";
}
if ($EMPTY == "Y") {
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/advertising/install/db/" . strtolower($DB->type) . "/install.sql");
if (!empty($errors)) {
$APPLICATION->ThrowException(implode("", $errors));
return false;
}
}
RegisterModule("advertising");
RegisterModuleDependences("main", "OnBeforeProlog", "advertising");
RegisterModuleDependences("main", "OnEndBufferContent", "advertising", "CAdvBanner", "FixShowAll");
RegisterModuleDependences("main", "OnBeforeRestartBuffer", "advertising", "CAdvBanner", "BeforeRestartBuffer");
CAgent::AddAgent("CAdvContract::SendInfo();", "advertising", "N", 7200);
CAgent::AddAgent("CAdvBanner::CleanUpDynamics();", "advertising", "N", 86400);
if ($EMPTY == "Y") {
CModule::IncludeModule('advertising');
$arSites = array();
$rs = CSite::GetList($b = "sort", $o = "asc");
while ($ar = $rs->Fetch()) {
$arSites[] = $ar['ID'];
}
$ac = new CAdvContract();
$arFields = array('ACTIVE' => 'Y', 'NAME' => 'Default', 'SORT' => 10000, 'DESCRIPTION' => 'all site without any restrictions', 'EMAIL_COUNT' => 1, 'arrTYPE' => array('ALL'), 'arrWEEKDAY' => array('MONDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), 'SATURDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), 'SUNDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), 'THURSDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), 'TUESDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), 'WEDNESDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), 'FRIDAY' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)), 'arrSITE' => $arSites);
$ac->Set($arFields, 0, 'N');
}
return true;
}
示例2: getConfiguredDomains
public function getConfiguredDomains()
{
$result = array();
$converter = CBXPunycode::GetConverter();
$domainName = COption::GetOptionString("main", "server_name", "");
if ($domainName != "") {
$result[$domainName] = $domainName;
}
$by = "";
$order = "";
$siteList = CSite::GetList($by, $order, array("ACTIVE" => "Y"));
while ($site = $siteList->Fetch()) {
$domains = explode("\r\n", $site["DOMAINS"]);
foreach ($domains as $domainName) {
if ($domainName != "") {
$punyName = $converter->Encode($domainName);
if ($punyName !== false) {
$result[$punyName] = $domainName;
}
}
}
}
ksort($result);
return $result;
}
示例3: installEvents
/**
* Creates events for sending e-mail.
* @return bool
*/
public static function installEvents()
{
$dbEvent = \CEventMessage::GetList($b = "ID", $order = "ASC", array("EVENT_NAME" => "SALE_EBAY_ERROR"));
if (!$dbEvent->Fetch()) {
$langs = \CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
$obEventType = new \CEventType();
$obEventType->Add(array("EVENT_NAME" => "SALE_EBAY_ERROR", "NAME" => Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR"), "LID" => $lid, "DESCRIPTION" => "\n\t\t\t\t\t#ERROR_TYPE# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_TYPE") . "\n\t\t\t\t\t#ERROR_DETAILS# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_DETAIL") . "\n\t\t\t\t\t#EMAIL_FROM# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_FROM") . "\n\t\t\t\t\t#EMAIL_TO# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_TO") . "\n\t\t\t\t\t#BCC# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_BCC")));
$arSites = array();
$sites = \CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$arr = array();
$arr["ACTIVE"] = "Y";
$arr["EVENT_NAME"] = "SALE_EBAY_ERROR";
$arr["LID"] = $arSites;
$arr["EMAIL_FROM"] = "#DEFAULT_EMAIL_FROM#";
$arr["EMAIL_TO"] = "#EMAIL_TO#";
$arr["BCC"] = "#BCC#";
$arr["SUBJECT"] = "#SITE_NAME# " . Loc::getMessage("SALE_EBAY_EVNT_MSG_SBUJ']") . ".";
$arr["BODY_TYPE"] = "text";
$arr["MESSAGE"] = Loc::getMessage("SALE_EBAY_EVNT_MSG_INFO_SITE") . " #SITE_NAME#.\n\n" . Loc::getMessage("SALE_EBAY_EVNT_MSG") . ":\n\n" . "#ERROR_TYPE#\n\n" . "#ERROR_DETAILS#";
$obTemplate = new \CEventMessage();
$obTemplate->Add($arr);
}
}
}
return true;
}
示例4: DoInstall
function DoInstall()
{
global $APPLICATION, $USER, $step, $arSitesList;
if ($USER->IsAdmin()) {
$arSitesList = array();
$rsSites = CSite::GetList($by = "sort", $order = "desc", array());
while ($arSite = $rsSites->Fetch()) {
$arSitesList[$arSite['ID']] = $arSite['NAME'];
}
$step = IntVal($step);
if ($step < 2) {
$APPLICATION->IncludeAdminFile(GetMessage("CONTENT_INCLUDER_MODULE_INSTALL_TITLE") . $this->MODULE_ID, $this->sModuleInstallFullPath . "step1.php");
} elseif ($step == 2) {
RegisterModule($this->MODULE_ID);
RegisterModuleDependences("main", "OnEndBufferContent", $this->MODULE_ID, '\\Bit\\Includer\\Handlers', "OnEndBufferContentHandler");
RegisterModuleDependences("fileman", "OnIncludeHTMLEditorScript", $this->MODULE_ID, '\\Bit\\Includer\\Handlers', "OnIncludeHTMLEditorScriptHandler");
$this->InstallFiles();
$sSiteId = array_key_exists($_REQUEST['site_id'], $arSitesList) ? $_REQUEST['site_id'] : SITE_ID;
if ($_REQUEST['install_sample_iblock'] === "Y") {
$this->createSampleIblock($sSiteId);
}
if ($_REQUEST['disable_new_editor'] === "Y") {
COption::setOptionString("fileman", "use_editor_3", "");
}
COption::SetOptionString("bit.includer", "include_jquery", $_REQUEST['include_jquery_for_component'] === "Y" ? "Y" : "N");
$APPLICATION->IncludeAdminFile(GetMessage("CONTENT_INCLUDER_MODULE_INSTALL_TITLE"), $this->sModuleInstallFullPath . "step2.php");
}
}
}
示例5: CreateWizardIndex
function CreateWizardIndex($wizardName, &$errorMessage)
{
$indexContent = '<' . '?' . 'define("WIZARD_DEFAULT_SITE_ID", "' . (defined("WIZARD_DEFAULT_SITE_ID") ? WIZARD_DEFAULT_SITE_ID : "s1") . '");' . 'require(' . '$' . '_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");' . 'require_once(' . '$' . '_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard.php");' . '$' . 'wizard = new CWizard("' . $wizardName . '");' . '$' . 'wizard->Install();' . 'require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");' . '?' . '>';
$p = $_SERVER["DOCUMENT_ROOT"] . "/index.php";
if (defined("WIZARD_DEFAULT_SITE_ID")) {
$rsSite = CSite::GetList($by = "sort", $order = "asc", array("ID" => WIZARD_DEFAULT_SITE_ID));
$arSite = $rsSite->GetNext();
$p = CSite::GetSiteDocRoot($arSite["LID"]) . $arSite["DIR"] . "/index.php";
}
$handler = @fopen($p, "wb");
if (!$handler) {
$errorMessage = InstallGetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
return false;
}
$success = @fwrite($handler, $indexContent);
if (!$success) {
$errorMessage = InstallGetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
return false;
}
if (defined("BX_FILE_PERMISSIONS")) {
@chmod($_SERVER["DOCUMENT_ROOT"] . "/index.php", BX_FILE_PERMISSIONS);
}
fclose($handler);
return true;
}
示例6: ShowStep
function ShowStep()
{
CModule::IncludeModule("currency");
$arSites = array();
//$dbSite = CSite::GetList($b="SORT", $o="ASC", Array("ACTIVE"=>"Y", "ID"=>"ru"));
$dbSite = CSite::GetList($b = "SORT", $o = "ASC", array("ACTIVE" => "Y"));
while ($arSite = $dbSite->Fetch()) {
$arSites[$arSite["ID"]] = $arSite["NAME"];
if ($arSite["DEF"] == "Y") {
$defSite = $arSite["ID"];
}
}
/*if(empty($arSites))
{
$dbSite = CSite::GetList($b="SORT", $o="ASC", Array("ACTIVE"=>"Y", "ID"=>"s1"));
while($arSite = $dbSite -> Fetch())
{
$arSites[$arSite["ID"]] = $arSite["NAME"];
if($arSite["DEF"]=="Y")
$defSite = $arSite["ID"];
}
}*/
$this->content = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/bitrix/wizards/bitrix/sale.install/styles.css\">";
$this->content .= GetMessage("WW_STEP1_1") . '<br /><table class="data-table">';
$this->content .= "<tr><th>" . GetMessage("WW_STEP1_2") . ":</th><td>" . $this->ShowSelectField("siteID", $arSites) . "</td></tr>";
$this->content .= "<tr><th>" . GetMessage("WW_STEP1_3") . "</th><td>" . $this->ShowInputField("text", "orderEmail", array("size" => "20")) . "</td></tr>";
$this->content .= "<tr><th>" . GetMessage("WW_STEP1_4") . "</th><td>" . $this->ShowInputField("text", "saveBasket", array("size" => "10")) . "</td></tr>";
$dbCurrency = CCurrency::GetList($b = "SORT", $o = "ASC");
while ($arCurrency = $dbCurrency->Fetch()) {
$arCurrencies[$arCurrency["CURRENCY"]] = $arCurrency["CURRENCY"] . " (" . $arCurrency["FULL_NAME"] . ")";
}
$this->content .= "<tr><th>" . GetMessage("WW_STEP1_5") . "</th><td>" . $this->ShowSelectField("currencyID", $arCurrencies) . "</td></tr>";
$this->content .= "</table>";
}
示例7: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $APPLICATION;
$this->errors = false;
if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/meeting/install/db/" . strtolower($DB->type) . "/uninstall.sql");
if ($this->errors === false && CModule::IncludeModule('forum')) {
$dbRes = CSite::GetList($by = 'sort', $order = 'asc', array());
while ($arSite = $dbRes->Fetch()) {
$forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, $arSite['ID']);
if ($forumId > 0) {
CForumNew::Delete($forumId);
}
}
}
}
UnRegisterModuleDependences("calendar", "OnAfterCalendarConvert", "meeting", "CMeetingEventHandlers", "OnAfterCalendarConvert");
UnRegisterModuleDependences("tasks", "OnTaskDelete", "meeting", "CMeetingEventHandlers", "OnTaskDelete");
UnRegisterModule("meeting");
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
示例8: Fetch
function Fetch()
{
static $arSite = array();
$r = parent::Fetch();
if ($r) {
$site_id = $r["SITE_ID"];
if (!isset($arSite[$site_id])) {
$rsSite = CSite::GetList($b, $o, array("ID" => $site_id));
$arSite[$site_id] = $rsSite->Fetch();
}
$r["DIR"] = $arSite[$site_id]["DIR"];
$r["SERVER_NAME"] = $arSite[$site_id]["SERVER_NAME"];
if (strlen($r["SITE_URL"]) > 0) {
$r["URL"] = $r["SITE_URL"];
}
if (substr($r["URL"], 0, 1) == "=") {
foreach (GetModuleEvents("search", "OnSearchGetURL", true) as $arEvent) {
$r["URL"] = ExecuteModuleEventEx($arEvent, array($r));
}
}
$r["URL"] = str_replace(array("#LANG#", "#SITE_DIR#", "#SERVER_NAME#"), array($r["DIR"], $r["DIR"], $r["SERVER_NAME"]), $r["URL"]);
$r["URL"] = preg_replace("'(?<!:)/+'s", "/", $r["URL"]);
unset($r["SITE_URL"]);
}
return $r;
}
示例9: UnInstallDB
function UnInstallDB($arParams = array())
{
global $APPLICATION, $DB, $DOCUMENT_ROOT;
if(!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y")
{
$errors = $DB->RunSQLBatch($DOCUMENT_ROOT."/bitrix/modules/socialservices/install/db/".strtolower($DB->type)."/uninstall.sql");
if (!empty($errors))
{
$APPLICATION->ThrowException(implode("", $errors));
return false;
}
}
UnRegisterModuleDependences("main", "OnUserDelete", "socialservices", "CSocServAuthDB", "OnUserDelete");
UnRegisterModuleDependences('socialnetwork', 'OnFillSocNetLogEvents', 'socialservices', 'CSocServEventHandlers', 'OnFillSocNetLogEvents');
UnRegisterModuleDependences('timeman', 'OnAfterTMReportDailyAdd', 'socialservices', 'CSocServAuthDB', 'OnAfterTMReportDailyAdd');
UnRegisterModuleDependences('timeman', 'OnAfterTMDayStart', 'socialservices', 'CSocServAuthDB', 'OnAfterTMDayStart');
UnRegisterModuleDependences('timeman', 'OnTimeManShow', 'socialservices', 'CSocServEventHandlers', 'OnTimeManShow');
$dbSites = CSite::GetList(($b="sort"), ($o="asc"), array("ACTIVE" => "Y"));
while ($arSite = $dbSites->Fetch())
{
$siteId = $arSite['ID'];
CAgent::RemoveAgent("CSocServAuthManager::GetTwitMessages($siteId);", "socialservices");
}
UnRegisterModule("socialservices");
return true;
}
示例10: Load
public function Load()
{
global $USER;
if (!isset($_SESSION["SESS_AUTH"]["USER_ID"]) || !$_SESSION["SESS_AUTH"]["USER_ID"]) {
$USER = new CUser();
}
$this->isLogged = true;
$defaultSite = CSite::GetList($by = "def", $order = "desc", array())->Fetch();
$this->encodingDefault = $defaultSite["CHARSET"];
$this->PrepareSettings();
$this->fp = $this->PrepareFile($this->filename . '.tmp');
if ($this->isLogged) {
$this->fpLog = $this->PrepareFile($this->logFile);
$this->WriteLog("Start Loading");
}
$this->PreWriteCatalog();
$categories = $this->GetCategories();
$this->WriteCategories($categories);
$this->PreWriteOffers();
$this->BuildOffers($categories);
$this->PostWriteOffers();
$this->PostWriteCatalog();
if ($this->isLogged) {
$this->WriteLog("Loading was ended successfully (peek memory usage: " . memory_get_peak_usage() . ")");
}
$this->CloseFile($this->fp);
$this->CloseFile($this->fpLog);
unlink($_SERVER["DOCUMENT_ROOT"] . $this->filename);
rename($_SERVER["DOCUMENT_ROOT"] . $this->filename . '.tmp', $_SERVER["DOCUMENT_ROOT"] . $this->filename);
return true;
}
示例11: fetchSites
private function fetchSites()
{
if (!isset($this->sites)) {
$res = \CSite::GetList();
self::$sites = $res->arResult;
}
}
示例12: InstallDB
function InstallDB($arParams = array())
{
RegisterModuleDependences('main', 'OnBuildGlobalMenu', self::MODULE_ID, 'CIpdesignK', 'OnBuildGlobalMenu');
$arsites = array();
$rsSites = CSite::GetList($by="sort", $order="desc", false);
while ($arSite = $rsSites->Fetch()){
$arsites[] = $arSite['ID'];
}
$arFilter = array(
"TYPE_ID" => "SENDWISHLIST",
);
$rsET = CEventType::GetList($arFilter);
$arET = $rsET->Fetch();
if(empty($arET)){
$et = new CEventType;
$arMessageFields = array("USER_ID" => $UserProduct['USER']['ID'],
"USER_NAME" => $UserProduct['USER']["NAME"].' '.$UserProduct['USER']["LAST_NAME"],
"USER_EMAIL" => $UserProduct['USER']["EMAIL"],
"PRODUCTS_LIST" => $strListProduct);
$DESCRIPTION = '#USER_ID# - '.GetMessage("IT_BASKET_SENDER_USER_ID");
$DESCRIPTION .= '\n#USER_NAME# - '.GetMessage("IT_BASKET_SENDER_USER_NAME");
$DESCRIPTION .= '\n#USER_EMAIL# - '.GetMessage("IT_BASKET_SENDER_USER_EMAIL");
$DESCRIPTION .= '\n#PRODUCTS_LIST# - '.GetMessage("IT_BASKET_SENDER_PRODUCTS_LIST");
$sendType = $et->Add(array(
"LID" => 'ru',
"EVENT_NAME" => "SENDWISHLIST",
"NAME" => GetMessage("IT_SENDER_TYPE_NAME"),
"DESCRIPTION" => $DESCRIPTION
));
}else{
$sendType = $arET['ID'];
}
$rsMess = CEventMessage::GetList($by="site_id", $order="desc", array('TYPE' => 'SENDWISHLIST'));
$arMess = $rsMess->Fetch();
if(empty($arMess)){
$message = '';
$message .= '<h2>'.GetMessage("IT_BASKET_SENDER_TEMPLATE_HELLO").',#USER_NAME#</h2>';
$message .= '<p>'.GetMessage("IT_BASKET_SENDER_TEMPLATE_WHISHLIST").'</p>';
$message .= '<hr />';
$message .= '#PRODUCTS_LIST#';
$arFields = array("ACTIVE" => 'Y',
"EVENT_NAME" => "SENDWISHLIST",
"LID" => $arsites,
"EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#",
"EMAIL_TO" => "#USER_EMAIL#",
"BCC" => "",
"MESSAGE" => $message,
"BODY_TYPE" => "html",
"SUBJECT" => GetMessage("IT_SENDER_MESSAGE_SUBJECT"). " #SERVER_NAME# ",
);
$emess = new CEventMessage;
if($emess->Add($arFields)){
}
};
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", self::MODULE_ID, "CSaleActionCtrlBasketMain", "GetControlDescr");
RegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", 110, '/modules/ipdesign.k1785/itdiscount.php');
return true;
}
示例13: InstallOptions
function InstallOptions(){
$rSites = CSite::GetList($by="sort", $order="desc", array() );
while( $aSite = $rSites->Fetch() ){
$aSites[$aSite['NAME'].' '.$aSite['ID']] = $aSite['ID'];
};
COption::SetOptionString('tagsmanager', 'SITE_ID', implode( ',',$aSites ));
return true;
}
示例14: getSites
public static function getSites()
{
$ss = array();
$dbs = CSite::GetList($b = "sort", $o = "desc");
while ($s = $dbs->Fetch()) {
$ss[] = $s["LID"];
}
return $ss;
}
示例15: getSiteList
/**
* @return array Возвращает список сайтов
*/
function getSiteList()
{
$arSites = array();
$rsSites = CSite::GetList($by = 'sort', $order = 'asc', array());
while ($arRes = $rsSites->GetNext()) {
$arSites[] = array('ID' => $arRes['ID'], 'NAME' => $arRes['NAME']);
}
return $arSites;
}