• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CTimeZone类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: InstallDB

 function InstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     // Database tables creation
     if (!$DB->Query("SELECT 'x' FROM b_list_rubric WHERE 1=0", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/subscribe/install/db/" . $DBType . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     } else {
         RegisterModule("subscribe");
         CModule::IncludeModule("subscribe");
         RegisterModuleDependences("main", "OnBeforeLangDelete", "subscribe", "CRubric", "OnBeforeLangDelete");
         RegisterModuleDependences("main", "OnUserDelete", "subscribe", "CSubscription", "OnUserDelete");
         RegisterModuleDependences("main", "OnUserLogout", "subscribe", "CSubscription", "OnUserLogout");
         RegisterModuleDependences("main", "OnGroupDelete", "subscribe", "CPosting", "OnGroupDelete");
         //agents
         CAgent::RemoveAgent("CSubscription::CleanUp();", "subscribe");
         CTimeZone::Disable();
         CAgent::Add(array("NAME" => "CSubscription::CleanUp();", "MODULE_ID" => "subscribe", "ACTIVE" => "Y", "NEXT_EXEC" => date("d.m.Y H:i:s", mktime(3, 0, 0, date("m"), date("j") + 1, date("Y"))), "AGENT_INTERVAL" => 86400, "IS_PERIOD" => "Y"));
         CTimeZone::Enable();
         return true;
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:26,代码来源:index.php


示例2: getList

 public static function getList($userId, $taskId, array $parameters = array())
 {
     $data = array();
     $task = static::getTask($userId, $taskId);
     if ($task !== null && $task->checkCanRead()) {
         $res = \CTaskLog::GetList(array('CREATED_DATE' => 'DESC'), array('TASK_ID' => $taskId));
         $tzDisabled = !\CTimeZone::enabled();
         if ($tzDisabled) {
             \CTimeZone::enable();
         }
         $tzOffset = \CTimeZone::getOffset();
         if ($tzDisabled) {
             \CTimeZone::disable();
         }
         while (true) {
             if ($parameters['ESCAPE_DATA']) {
                 $item = $res->GetNext();
             } else {
                 $item = $res->fetch();
             }
             if (!$item) {
                 break;
             }
             // Adjust unix timestamps to "bitrix timestamps"
             if (isset(\CTaskLog::$arComparedFields[$item['FIELD']]) && \CTaskLog::$arComparedFields[$item['FIELD']] === 'date') {
                 $item['TO_VALUE'] = $item['TO_VALUE'] + $tzOffset;
                 $item['FROM_VALUE'] = $item['FROM_VALUE'] + $tzOffset;
             }
             $data[] = $item;
         }
     }
     return array('DATA' => $data, 'CAN' => array());
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:33,代码来源:log.php


示例3: getGridData

 private function getGridData($gridId)
 {
     $grid = array('ID' => $gridId);
     $securityContext = $this->storage->getCurrentUserSecurityContext();
     $parameters = array('with' => array('FILE', 'CREATE_USER'), 'filter' => array('IS_EXPIRED' => false, 'OBJECT.STORAGE_ID' => $this->storage->getId(), 'CREATED_BY' => $this->getUser()->getId()));
     $parameters = Driver::getInstance()->getRightsManager()->addRightsCheck($securityContext, $parameters, array('OBJECT_ID', 'OBJECT.CREATED_BY'));
     $items = ExternalLink::getModelList($parameters);
     Collection::sortByColumn($items, array('CREATE_TIME' => array(SORT_NUMERIC, SORT_ASC)));
     $urlManager = Driver::getInstance()->getUrlManager();
     $rows = array();
     foreach ($items as $externalLink) {
         /** @var ExternalLink $externalLink */
         $exportData = $externalLink->toArray();
         $nameSpecialChars = htmlspecialcharsbx($externalLink->getFile()->getName());
         $createDateText = htmlspecialcharsbx((string) $externalLink->getCreateTime());
         $columnName = "\n\t\t\t\t<table class=\"bx-disk-object-name\"><tr>\n\t\t\t\t\t\t<td style=\"width: 45px;\"><div data-object-id=\"{$externalLink->getId()}\" class=\"draggable bx-file-icon-container-small bx-disk-file-icon\"></div></td>\n\t\t\t\t\t\t<td><a class=\"bx-disk-folder-title\" id=\"disk_obj_{$externalLink->getId()}\" href=\"\" data-bx-dateModify=\"{$createDateText}\">{$nameSpecialChars}</a></td>\n\t\t\t\t</tr></table>\n\t\t\t";
         $createdByLink = \CComponentEngine::makePathFromTemplate($this->arParams['PATH_TO_USER'], array("user_id" => $externalLink->getCreatedBy()));
         $rows[] = array('data' => $exportData, 'columns' => array('CREATE_TIME' => formatDate('x', $externalLink->getCreateTime()->getTimestamp(), time() + CTimeZone::getOffset()), 'UPDATE_TIME' => formatDate('x', $externalLink->getCreateTime()->getTimestamp(), time() + CTimeZone::getOffset()), 'NAME' => $columnName, 'FORMATTED_SIZE' => CFile::formatSize($externalLink->getFile()->getSize()), 'CREATE_USER' => "\n\t\t\t\t\t\t<div class=\"bx-disk-user-link\"><a target='_blank' href=\"{$createdByLink}\" id=\"\">" . htmlspecialcharsbx($externalLink->getCreateUser()->getFormattedName()) . "</a></div>\n\t\t\t\t\t"), 'actions' => array(array("PSEUDO_NAME" => "download", "DEFAULT" => true, "ICONCLASS" => "download", "TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DOWNLOAD'), "ONCLICK" => "jsUtils.Redirect(arguments, '" . $urlManager->getUrlForDownloadFile($externalLink->getFile()) . "')"), array("PSEUDO_NAME" => "disable_external_link", "ICONCLASS" => "disable_external_link", "TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DISABLE_EXTERNAL_LINK'), "SHORT_TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DISABLE_EXTERNAL_LINK_SHORT'), "ONCLICK" => "BX.Disk['ExternalLinkListClass_{$this->getComponentId()}'].disableExternalLink({$externalLink->getId()}, {$externalLink->getObjectId()})")));
     }
     unset($externalLink);
     $grid['MODE'] = 'list';
     $grid['HEADERS'] = array(array('id' => 'ID', 'name' => 'ID', 'default' => false, 'show_checkbox' => true), array('id' => 'NAME', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_NAME'), 'default' => true), array('id' => 'CREATE_TIME', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_CREATE_TIME'), 'default' => true), array('id' => 'CREATE_USER', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_CREATE_USER'), 'default' => false), array('id' => 'FORMATTED_SIZE', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_FORMATTED_SIZE'), 'default' => true));
     $grid['ROWS'] = $rows;
     $grid['ROWS_COUNT'] = count($rows);
     $grid['FOOTER'] = array();
     return $grid;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:27,代码来源:class.php


示例4: canRead

 /**
  * @param $userId
  * @return bool
  */
 public function canRead($userId)
 {
     if ($this->canRead !== null) {
         return $this->canRead;
     }
     if (!Loader::includeModule('socialnetwork')) {
         return false;
     }
     $cacheTtl = 2592000;
     $cacheId = 'blog_post_socnet_general_' . $this->entityId . '_' . LANGUAGE_ID;
     $timezoneOffset = \CTimeZone::getOffset();
     if ($timezoneOffset != 0) {
         $cacheId .= "_" . $timezoneOffset;
     }
     $cacheDir = '/blog/socnet_post/gen/' . intval($this->entityId / 100) . '/' . $this->entityId;
     $cache = new \CPHPCache();
     if ($cache->initCache($cacheTtl, $cacheId, $cacheDir)) {
         $post = $cache->getVars();
     } else {
         $cache->startDataCache();
         $queryPost = \CBlogPost::getList(array(), array("ID" => $this->entityId), false, false, array("ID", "BLOG_ID", "PUBLISH_STATUS", "TITLE", "AUTHOR_ID", "ENABLE_COMMENTS", "NUM_COMMENTS", "VIEWS", "CODE", "MICRO", "DETAIL_TEXT", "DATE_PUBLISH", "CATEGORY_ID", "HAS_SOCNET_ALL", "HAS_TAGS", "HAS_IMAGES", "HAS_PROPS", "HAS_COMMENT_IMAGES"));
         $post = $queryPost->fetch();
         $cache->endDataCache($post);
     }
     if (!$post) {
         $this->canRead = false;
         return false;
     }
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     $this->canRead = \CBlogPost::getSocNetPostPerms($this->entityId, true, $userId, $post["AUTHOR_ID"]) >= BLOG_PERMS_READ;
     return $this->canRead;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:36,代码来源:blogpostconnector.php


示例5: SubscribeOnTime

 public function SubscribeOnTime($workflowId, $eventName, $expiresAt)
 {
     CTimeZone::Disable();
     $result = CAgent::AddAgent("CBPSchedulerService::OnAgent('" . $workflowId . "', '" . $eventName . "', array('SchedulerService' => 'OnAgent'));", "bizproc", "N", 10, "", "Y", date($GLOBALS["DB"]->DateFormatToPHP(FORMAT_DATETIME), $expiresAt));
     CTimeZone::Enable();
     return $result;
 }
开发者ID:k-kalashnikov,项目名称:geekcon.local,代码行数:7,代码来源:schedulerservice.php


示例6: Add

 public static function Add($settings)
 {
     global $DB, $USER;
     $name = $settings['title'];
     $description = $settings['description'];
     $owner = $settings['owner'];
     unset($settings['title']);
     unset($settings['description']);
     unset($settings['owner']);
     $fields = array('TITLE' => $name, 'DESCRIPTION' => $description, 'OWNER_ID' => $owner, 'CREATED_DATE' => date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), time() + CTimeZone::GetOffset()), 'CREATED_BY' => $USER->GetID());
     if (isset($settings['mark_default'])) {
         $fields['MARK_DEFAULT'] = $settings['mark_default'];
         unset($settings['mark_default']);
     }
     $fields['SETTINGS'] = serialize($settings);
     // pre-events
     foreach (GetModuleEvents("report", "OnBeforeReportAdd", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array(&$fields)) === false) {
             return false;
         }
     }
     // save data
     $ID = $DB->Add("b_report", $fields, array("SETTINGS", "DESCRIPTION"), "report");
     // clear view params
     self::clearViewParams($ID);
     // post-events
     foreach (GetModuleEvents("report", "OnBeforeReportAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, &$fields));
     }
     return $ID;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:report.php


示例7: InstallDB

 function InstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     // Database tables creation
     if (!$DB->Query("SELECT 'x' FROM b_sender_contact WHERE 1=0", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sender/install/db/" . $DBType . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     } else {
         RegisterModule("sender");
         CModule::IncludeModule("sender");
         // read and click notifications
         RegisterModuleDependences("main", "OnMailEventMailRead", "sender", "bitrix\\sender\\postingmanager", "onMailEventMailRead");
         RegisterModuleDependences("main", "OnMailEventMailClick", "sender", "bitrix\\sender\\postingmanager", "onMailEventMailClick");
         // unsubscription notifications
         RegisterModuleDependences("main", "OnMailEventSubscriptionDisable", "sender", "Bitrix\\Sender\\Subscription", "onMailEventSubscriptionDisable");
         RegisterModuleDependences("main", "OnMailEventSubscriptionEnable", "sender", "Bitrix\\Sender\\Subscription", "onMailEventSubscriptionEnable");
         RegisterModuleDependences("main", "OnMailEventSubscriptionList", "sender", "Bitrix\\Sender\\Subscription", "onMailEventSubscriptionList");
         // connectors of module sender
         RegisterModuleDependences("sender", "OnConnectorList", "sender", "bitrix\\sender\\connectormanager", "onConnectorListContact");
         RegisterModuleDependences("sender", "OnConnectorList", "sender", "bitrix\\sender\\connectormanager", "onConnectorListRecipient");
         // mail templates and blocks
         RegisterModuleDependences("sender", "OnPresetTemplateList", "sender", "Bitrix\\Sender\\Preset\\TemplateBase", "onPresetTemplateList");
         RegisterModuleDependences("sender", "OnPresetTemplateList", "sender", "Bitrix\\Sender\\TemplateTable", "onPresetTemplateList");
         RegisterModuleDependences("sender", "OnPresetMailBlockList", "sender", "Bitrix\\Sender\\Preset\\MailBlockBase", "OnPresetMailBlockList");
         CTimeZone::Disable();
         \Bitrix\Sender\MailingManager::actualizeAgent();
         CAgent::AddAgent(\Bitrix\Sender\MailingManager::getAgentNamePeriod(), "sender", "N", COption::GetOptionString("sender", "reiterate_interval"));
         CTimeZone::Enable();
         return true;
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:35,代码来源:index.php


示例8: storeResult

function storeResult($arResult, $arParams) {
    $iblock = CIBlock::GetList(
        array(),
        array(
            'TYPE' => $arParams['IBLOCK_TYPE'],
            'CODE' => $arParams['IBLOCK_CODE'],
        )
    );
    $iblock = $iblock->Fetch();
    
    $el = new CIBlockElement;

    $props = array();
    foreach ($arResult['FIELDS_LIST'] as $arField) {
        if ($arField['FIELD_TYPE'] == 'TEXT' || $arField['FIELD_TYPE'] == 'NUMBER') {
            $props[$arField['CODE']] = array(
                'VALUE' => $arResult['POST_DATA']['~'.$arField['CODE']],
            );
        } elseif ($arField['FIELD_TYPE'] == 'TEXTAREA') {
            $props[$arField['CODE']] = array(
                'VALUE' => array(
                    'TYPE' => 'text',
                    'TEXT' => $arResult['POST_DATA']['~'.$arField['CODE']],
                ),
            );
        } elseif ($arField['FIELD_TYPE'] == 'LIST') {
            $propEnum = CIBlockPropertyEnum::GetList(
                array(),
                array(
                    'XML_ID' => $arResult['POST_DATA']['~'.$arField['CODE']],
                    'CODE' => $arField['CODE'],
                    'IBLOCK_ID' => $iblock['ID'],
                )
            );
            $propEnum = $propEnum->Fetch();
            if ( ! $propEnum) return false;

            $props[$arField['CODE']] = array(
                'VALUE' => $propEnum['ID'],
            );
        }
    }

    $res = $el->Add(array(
        'IBLOCK_TYPE' => $arParams['IBLOCK_TYPE'],
        'IBLOCK_ID' => $iblock['ID'],
        'ACTIVE' => 'Y',
        'PROPERTY_VALUES' => $props,
        'ACTIVE_FROM' => ConvertTimeStamp(time()+CTimeZone::GetOffset(), 'FULL'),
        'NAME' => 'Form result', # !!! NEED TO REPLACE TO DEFAULT VALUE
    ));

    if (!$res) {
        return array(
            'MESSAGE' => $el->LAST_ERROR,
        );
    }

    return true;
}
开发者ID:ASDAFF,项目名称:bitrix-advanced-form,代码行数:60,代码来源:store_result.php


示例9: Add

 public static function Add($userId, $tag)
 {
     global $DB, $CACHE_MANAGER;
     $userId = intval($userId);
     if ($userId == 0 || strlen($tag) <= 0) {
         return false;
     }
     $arResult = $CACHE_MANAGER->Read(3600, $cache_id = "b_pw_" . $userId, "b_pull_watch");
     if ($arResult) {
         $arResult = $CACHE_MANAGER->Get($cache_id);
     }
     if (!$arResult) {
         CTimeZone::Disable();
         $strSql = "\n\t\t\t\t\tSELECT ID, USER_ID, TAG, " . $DB->DatetimeToTimestampFunction("DATE_CREATE") . " DATE_CREATE\n\t\t\t\t\tFROM b_pull_watch\n\t\t\t\t\tWHERE USER_ID = " . intval($userId) . "\n\t\t\t";
         CTimeZone::Enable();
         $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         while ($arRes = $dbRes->Fetch()) {
             $arResult[$arRes["TAG"]] = $arRes;
         }
         $CACHE_MANAGER->Set($cache_id, $arResult);
     }
     if ($arResult && $arResult[$tag]) {
         if ($arResult[$tag]['DATE_CREATE'] + 1800 > time()) {
             self::$arUpdate[intval($arResult[$tag]['ID'])] = intval($arResult[$tag]['ID']);
             return true;
         } else {
             self::Delete($userId, $tag);
             return self::Add($userId, $tag);
         }
     }
     $CACHE_MANAGER->Clean("b_pw_" . $userId, "b_pull_watch");
     self::$arInsert[trim($tag)] = trim($tag);
     return true;
 }
开发者ID:vim84,项目名称:b-markt,代码行数:34,代码来源:pull_watch.php


示例10: CheckExpireAgent

	public static function CheckExpireAgent()
	{
		global $DB;
		if (!CPullOptions::ModuleEnable())
			return false;

		CAgent::RemoveAgent("CPullWatch::CheckExpireAgent();", "pull");

		$strSql = "SELECT count(ID) CNT FROM b_pull_watch WHERE DATE_CREATE < DATE_SUB(NOW(), INTERVAL 30 MINUTE)";
		$dbRes = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		if ($arRes = $dbRes->Fetch())
		{
			$strSql = "DELETE FROM b_pull_watch WHERE DATE_CREATE < DATE_SUB(NOW(), INTERVAL 30 MINUTE) LIMIT 1000";
			$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);

			if ($arRes['CNT'] > 1000)
			{
				CAgent::AddAgent("CPullWatch::CheckExpireAgent();", "pull", "N", 180, "", "Y", ConvertTimeStamp(time()+CTimeZone::GetOffset()+180, "FULL"));
				return false;
			}
		}

		CAgent::AddAgent("CPullWatch::CheckExpireAgent();", "pull", "N", 600, "", "Y", ConvertTimeStamp(time()+CTimeZone::GetOffset()+600, "FULL"));
		return false;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:25,代码来源:pull_watch.php


示例11: Add

	function Add($LOG_ID, $GROUP_CODE)
	{
		global $DB;

		if (is_array($GROUP_CODE))
		{
			foreach($GROUP_CODE as $GROUP_CODE_TMP)
				CSocNetLogRights::Add($LOG_ID, $GROUP_CODE_TMP);
			return false;
		}
		else
		{
			$db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetLogRightsAdd");
			while ($arEvent = $db_events->Fetch())
				if (ExecuteModuleEventEx($arEvent, array($LOG_ID, &$GROUP_CODE))===false)
					return false;

			$NEW_RIGHT_ID = $DB->Add("b_sonet_log_right", array(
				"LOG_ID" => $LOG_ID,
				"GROUP_CODE" => $GROUP_CODE,
			));
			
			if (preg_match('/^U(\d+)$/', $GROUP_CODE, $matches))
				CSocNetLogFollow::Set($matches[1], "L".$LOG_ID, "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL", SITE_ID));

			if(defined("BX_COMP_MANAGED_CACHE"))
				$GLOBALS["CACHE_MANAGER"]->ClearByTag("SONET_LOG_".intval($LOG_ID));

			return $NEW_RIGHT_ID;
		}
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:log_rights.php


示例12: sendOnAfterResultStatusChange

 function sendOnAfterResultStatusChange($WEB_FORM_ID, $RESULT_ID, $NEW_STATUS_ID = false, $CHECK_RIGHTS = 'Y')
 {
     $NEW_STATUS_ID = intval($NEW_STATUS_ID);
     $dbRes = CForm::GetByID($WEB_FORM_ID);
     if (!($arForm = $dbRes->Fetch())) {
         return;
     }
     CTimeZone::Disable();
     $dbRes = CFormResult::GetByID($RESULT_ID);
     CTimeZone::Enable();
     if (!($arResult = $dbRes->Fetch()) || !$arResult['USER_ID']) {
         return;
     }
     $dbRes = CUser::GetByID($arResult['USER_ID']);
     if (!($arUser = $dbRes->Fetch())) {
         return;
     }
     if (!$NEW_STATUS_ID) {
         $NEW_STATUS_ID = CFormStatus::GetDefault($WEB_FORM_ID);
     }
     $dbRes = CFormStatus::GetByID($NEW_STATUS_ID);
     if (!($arStatus = $dbRes->Fetch()) || strlen($arStatus['MAIL_EVENT_TYPE']) <= 0) {
         return;
     }
     $arTemplates = CFormStatus::GetMailTemplateArray($NEW_STATUS_ID);
     if (!is_array($arTemplates) || count($arTemplates) <= 0) {
         return;
     }
     $arEventFields = array("EMAIL_TO" => $arUser['EMAIL'], "RS_FORM_ID" => $arForm["ID"], "RS_FORM_NAME" => $arForm["NAME"], "RS_FORM_VARNAME" => $arForm["SID"], "RS_FORM_SID" => $arForm["SID"], "RS_RESULT_ID" => $arResult["ID"], "RS_DATE_CREATE" => $arResult["DATE_CREATE"], "RS_USER_ID" => $arResult['USER_ID'], "RS_USER_EMAIL" => $arUser['EMAIL'], "RS_USER_NAME" => $arUser["NAME"] . " " . $arUser["LAST_NAME"], "RS_STATUS_ID" => $arStatus["ID"], "RS_STATUS_NAME" => $arStatus["TITLE"]);
     $dbRes = CEventMessage::GetList($by = "id", $order = "asc", array('ID' => implode('|', $arTemplates), "ACTIVE" => "Y", "EVENT_NAME" => $arStatus["MAIL_EVENT_TYPE"]));
     while ($arTemplate = $dbRes->Fetch()) {
         CEvent::Send($arTemplate["EVENT_NAME"], $arTemplate["SITE_ID"], $arEventFields, "Y", $arTemplate["ID"]);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:34,代码来源:events.php


示例13: InstallDB

 function InstallDB()
 {
     global $DB, $APPLICATION;
     $this->errors = false;
     if (!$DB->Query("SELECT 'x' FROM b_pull_stack", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/pull/install/db/" . strtolower($DB->type) . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("", $this->errors));
         return false;
     }
     RegisterModule("pull");
     RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/pull/ajax_hit.php");
     RegisterModuleDependences("main", "OnEpilog", "pull", "CPullWatch", "DeferredSql");
     RegisterModuleDependences("main", "OnEpilog", "pull", "CPullOptions", "OnEpilog");
     RegisterModuleDependences("perfmon", "OnGetTableSchema", "pull", "CPullTableSchema", "OnGetTableSchema");
     RegisterModuleDependences("main", "OnAfterRegisterModule", "pull", "CPullOptions", "ClearCheckCache");
     RegisterModuleDependences("main", "OnAfterUnRegisterModule", "pull", "CPullOptions", "ClearCheckCache");
     if (IsModuleInstalled('intranet')) {
         RegisterModuleDependences("main", "OnAfterUserAuthorize", "pull", "CPullChannel", "OnAfterUserAuthorize");
         RegisterModuleDependences("main", "OnAfterUserLogout", "pull", "CPullChannel", "OnAfterUserLogout");
     }
     CAgent::AddAgent("CPullOptions::ClearAgent();", "pull", "N", 30, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 30, "FULL"));
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:index.php


示例14: CallBack_AddComment

 public static function CallBack_AddComment($arFields)
 {
     if (!CModule::IncludeModule('blog')) {
         return false;
     }
     $arResult = array();
     $arLog = CSocNetLog::GetList(array("ID" => "DESC"), array("TMP_ID" => $arFields["LOG_ID"]), false, false, array("ID", "SOURCE_ID", "SITE_ID", "RATING_ENTITY_ID"))->Fetch();
     if ($arLog) {
         $arIdeaPost = CBlogPost::GetById($arLog["SOURCE_ID"]);
         if ($arIdeaPost) {
             $UserIP = CBlogUser::GetUserIP();
             $IdeaCommentId = CBlogComment::Add(array("BLOG_ID" => $arIdeaPost["BLOG_ID"], "POST_ID" => $arIdeaPost["ID"], "AUTHOR_ID" => $arFields["USER_ID"], "POST_TEXT" => $arFields["MESSAGE"], "DATE_CREATE" => ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL"), "PARENT_ID" => false, "AUTHOR_IP" => $UserIP[0], "AUTHOR_IP1" => $UserIP[1]));
             $arResult = array("SOURCE_ID" => $IdeaCommentId);
             if ($arLog["RATING_ENTITY_ID"] > 0) {
                 $arResult["RATING_TYPE_ID"] = "BLOG_COMMENT";
                 $arResult["RATING_ENTITY_ID"] = $IdeaCommentId;
             }
             if (intval($IdeaCommentId) == 0) {
                 global $APPLICATION;
                 if ($ex = $APPLICATION->GetException()) {
                     $arResult["ERROR"] = $ex->GetString();
                 }
             } else {
                 //clear cache on succcess
                 BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/first_page/");
                 BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/pages/");
                 BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/comment/" . $arIdeaPost["ID"] . "/");
                 BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/post/" . $arIdeaPost["ID"] . "/");
             }
         }
     }
     return $arResult;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:33,代码来源:idea_sonet_notify.php


示例15: InstallDB

 function InstallDB()
 {
     global $DB, $APPLICATION;
     $this->errors = false;
     if (!$DB->Query("SELECT 'x' FROM b_im_chat", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/im/install/db/" . strtolower($DB->type) . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("", $this->errors));
         return false;
     }
     RegisterModule("im");
     RegisterModuleDependences('main', 'OnAddRatingVote', 'im', 'CIMEvent', 'OnAddRatingVote');
     RegisterModuleDependences('main', 'OnCancelRatingVote', 'im', 'CIMEvent', 'OnCancelRatingVote');
     RegisterModuleDependences('main', 'OnAfterUserUpdate', 'im', 'CIMEvent', 'OnAfterUserUpdate');
     RegisterModuleDependences('main', 'OnUserDelete', 'im', 'CIMEvent', 'OnUserDelete');
     RegisterModuleDependences("pull", "OnGetDependentModule", "im", "CIMEvent", "OnGetDependentModule");
     RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/im/ajax_hit.php");
     RegisterModuleDependences("perfmon", "OnGetTableSchema", "im", "CIMTableSchema", "OnGetTableSchema");
     RegisterModuleDependences("im", "OnGetNotifySchema", "im", "CIMNotifySchema", "OnGetNotifySchema");
     RegisterModuleDependences("main", "OnFileDelete", "im", "CIMEvent", "OnFileDelete");
     RegisterModuleDependences("main", "OnApplicationsBuildList", "im", "DesktopApplication", "OnApplicationsBuildList");
     CAgent::AddAgent("CIMMail::MailNotifyAgent();", "im", "N", 600);
     CAgent::AddAgent("CIMMail::MailMessageAgent();", "im", "N", 600);
     CAgent::AddAgent("CIMDisk::RemoveTmpFileAgent();", "im", "N", 43200);
     CModule::IncludeModule("im");
     if (CIMConvert::ConvertCount() > 0) {
         Cmodule::IncludeModule("im");
         CAdminNotify::Add(array("MESSAGE" => GetMessage("IM_CONVERT_MESSAGE", array("#A_TAG_START#" => '<a href="/bitrix/admin/im_convert.php?lang=' . LANGUAGE_ID . '">', "#A_TAG_END#" => "</a>")), "TAG" => "IM_CONVERT", "MODULE_ID" => "IM", "ENABLE_CLOSE" => "Y"));
         CAgent::AddAgent("CIMConvert::UndeliveredMessageAgent();", "im", "N", 20, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 20, "FULL"));
     }
     return true;
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:33,代码来源:index.php


示例16: InstallDB

	function InstallDB()
	{
		global $DB, $APPLICATION;

		$this->errors = false;
		if(!$DB->Query("SELECT 'x' FROM b_pull_stack", true))
			$this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/pull/install/db/".strtolower($DB->type)."/install.sql");

		if($this->errors !== false)
		{
			$APPLICATION->ThrowException(implode("", $this->errors));
			return false;
		}

		RegisterModule("pull");
		RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/pull/ajax_hit.php");
		RegisterModuleDependences("perfmon", "OnGetTableSchema", "pull", "CPullTableSchema", "OnGetTableSchema");
		RegisterModuleDependences("main", "OnAfterRegisterModule", "pull", "CPullOptions", "ClearCheckCache");
		RegisterModuleDependences("main", "OnAfterUnRegisterModule", "pull", "CPullOptions", "ClearCheckCache");

		COption::SetOptionString("pull", "path_to_listener", (CMain::IsHTTPS() ? "https" : "http")."://#DOMAIN#".(CMain::IsHTTPS() ? ":8894" : ":8893").'/bitrix/sub/');
		COption::SetOptionString("pull", "path_to_websocket", (CMain::IsHTTPS() ? "wss" : "ws")."://#DOMAIN#".(CMain::IsHTTPS() ? ":8894" : ":8893").'/bitrix/subws/');
		COption::SetOptionString("pull", "path_to_publish", 'http://127.0.0.1:8895/bitrix/pub/');
		COption::SetOptionString("pull", "websocket", 'N');
		COption::SetOptionString("pull", "nginx", 'N');
		COption::SetOptionString("pull", "push", 'N');

		CAgent::AddAgent("CPullOptions::ClearAgent();", "pull", "N", 30, "", "Y", ConvertTimeStamp(time()+CTimeZone::GetOffset()+30, "FULL"));

		return true;
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:index.php


示例17: SendMessage

 public static function SendMessage($ENTRY_ID, $SEND_TYPE = false)
 {
     global $DB, $APPLICATION, $USER;
     $ENTRY_ID = intval($ENTRY_ID);
     if ($ENTRY_ID <= 0) {
         return false;
     }
     $dbEntry = CTimeManEntry::GetList(array(), array("ID" => $ENTRY_ID), false, false, array("ID", "USER_ID", "DATE_START", "USER_GENDER", "INACTIVE_OR_ACTIVATED"));
     if (CModule::IncludeModule("socialnetwork") && ($arEntry = $dbEntry->Fetch())) {
         $arRights = self::GetRights($arEntry["USER_ID"]);
         if (!$arRights) {
             return false;
         }
         $date = strlen($arEntry["DATE_START"]) > 0 ? MakeTimeStamp($arEntry["DATE_START"], CSite::GetDateFormat("FULL", $site_id)) > time() + CTimeZone::GetOffset() ? $DB->CharToDateFunction($arEntry["DATE_START"], "FULL", $site_id) : $DB->CurrentTimeFunction() : $DB->CurrentTimeFunction();
         $arSoFields = array("EVENT_ID" => "timeman_entry", "=LOG_DATE" => $date, "MODULE_ID" => "timeman", "TITLE_TEMPLATE" => "#TITLE#", "TITLE" => GetMessage("TIMEMAN_NOTIFY_TITLE") . $date_text, "MESSAGE" => '', "TEXT_MESSAGE" => '', "CALLBACK_FUNC" => false, "SOURCE_ID" => $ENTRY_ID, "SITE_ID" => SITE_ID, "ENABLE_COMMENTS" => "Y", "PARAMS" => serialize(array("FORUM_ID" => COption::GetOptionInt("timeman", "report_forum_id", ""))));
         $arSoFields["ENTITY_TYPE"] = SONET_TIMEMAN_ENTRY_ENTITY;
         $arSoFields["ENTITY_ID"] = $arEntry["USER_ID"];
         $arSoFields["USER_ID"] = $USER->GetID();
         //$arEntry["USER_ID"];
         $dbRes = CSocNetLog::GetList(array(), array('ENTITY_TYPE' => $arSoFields['ENTITY_TYPE'], 'ENTITY_ID' => $arSoFields['ENTITY_ID'], 'EVENT_ID' => $arSoFields['EVENT_ID'], 'SOURCE_ID' => $arSoFields['SOURCE_ID']));
         $arRes = $dbRes->Fetch();
         $bSend = false;
         if ($arRes) {
             $logID = $arRes['ID'];
             if ($SEND_TYPE != 'A') {
                 $arSoFields["=LOG_UPDATE"] = $date;
                 CSocNetLog::Update($logID, $arSoFields);
                 $bSend = true;
                 if (IsModuleInstalled("im")) {
                     $arEntry["LOG_ID"] = $logID;
                     $arEntry["DATE_TEXT"] = FormatDate("j F", MakeTimeStamp($arEntry["DATE_START"], CSite::GetDateFormat("FULL", SITE_ID)));
                     if ($SEND_TYPE == "U") {
                         self::NotifyImApprove($arEntry);
                     } else {
                         self::NotifyImNew($arEntry);
                     }
                 }
             }
         } else {
             if ($SEND_TYPE != 'U') {
                 $logID = CSocNetLog::Add($arSoFields, false);
                 if (intval($logID) > 0) {
                     CSocNetLog::Update($logID, array("TMP_ID" => $logID));
                     CSocNetLogRights::Add($logID, $arRights);
                     if ($arEntry["INACTIVE_OR_ACTIVATED"] == "Y" && IsModuleInstalled("im")) {
                         $arEntry["LOG_ID"] = $logID;
                         $arEntry["DATE_TEXT"] = FormatDate("j F", MakeTimeStamp($arEntry["DATE_START"], CSite::GetDateFormat("FULL", SITE_ID)));
                         self::NotifyImNew($arEntry);
                     }
                     $bSend = true;
                 }
             }
         }
         if ($bSend && intval($logID) > 0) {
             CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
         }
         return $logID;
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:59,代码来源:timeman_notify.php


示例18: getTimezones

 /**
  * Возвращает список часовых поясов
  * @return array
  */
 protected static function getTimezones()
 {
     if (self::$_timezones === null) {
         $timeZonesList = \CTimeZone::GetZones();
         unset($timeZonesList['']);
         self::$_timezones = $timeZonesList;
     }
     return self::$_timezones;
 }
开发者ID:marvin255,项目名称:bxlib,代码行数:13,代码来源:Timezone.php


示例19: Get

	public static function Get($userId, $reOpen = false)
	{
		global $DB;
		$nginxStatus = CPullOptions::GetNginxStatus();
		$webSocketStatus = CPullOptions::GetWebSocketStatus();

		CTimeZone::Disable();
		$strSql = "
				SELECT CHANNEL_ID, LAST_ID, ".$DB->DateToCharFunction('DATE_CREATE')." DATE_CREATE
				FROM b_pull_channel
				WHERE USER_ID = ".intval($userId);
		CTimeZone::Enable();

		$dbRes = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		if ($arRes = $dbRes->Fetch())
		{
			if (MakeTimeStamp($arRes['DATE_CREATE'])+43200 > time())
			{
				if ($nginxStatus && $reOpen)
				{
					$arData = Array(
						'module_id' => 'pull',
						'command' => 'reopen',
						'params' => Array(),
					);
					$channelId = $arRes['CHANNEL_ID'];
					$CHTTP = new CHTTP();
					$CHTTP->http_timeout = 10;
					$CHTTP->HTTPQuery('POST', CPullOptions::GetPublishUrl($channelId), CUtil::PhpToJsObject(Array('MESSAGE' => Array($arData), 'ERROR' => '')));
				}

				return Array(
					'CHANNEL_ID' => $arRes['CHANNEL_ID'],
					'CHANNEL_DT' => MakeTimeStamp($arRes['DATE_CREATE']),
					'LAST_ID' => intval($arRes['LAST_ID']),
					'PATH' => ($nginxStatus? CPullOptions::GetListenUrl($arRes['CHANNEL_ID']): '/bitrix/components/bitrix/pull.request/ajax.php'),
					'PATH_WS' => ($nginxStatus && $webSocketStatus? CPullOptions::GetWebSocketUrl($arRes['CHANNEL_ID']): ''),
					'METHOD' => ($nginxStatus? 'LONG': 'PULL'),
				);
			}
			else
			{
				self::Delete($arRes['CHANNEL_ID']);
			}
		}

		$channelId = self::Add($userId);
		return $channelId? Array(
			'CHANNEL_ID' => $channelId,
			'CHANNEL_DT' => time(),
			'LAST_ID' => 0,
			'PATH' => ($nginxStatus? CPullOptions::GetListenUrl($channelId): '/bitrix/components/bitrix/pull.request/ajax.php'),
			'PATH_WS' => ($nginxStatus && $webSoc 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CTitleBlock类代码示例发布时间:2022-05-20
下一篇:
PHP CTimeHelper类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap