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


PHP CBlog::Update方法代码示例

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


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

示例1: array

$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("BLBE_TAB_BLOG"), "ICON" => "blog", "TITLE" => GetMessage("BLBE_TAB_BLOG_DESCR")), array("DIV" => "edit2", "TAB" => GetMessage("BLBE_TAB_BLOG_PERMS"), "ICON" => "blog", "TITLE" => GetMessage("BLBE_TAB_BLOG_PERMS_DESCR")));
$aTabs[] = $USER_FIELD_MANAGER->EditFormTab("BLOG_BLOG");
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$ID = IntVal($ID);
if ($REQUEST_METHOD == "POST" && strlen($Update) > 0 && $blogModulePermissions >= "W" && check_bitrix_sessid()) {
    $arFields = array("NAME" => $NAME, "DESCRIPTION" => $DESCRIPTION, "=DATE_UPDATE" => $DB->CurrentTimeFunction(), "URL" => $_POST["URL"], "OWNER_ID" => $OWNER_ID, "GROUP_ID" => $GROUP_ID, "ACTIVE" => $ACTIVE == "Y" ? "Y" : "N", "ENABLE_COMMENTS" => $ENABLE_COMMENTS == "Y" ? "Y" : "N", "ENABLE_IMG_VERIF" => $ENABLE_IMG_VERIF == "Y" ? "Y" : "N", "EMAIL_NOTIFY" => $EMAIL_NOTIFY == "Y" ? "Y" : "N", "ENABLE_RSS" => $ENABLE_RSS == "Y" ? "Y" : "N", "SEARCH_INDEX" => $SEARCH_INDEX == "Y" ? "Y" : "N", "USE_SOCNET" => $USE_SOCNET == "Y" ? "Y" : "N", "PERMS_POST" => $PERMS_P, "PERMS_COMMENT" => $PERMS_C);
    if (IntVal($OWNER_ID) > 0) {
        $arFields["OWNER_ID"] = IntVal($OWNER_ID);
    } else {
        $arFields["OWNER_ID"] = false;
    }
    $USER_FIELD_MANAGER->EditFormAddFields("BLOG_BLOG", $arFields);
    if ($ID > 0) {
        $dbBlog = CBlog::GetList(array(), array("ID" => $ID), false, false, array("ID", "GROUP_SITE_ID", "GROUP_ID"));
        $arBlogOld = $dbBlog->Fetch();
        $result = CBlog::Update($ID, $arFields);
    } else {
        $arFields["=DATE_CREATE"] = $DB->CurrentTimeFunction();
        $ID = CBlog::Add($arFields);
        $ID = IntVal($ID);
        $result = $ID > 0;
        $dbBlog = CBlog::GetList(array(), array("ID" => $ID), false, false, array("ID", "GROUP_SITE_ID", "GROUP_ID"));
        $arBlogOld = $dbBlog->Fetch();
    }
    if (CModule::IncludeModule("socialnetwork")) {
        if ($arFields["USE_SOCNET"] == "Y") {
            $bRights = false;
            $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $arFields["OWNER_ID"], "blog", "view_post");
            if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
                $bRights = true;
            }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:blog_edit.php

示例2: GetMessage

                         $autoGroup[] = $uGrID;
                     }
                 } else {
                     $arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_GROUP_EXIST", array("#GROUP_NAME#" => htmlspecialcharsbx($v)));
                 }
             }
         }
     }
     if (!empty($autoGroup)) {
         $arFields = array("AUTO_GROUPS" => serialize($autoGroup));
     } else {
         $arFields = array("AUTO_GROUPS" => "");
     }
     $arFields["PERMS_POST"] = $_POST['perms_p'];
     $arFields["PERMS_COMMENT"] = $_POST['perms_c'];
     $newID = CBlog::Update($newID, $arFields);
 }
 if (IntVal($newID) > 0 && empty($arResult["ERROR_MESSAGE"])) {
     $arBlog = CBlog::GetByID($newID);
     $arBlog = CBlogTools::htmlspecialcharsExArray($arBlog);
     $arResult["BLOG"] = $arBlog;
     $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"]));
     $arResult["urlToBlogEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_EDIT"], array("blog" => $arBlog["URL"]));
     if (intval($arBlog["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork") && method_exists("CSocNetGroup", "GetSite")) {
         $arSites = array();
         $rsGroupSite = CSocNetGroup::GetSite($arBlog["SOCNET_GROUP_ID"]);
         while ($arGroupSite = $rsGroupSite->Fetch()) {
             $arSites[] = $arGroupSite["LID"];
         }
     } else {
         $arSites = array(SITE_ID);
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例3: GetMessage

								if ($ex = $APPLICATION->GetException())
									$arResult["ERRORS"][] = $ex->GetString();
								else
									$arResult["ERRORS"][] = GetMessage("IBLOCK_CSC_BLOG_CREATE_ERROR");
							}
						}
					}
				}
			}
			if ($blogExist)
			{
				if ($arParams['BLOG_FROM_AJAX'] === 'N')
				{
					if ($blog['EMAIL_NOTIFY'] != $arParams['EMAIL_NOTIFY'])
					{
						CBlog::Update($blogID, array('EMAIL_NOTIFY' => $arParams['EMAIL_NOTIFY']));
					}
				}
			}

			if ($blogID > 0)
			{
				$arResult['BLOG_DATA']['BLOG_ID'] = $blogID;
				$rsProps = CIBlockProperty::GetList(
					array(),
					array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'PROPERTY_TYPE' => 'N', 'MULTIPLE' => 'N')
				);
				while ($propIBlock = $rsProps->Fetch())
				{
					if ($propIBlock['CODE'] == CIBlockPropertyTools::CODE_BLOG_POST)
					{
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:component.php

示例4: SetStat

 function SetStat($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     CTimeZone::Disable();
     $dbBlogPost = CBlogPost::GetList(array("DATE_PUBLISH" => "DESC"), array("BLOG_ID" => $ID, "<=DATE_PUBLISH" => ConvertTimeStamp(false, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH), false, array("nTopCount" => 1), array("ID", "DATE_PUBLISH"));
     CTimeZone::Enable();
     if ($arBlogPost = $dbBlogPost->Fetch()) {
         $arFields = array("LAST_POST_ID" => $arBlogPost["ID"], "LAST_POST_DATE" => $arBlogPost["DATE_PUBLISH"], "=DATE_UPDATE" => $DB->CurrentTimeFunction());
     } else {
         $arFields = array("LAST_POST_ID" => false, "LAST_POST_DATE" => false, "=DATE_UPDATE" => $DB->CurrentTimeFunction());
     }
     CBlog::Update($ID, $arFields);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:14,代码来源:blog.php


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