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


PHP CBlog::GetByUrl方法代码示例

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


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

示例1: PostIntoBuzzAsBlog

 public static function PostIntoBuzzAsBlog($userTwit, $arSiteId = array(), $userLogin = '')
 {
     global $DB;
     if (!CModule::IncludeModule("blog")) {
         return;
     }
     $arParams = array();
     if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME') && $userLogin != '') {
         if ($arUserTwit = unserialize(base64_decode($userTwit))) {
             $userTwit = $arUserTwit;
         }
         if ($arSiteIdCheck = unserialize(base64_decode($arSiteId))) {
             $arSiteId = $arSiteIdCheck;
         }
         $dbUser = CUser::GetByLogin($userLogin);
         if ($arUser = $dbUser->Fetch()) {
             $arParams["USER_ID"] = $arUser["ID"];
         }
     } else {
         $arParams["USER_ID"] = $userTwit['kp_user_id'];
     }
     if (isset($arSiteId[$userTwit['kp_user_id']])) {
         $siteId = $arSiteId[$userTwit['kp_user_id']];
     }
     if (strlen($siteId) <= 0) {
         $siteId = SITE_ID;
     }
     if (isset($userTwit['text'])) {
         $arParams["GROUP_ID"] = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, $siteId);
         $arParams["PATH_TO_BLOG"] = COption::GetOptionString("socialnetwork", "userblogpost_page", false, $siteId);
         $arParams["PATH_TO_SMILE"] = COption::GetOptionString("socialnetwork", "smile_page", false, $siteId);
         $arParams["NAME_TEMPLATE"] = COption::GetOptionString("main", "TOOLTIP_NAME_TEMPLATE", false, $siteId);
         $arParams["SHOW_LOGIN"] = 'Y';
         $arParams["PATH_TO_POST"] = $arParams["PATH_TO_BLOG"];
         $arFilterblg = array("ACTIVE" => "Y", "USE_SOCNET" => "Y", "GROUP_ID" => $arParams["GROUP_ID"], "GROUP_SITE_ID" => $siteId, "OWNER_ID" => $arParams["USER_ID"]);
         $groupId = is_array($arParams["GROUP_ID"]) ? IntVal($arParams["GROUP_ID"][0]) : IntVal($arParams["GROUP_ID"]);
         if (isset($GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]]) && !empty($GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]])) {
             $arBlog = $GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]];
         } else {
             $dbBl = CBlog::GetList(array(), $arFilterblg);
             $arBlog = $dbBl->Fetch();
             if (!$arBlog && IsModuleInstalled("intranet")) {
                 $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"]);
             }
             $GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]] = $arBlog;
         }
         $arResult["Blog"] = $arBlog;
         if (empty($arBlog)) {
             if (!empty($arParams["GROUP_ID"])) {
                 $arFields = array("=DATE_UPDATE" => $DB->CurrentTimeFunction(), "GROUP_ID" => is_array($arParams["GROUP_ID"]) ? IntVal($arParams["GROUP_ID"][0]) : IntVal($arParams["GROUP_ID"]), "ACTIVE" => "Y", "ENABLE_COMMENTS" => "Y", "ENABLE_IMG_VERIF" => "Y", "EMAIL_NOTIFY" => "Y", "ENABLE_RSS" => "Y", "ALLOW_HTML" => "N", "ENABLE_TRACKBACK" => "N", "SEARCH_INDEX" => "Y", "USE_SOCNET" => "Y", "=DATE_CREATE" => $DB->CurrentTimeFunction(), "PERMS_POST" => array(1 => "I", 2 => "I"), "PERMS_COMMENT" => array(1 => "P", 2 => "P"));
                 $bRights = false;
                 $rsUser = CUser::GetByID($arParams["USER_ID"]);
                 $arUser = $rsUser->Fetch();
                 if (strlen($arUser["NAME"] . "" . $arUser["LAST_NAME"]) <= 0) {
                     $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["LOGIN"];
                 } else {
                     $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["NAME"] . " " . $arUser["LAST_NAME"];
                 }
                 $arFields["URL"] = str_replace(" ", "_", $arUser["LOGIN"]) . "-blog-" . SITE_ID;
                 $arFields["OWNER_ID"] = $arParams["USER_ID"];
                 $urlCheck = preg_replace("/[^a-zA-Z0-9_-]/is", "", $arFields["URL"]);
                 if ($urlCheck != $arFields["URL"]) {
                     $arFields["URL"] = "u" . $arParams["USER_ID"] . "-blog-" . SITE_ID;
                 }
                 if (CBlog::GetByUrl($arFields["URL"])) {
                     $uind = 0;
                     do {
                         $uind++;
                         $arFields["URL"] = $arFields["URL"] . $uind;
                     } while (CBlog::GetByUrl($arFields["URL"]));
                 }
                 $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $arFields["OWNER_ID"], "blog", "view_post");
                 if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
                     $bRights = true;
                 }
                 $arFields["PATH"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arFields["URL"], "user_id" => $arFields["OWNER_ID"], "group_id" => $arFields["SOCNET_GROUP_ID"]));
                 $blogID = CBlog::Add($arFields);
                 if ($bRights) {
                     CBlog::AddSocnetRead($blogID);
                 }
                 $arBlog = CBlog::GetByID($blogID, $arParams["GROUP_ID"]);
             }
         }
         //	$DATE_PUBLISH = "";
         //	if(strlen($_POST["DATE_PUBLISH_DEF"]) > 0)
         //		$DATE_PUBLISH = $_POST["DATE_PUBLISH_DEF"];
         //	elseif (strlen($_POST["DATE_PUBLISH"])<=0)
         $DATE_PUBLISH = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
         //	else
         //		$DATE_PUBLISH = $_POST["DATE_PUBLISH"];
         $arFields = array("DETAIL_TEXT" => $userTwit['text'], "DETAIL_TEXT_TYPE" => "text", "DATE_PUBLISH" => $DATE_PUBLISH, "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "PATH" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => "#post_id#", "user_id" => $arBlog["OWNER_ID"])), "URL" => $arBlog["URL"], "SOURCE_TYPE" => "twitter");
         $arFields["PERMS_POST"] = array();
         $arFields["PERMS_COMMENT"] = array();
         $arFields["MICRO"] = "N";
         if (strlen($arFields["TITLE"]) <= 0) {
             $arFields["MICRO"] = "Y";
             $arFields["TITLE"] = trim(blogTextParser::killAllTags($arFields["DETAIL_TEXT"]));
             if (strlen($arFields["TITLE"]) <= 0) {
                 $arFields["TITLE"] = GetMessage("BLOG_EMPTY_TITLE_PLACEHOLDER");
             }
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:authmanager.php

示例2: strlen

}
$arParams["PATH_TO_SMILE"] = strlen(trim($arParams["PATH_TO_SMILE"])) <= 0 ? false : trim($arParams["PATH_TO_SMILE"]);
$arParams["IMAGE_MAX_WIDTH"] = IntVal($arParams["IMAGE_MAX_WIDTH"]);
$arParams["IMAGE_MAX_HEIGHT"] = IntVal($arParams["IMAGE_MAX_HEIGHT"]);
$arParams["ALLOW_POST_CODE"] = $arParams["ALLOW_POST_CODE"] !== "N";
/********************************************************************
				Default params
********************************************************************/
$cache = new CPHPCache();
$cache_id = "blog_blog_" . serialize(array($arParams["BLOG_URL"], $arParams["GROUP_ID"]));
$cache_path = "/" . SITE_ID . "/idea/";
if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
    $arResult["BLOG"] = $cache->GetVars();
}
if (empty($arResult["BLOG"])) {
    $arResult["BLOG"] = CBlog::GetByUrl($arParams["BLOG_URL"], $arParams["GROUP_ID"]);
    if ($arParams["CACHE_TIME"] > 0) {
        $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
        $cache->EndDataCache($arResult["BLOG"]);
    }
}
if (empty($arResult["BLOG"])) {
    ShowError(GetMessage("BLOG_BLOG_BLOG_NO_BLOG"));
    CHTTP::SetStatus("404 Not Found");
    return;
}
$arBlog = $arResult["BLOG"];
$tmpVal = COption::GetOptionInt("idea", "blog_group_id", false, SITE_ID);
if (intval($arBlog["GROUP_ID"]) > 0 && (!$tmpVal || $tmpVal != intval($arBlog["GROUP_ID"]))) {
    COption::SetOptionInt("idea", "blog_group_id", $arBlog["GROUP_ID"], false, SITE_ID);
}
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例3: ShowError

    ShowError(GetMessage("BLOG_MODULE_NOT_INSTALL"));
    return;
}
$arParams["BLOG_URL"] = preg_replace("/[^a-zA-Z0-9_-]/is", "", Trim($arParams["BLOG_URL"]));
if (!array_key_exists("PATH_TO_BLOG_CATEGORY", $arParams) || !is_string($arParams["PATH_TO_BLOG_CATEGORY"])) {
    $arParams["PATH_TO_BLOG_CATEGORY"] = "";
}
//0 no limit
$arParams["TAGS_COUNT"] = intval($arParams["TAGS_COUNT"]);
$obCache = new CPHPCache();
$cache_id = md5(serialize(array($arParams["BLOG_URL"], $arParams["TAGS_COUNT"], $arParams["PATH_TO_BLOG_CATEGORY"])));
$cache_path = '/' . SITE_ID . '/idea/tags/';
if (!$obCache->StartDataCache(60 * 60 * 24, $cache_id, $cache_path)) {
    $arResult = $obCache->GetVars();
} else {
    if (($arBlog = CBlog::GetByUrl($arParams["BLOG_URL"])) && $arBlog["ACTIVE"] == "Y" && ($arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"])) && $arGroup["SITE_ID"] == SITE_ID) {
        $arResult = array("BLOG" => $arBlog, "CATEGORY" => array());
        $toCnt = array();
        $res = CBlogCategory::GetList(array("NAME" => "ASC"), array("BLOG_ID" => $arBlog["ID"]));
        while ($arCategory = $res->GetNext()) {
            $arSumCat["C" . $arCategory["ID"]] = array("ID" => $arCategory["ID"], "NAME" => $arCategory["NAME"]);
            $toCnt[] = $arCategory['ID'];
        }
        $resCnt = CBlogPostCategory::GetList(array(), array("BLOG_ID" => $arBlog["ID"], "CATEGORY_ID" => $toCnt), array("CATEGORY_ID"), $arParams["TAGS_COUNT"] > 0 ? array("nTopCount" => $arParams["TAGS_COUNT"]) : false, array("ID", "BLOG_ID", "CATEGORY_ID", "NAME"));
        if (($arCategoryCount = $resCnt->Fetch()) && $arCategoryCount) {
            $cntMin = $cntMax = $arCategoryCount['CNT'];
            $arRes = array();
            do {
                $arRes["C" . $arCategoryCount["CATEGORY_ID"]] = array("CNT" => $arCategoryCount['CNT'], "URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_CATEGORY"], array("category_id" => $arCategoryCount["CATEGORY_ID"])));
                $cntMin = min($cntMin, $arCategoryCount['CNT']);
                $cntMax = max($cntMax, $arCategoryCount['CNT']);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例4: GetMessage

						<div class="sidebar-box new-comments">
							<b class="r1"></b>
							<div class="sidebar-box-header"><?php 
echo GetMessage("TMPL_NEW_COMMENTS");
?>
</div>
							<div class="sidebar-box-content">
								<?php 
$APPLICATION->IncludeComponent("bitrix:blog.new_comments", "personal", array("SEO_USER" => "N", "COMMENT_COUNT" => "4", "MESSAGE_LENGTH" => "80", "DATE_TIME_FORMAT" => GetMessage("DATE_FORMAT"), "PATH_TO_BLOG" => SITE_DIR, "PATH_TO_POST" => SITE_DIR . "#post_id#/", "PATH_TO_USER" => "", "PATH_TO_GROUP_BLOG_POST" => "", "PATH_TO_SMILE" => "/bitrix/images/blog/smile/", "BLOG_VAR" => "", "POST_VAR" => "", "USER_VAR" => "", "PAGE_VAR" => "", "CACHE_TYPE" => "A", "CACHE_TIME" => "36000000", "GROUP_ID" => "", "BLOG_URL" => "#BLOG_URL#"), false);
?>
							</div>
							<b class="r0"></b><b class="r1"></b><b class="r2"></b>
						</div>
						<?php 
if (IsModuleInstalled("search") && IsModuleInstalled("blog")) {
    $arBlog = CBlog::GetByUrl("#BLOG_URL#");
    if (!empty($arBlog)) {
        ?>
								<div class="sidebar-box tags-cloud">
									<b class="r1"></b>
									<div class="sidebar-box-header"><?php 
        echo GetMessage("TMPL_TAGS_CLOUD");
        ?>
</div>
									<div class="sidebar-box-content">
										<div class="search-cloud">
										<?php 
        $APPLICATION->IncludeComponent("bitrix:search.tags.cloud", ".default", array("SORT" => "NAME", "PAGE_ELEMENTS" => "30", "PERIOD" => "60", "URL_SEARCH" => SITE_DIR . "search.php", "TAGS_INHERIT" => "N", "CHECK_DATES" => "Y", "CACHE_TYPE" => "A", "CACHE_TIME" => "36000000", "FONT_MAX" => "40", "FONT_MIN" => "15", "COLOR_NEW" => "0082D4", "COLOR_OLD" => "0082D4", "PERIOD_NEW_TAGS" => "", "SHOW_CHAIN" => "N", "COLOR_TYPE" => "Y", "WIDTH" => "100%"), false);
        ?>
										</div>
									</div>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:footer.php

示例5: OnSearchReindex


//.........这里部分代码省略.........
                 $tag = "";
                 $arTag = array();
                 foreach ($arC as $v) {
                     $arCategory = CBlogCategory::GetByID($v);
                     $arTag[] = $arCategory["NAME"];
                 }
                 $tag = implode(",", $arTag);
             }
             //CBlogSearch::Trace('OnSearchReindex', 'arSite', $arSite);
             $Result = array("ID" => "P" . $ar["ID"], "LAST_MODIFIED" => $ar["DATE_PUBLISH"], "TITLE" => blogTextParser::killAllTags($ar["TITLE"]), "BODY" => blogTextParser::killAllTags($ar["DETAIL_TEXT"]), "SITE_ID" => $arSite, "PARAM1" => "POST", "PARAM2" => $ar["BLOG_ID"], "PERMISSIONS" => array(2), "TAGS" => $tag, "USER_ID" => $ar["AUTHOR_ID"], "ENTITY_TYPE_ID" => "BLOG_POST", "ENTITY_ID" => $ar["ID"]);
             if ($ar["USE_SOCNET"] == "Y" && CModule::IncludeModule("socialnetwork")) {
                 $arF = array();
                 if (COption::GetOptionString("blog", "socNetNewPerms", "N") == "N") {
                     if (IntVal($ar["SOCNET_GROUP_ID"]) > 0) {
                         $newBlogId = 0;
                         if (IntVal($arUser2Blog[$ar["AUTHOR_ID"]][$ar["GROUP_ID"]]) > 0) {
                             $newBlogId = IntVal($arUser2Blog[$ar["AUTHOR_ID"]][$ar["GROUP_ID"]]);
                         } else {
                             $arFields = array("=DATE_UPDATE" => $DB->CurrentTimeFunction(), "GROUP_ID" => $ar["GROUP_ID"], "ACTIVE" => "Y", "ENABLE_COMMENTS" => "Y", "ENABLE_IMG_VERIF" => "Y", "EMAIL_NOTIFY" => "Y", "ENABLE_RSS" => "Y", "ALLOW_HTML" => "N", "ENABLE_TRACKBACK" => "N", "SEARCH_INDEX" => "Y", "USE_SOCNET" => "Y", "=DATE_CREATE" => $DB->CurrentTimeFunction(), "PERMS_POST" => array(1 => "I", 2 => "I"), "PERMS_COMMENT" => array(1 => "P", 2 => "P"));
                             $bRights = false;
                             $rsUser = CUser::GetByID($ar["AUTHOR_ID"]);
                             $arUser = $rsUser->Fetch();
                             if (strlen($arUser["NAME"] . "" . $arUser["LAST_NAME"]) <= 0) {
                                 $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["LOGIN"];
                             } else {
                                 $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["NAME"] . " " . $arUser["LAST_NAME"];
                             }
                             $arFields["URL"] = str_replace(" ", "_", $arUser["LOGIN"]) . "-blog-" . $ar["SITE_ID"];
                             $arFields["OWNER_ID"] = $ar["AUTHOR_ID"];
                             $urlCheck = preg_replace("/[^a-zA-Z0-9_-]/is", "", $arFields["URL"]);
                             if ($urlCheck != $arFields["URL"]) {
                                 $arFields["URL"] = "u" . $arUser["ID"] . "-blog-" . $ar["SITE_ID"];
                             }
                             if (CBlog::GetByUrl($arFields["URL"])) {
                                 $uind = 0;
                                 do {
                                     $uind++;
                                     $arFields["URL"] = $arFields["URL"] . $uind;
                                 } while (CBlog::GetByUrl($arFields["URL"]));
                             }
                             $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $ar["AUTHOR_ID"], "blog", "view_post");
                             if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
                                 $bRights = true;
                             }
                             $blogID = CBlog::Add($arFields);
                             if ($bRights) {
                                 CBlog::AddSocnetRead($blogID);
                             }
                             $newBlogId = $blogID;
                             $arUser2Blog[$arFields["OWNER_ID"]][$arFields["GROUP_ID"]] = $newBlogId;
                         }
                         if (intVal($newBlogId) > 0) {
                             $arF = array("BLOG_ID" => $newBlogId, "SOCNET_RIGHTS" => array("SG" . $ar["SOCNET_GROUP_ID"]));
                         }
                         if (IntVal($ar["SLID"]) > 0) {
                             CSocNetLog::Delete($ar["SLID"]);
                             $ar["SLID"] = 0;
                         }
                         $arSites = array();
                         $rsGroupSite = CSocNetGroup::GetSite($ar["SOCNET_GROUP_ID"]);
                         while ($arGroupSite = $rsGroupSite->Fetch()) {
                             $arSites[] = $arGroupSite["LID"];
                         }
                     } else {
                         $newBlogId = 0;
                         if ($ar["OWNER_ID"] != $ar["AUTHOR_ID"]) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:67,代码来源:blog_search.php

示例6: array

$db_blog_group = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => WIZARD_SITE_ID, "NAME" => GetMessage("BLOG_DEMO_GROUP") . " (" . WIZARD_SITE_ID . ")"));
if ($res_blog_group = $db_blog_group->Fetch()) {
    if (WIZARD_INSTALL_DEMO_DATA) {
        $db_blog = CBlog::GetList(array(), array("GROUP_ID" => $res_blog_group["ID"]), false, false, array("ID"));
        if ($res_blog = $db_blog->Fetch()) {
            do {
                CBlog::Delete($res_blog["ID"]);
            } while ($res_blog = $db_blog->Fetch());
        }
        $SocNetGroupID = $res_blog_group["ID"];
    } else {
        if ($arBlog = CBlog::GetByUrl("admin-blog-" . WIZARD_SITE_ID)) {
            CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . WIZARD_TEMPLATE_ID . "_" . WIZARD_THEME_ID . "/footer.php", array("BLOG_URL" => $arBlog["URL"]));
            CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/_index.php", array("BLOG_URL" => $arBlog["URL"], "SEF_FOLDER" => WIZARD_SITE_DIR));
        }
        if ($arUtilBlog = CBlog::GetByUrl("util-photo-blog-" . WIZARD_SITE_ID)) {
            CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/photo.php", array("PHOTO_BLOG_URL" => $arUtilBlog["URL"]));
        }
        return;
    }
}
$utilGroupID = false;
$db_blog_group = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => WIZARD_SITE_ID, "NAME" => GetMessage("BLOG_DEMO_GROUP_UTIL") . " (" . WIZARD_SITE_ID . ")"));
if ($res_blog_group = $db_blog_group->Fetch()) {
    if (WIZARD_INSTALL_DEMO_DATA) {
        $db_blog = CBlog::GetList(array(), array("GROUP_ID" => $res_blog_group["ID"]), false, false, array("ID"));
        if ($res_blog = $db_blog->Fetch()) {
            do {
                CBlog::Delete($res_blog["ID"]);
            } while ($res_blog = $db_blog->Fetch());
        }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:index.php

示例7: array

		<?php 
$APPLICATION->IncludeComponent("bitrix:blog.menu", "settings", array("BLOG_VAR" => $arResult["ALIASES"]["blog"], "POST_VAR" => $arResult["ALIASES"]["post_id"], "USER_VAR" => $arResult["ALIASES"]["user_id"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "PATH_TO_BLOG" => $arResult["PATH_TO_BLOG"], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_BLOG_EDIT" => $arResult["PATH_TO_BLOG_EDIT"], "PATH_TO_BLOG_INDEX" => $arResult["PATH_TO_BLOG_INDEX"], "PATH_TO_DRAFT" => $arResult["PATH_TO_DRAFT"], "PATH_TO_POST_EDIT" => $arResult["PATH_TO_POST_EDIT"], "PATH_TO_USER_FRIENDS" => $arResult["PATH_TO_USER_FRIENDS"], "PATH_TO_USER_SETTINGS" => $arResult["PATH_TO_USER_SETTINGS"], "PATH_TO_GROUP_EDIT" => $arResult["PATH_TO_GROUP_EDIT"], "PATH_TO_CATEGORY_EDIT" => $arResult["PATH_TO_CATEGORY_EDIT"], "PATH_TO_RSS_ALL" => $arResult["PATH_TO_RSS_ALL"], "PATH_TO_MODERATION" => $arResult["PATH_TO_MODERATION"], "BLOG_URL" => $arResult["VARIABLES"]["blog"], "SET_NAV_CHAIN" => $arResult["SET_NAV_CHAIN"], "GROUP_ID" => $arParams["GROUP_ID"]), $component);
?>
		<?php 
$APPLICATION->IncludeComponent("bitrix:blog.info", ".default", array("BLOG_VAR" => $arResult["ALIASES"]["blog"], "USER_VAR" => $arResult["ALIASES"]["user_id"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "PATH_TO_BLOG" => $arResult["PATH_TO_BLOG"], "PATH_TO_POST" => $arResult["PATH_TO_POST"], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_BLOG_CATEGORY" => $arResult["PATH_TO_BLOG_CATEGORY"], "BLOG_URL" => $arResult["VARIABLES"]["blog"], "CATEGORY_ID" => $arResult["VARIABLES"]["category"], "CACHE_TYPE" => $arResult["CACHE_TYPE"], "CACHE_TIME" => $arResult["CACHE_TIME"], "BLOG_PROPERTY_LIST" => $arParams["BLOG_PROPERTY_LIST"], "GROUP_ID" => $arParams["GROUP_ID"]), $component);
?>
	</div>
	<div class="blog-sidebar-calendar">
		<?php 
$APPLICATION->IncludeComponent("bitrix:blog.calendar", "", array("BLOG_VAR" => $arResult["ALIASES"]["blog"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "PATH_TO_BLOG" => $arResult["PATH_TO_BLOG"], "BLOG_URL" => $arResult["VARIABLES"]["blog"], "YEAR" => $arResult["VARIABLES"]["year"], "MONTH" => $arResult["VARIABLES"]["month"], "DAY" => $arResult["VARIABLES"]["day"], "CACHE_TYPE" => $arResult["CACHE_TYPE"], "CACHE_TIME" => $arResult["CACHE_TIME"], "GROUP_ID" => $arParams["GROUP_ID"]), $component);
?>
	</div>
	<div class="br"></div>
		<?php 
if (IsModuleInstalled("search")) {
    $arBlog = CBlog::GetByUrl($arResult["VARIABLES"]["blog"], $arParams["GROUP_ID"]);
    if (!empty($arBlog)) {
        ?>
				<ul>
					<li class="blog-tags-cloud">
						<h3 class="blog-sidebar-title"><?php 
        echo GetMessage("BC_SEARCH_TAG");
        ?>
</h3>
						<div align="center">
						<?php 
        $APPLICATION->IncludeComponent("bitrix:search.tags.cloud", "", array("FONT_MAX" => 18, "FONT_MIN" => 12, "COLOR_NEW" => $arParams["COLOR_NEW"], "COLOR_OLD" => $arParams["COLOR_OLD"], "ANGULARITY" => $arParams["ANGULARITY"], "PERIOD_NEW_TAGS" => $arParams["PERIOD_NEW_TAGS"], "SHOW_CHAIN" => "N", "COLOR_TYPE" => $arParams["COLOR_TYPE"], "WIDTH" => $arParams["WIDTH"], "SEARCH" => "", "TAGS" => "", "SORT" => "NAME", "PAGE_ELEMENTS" => "30", "PERIOD" => $arParams["PERIOD"], "URL_SEARCH" => $arResult["PATH_TO_SEARCH"], "TAGS_INHERIT" => "N", "CHECK_DATES" => "Y", "arrFILTER" => array("blog"), "arrFILTER_blog" => array($arBlog["ID"]), "CACHE_TYPE" => "A", "CACHE_TIME" => "3600"));
        ?>
						</div>
					</li>
				</ul>
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:draft.php

示例8: ShowError

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("blog")) {
    ShowError(GetMessage("BLOG_MODULE_NOT_INSTALL"));
    return;
}
if (!CModule::IncludeModule("idea")) {
    ShowError(GetMessage("IDEA_MODULE_NOT_INSTALL"));
    return;
}
$arBlog = CBlog::GetByUrl($arParams["IDEA_URL"]);
$cache = new CPHPCache();
$cache_id = "idea_rss_out_" . serialize($arParams);
$cache_path = "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/rss_list/";
$arParams["RSS_CNT"] = intval($arParams["RSS_CNT"]);
if ($arParams["RSS_CNT"] == 0) {
    $arParams["RSS_CNT"] = 10;
}
if (!is_array($arParams["FILTER"])) {
    $arParams["FILTER"] = array();
}
$arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]);
$arTemplateParams = array("CUSTOM_TITLE" => $arParams["~CUSTOM_TITLE"], "PATH_TO_POST" => $arParams["PATH_TO_POST"], "IMAGE_MAX_WIDTH" => $arParams["IMAGE_MAX_WIDTH"], "IMAGE_MAX_HEIGHT" => $arParams["IMAGE_MAX_HEIGHT"], "USER" => $arParams["USER"], "INDEX" => $arParams["INDEX"]);
$APPLICATION->RestartBuffer();
header("Content-Type: text/xml");
header("Pragma: no-cache");
if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
    $cache->Output();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例9: strLen

     $res = $obProperty->Add(array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "ACTIVE" => "Y", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N", "NAME" => strLen(GetMessage("IBLOCK_CSC_BLOG_POST_ID")) <= 0 ? "IBLOCK_CSC_BLOG_POST_ID" : GetMessage("IBLOCK_CSC_BLOG_POST_ID"), "CODE" => "BLOG_POST_ID"));
 }
 if (!is_set($arResult["ELEMENT"], "PROPERTY_BLOG_COMMENTS_CNT_VALUE")) {
     $res = $obProperty->Add(array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "ACTIVE" => "Y", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N", "NAME" => strLen(GetMessage("IBLOCK_CSC_BLOG_COMMENTS_CNT")) <= 0 ? "IBLOCK_CSC_BLOG_COMMENTS_CNT" : GetMessage("IBLOCK_CSC_BLOG_COMMENTS_CNT"), "CODE" => "BLOG_COMMENTS_CNT"));
 }
 if ($iCommentID > 0) {
     $arPost = CBlogPost::GetByID($iCommentID);
     if (!$arPost) {
         $iCommentID = 0;
     } elseif (intVal($arPost["NUM_COMMENTS"]) > 0 && $arPost["NUM_COMMENTS"] != $arResult["ELEMENT"]["PROPERTIES"]["BLOG_COMMENTS_CNT"]["VALUE"]) {
         CIBlockElement::SetPropertyValues($arParams["ELEMENT_ID"], $arParams["IBLOCK_ID"], intVal($arPost["NUM_COMMENTS"]), "BLOG_COMMENTS_CNT");
     }
 }
 if (!$iCommentID && isset($_REQUEST["parentId"])) {
     $arCategory = array();
     $arBlog = CBlog::GetByUrl($arResult["BLOG_URL"]);
     if (!empty($arResult["ELEMENT"]["TAGS"])) {
         $arCategoryVal = explode(",", $arResult["ELEMENT"]["TAGS"]);
         foreach ($arCategoryVal as $k => $v) {
             if ($id = CBlogCategory::Add(array("BLOG_ID" => $arBlog["ID"], "NAME" => $v))) {
                 $arCategory[] = $id;
             }
         }
     }
     $ownerID = 1;
     if (!empty($arResult["ELEMENT"]["CREATED_BY"])) {
         $userSort = 'ID';
         $userOrder = 'ASC';
         $rsUsers = CUser::GetList($userSort, $userOrder, array('ID_EQUAL_EXACT' => intval($arResult["ELEMENT"]["CREATED_BY"])), array("FIELDS" => array("ID")));
         if ($owner = $rsUsers->Fetch()) {
             $ownerID = $owner['ID'];
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:component.php

示例10: IntVal

$arParams["IMAGE_MAX_WIDTH"] = IntVal($arParams["IMAGE_MAX_WIDTH"]);
$arParams["IMAGE_MAX_HEIGHT"] = IntVal($arParams["IMAGE_MAX_HEIGHT"]);
$arParams["ALLOW_POST_CODE"] = $arParams["ALLOW_POST_CODE"] !== "N";
$arParams["SMILES_COUNT"] = IntVal($arParams["SMILES_COUNT"]);
$user_id = $USER->GetID();
$arResult["USER_ID"] = $user_id;
//Get Idea subscribtion
$arResult["USER_IDEA_SUBSCRIBE"] = array();
if ($arResult["USER_ID"] > 0) {
    $oIdeaSubscribe = CIdeaManagment::getInstance()->Notification()->getEmailNotify()->GetList(array(), array("USER_ID" => $arResult["USER_ID"]), false, false, array("ID"));
    while ($r = $oIdeaSubscribe->Fetch()) {
        $arResult["USER_IDEA_SUBSCRIBE"][] = $r["ID"];
    }
}
//END -> Get Idea subscribtion
$arBlog = CBlogTools::htmlspecialcharsExArray(CBlog::GetByUrl($arParams["BLOG_URL"]));
$arResult["BLOG"] = $arBlog;
$arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
if (!empty($arBlog) && $arBlog["ACTIVE"] == "Y" && $arGroup["SITE_ID"] == SITE_ID) {
    if ($bIDbyCode) {
        $arParams["ID"] = CBlogPost::GetID($arParams["ID"], $arBlog["ID"]);
    }
    $arPost = CBlogPost::GetByID($arParams["ID"]);
    if (empty($arPost) && !$bIDbyCode) {
        $arParams["ID"] = CBlogPost::GetID($arParams["ID"], $arBlog["ID"]);
        $arPost = CBlogPost::GetByID($arParams["ID"]);
    }
    if (!($arPost && ($arPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH || $arResult["IDEA_MODERATOR"] && in_array($arPost["PUBLISH_STATUS"], array(BLOG_PUBLISH_STATUS_PUBLISH, BLOG_PUBLISH_STATUS_READY))))) {
        unset($arPost);
    }
    if (!empty($arPost) && $arBlog["ID"] == $arPost["BLOG_ID"]) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例11: GetMessage

                 $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["LOGIN"];
             } else {
                 $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["NAME"] . " " . $arUser["LAST_NAME"];
             }
             $arFields["URL"] = str_replace(" ", "_", $arUser["LOGIN"]) . "-blog-" . SITE_ID;
             $arFields["OWNER_ID"] = $arParams["USER_ID"];
             $urlCheck = preg_replace("/[^a-zA-Z0-9_-]/is", "", $arFields["URL"]);
             if ($urlCheck != $arFields["URL"]) {
                 $arFields["URL"] = "u" . $arParams["USER_ID"] . "-blog-" . SITE_ID;
             }
             if (CBlog::GetByUrl($arFields["URL"])) {
                 $uind = 0;
                 do {
                     $uind++;
                     $arFields["URL"] = $arFields["URL"] . $uind;
                 } while (CBlog::GetByUrl($arFields["URL"]));
             }
             $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $arFields["OWNER_ID"], "blog", "view_post");
             if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
                 $bRights = true;
             }
             $arFields["PATH"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arFields["URL"], "user_id" => $arFields["OWNER_ID"], "group_id" => $arFields["SOCNET_GROUP_ID"]));
             $blogID = CBlog::Add($arFields);
             BXClearCache(true, "/blog/form/blog/");
             if ($bRights) {
                 CBlog::AddSocnetRead($blogID);
             }
             $arBlog = CBlog::GetByID($blogID, $arParams["GROUP_ID"]);
         }
     }
 } else {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例12: intVal

            if ($res["NAME"] == GetMessage("P_FORUM_NAME")) {
                $FID = intVal($res["ID"]);
                break;
            }
        } while ($res = $db_res->Fetch());
    }
    if ($FID <= 0) {
        $arFields = array("NAME" => GetMessage("P_FORUM_NAME"), "DESCRIPTION" => GetMessage("P_FORUM_DECRIPTION"), "SORT" => 100, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "N", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "N", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $iGroupId, "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "Y", "SITES" => array($SITE_ID => "/communication/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", "4" => "A", "5" => "A", "11" => "A", "15" => "A", "16" => "A", "17" => "A", "18" => "A", "19" => "Q", "20" => "A"));
        $FID = CForumNew::Add($arFields);
    }
    if (intVal($FID) > 0) {
        $arParams = array("USE_COMMENTS" => "Y", "COMMENTS_TYPE" => "forum", "FORUM_ID" => $FID, "BLOG_URL" => "", "PATH_TO_SMILE" => "/bitrix/images/forum/smile/");
    }
} elseif (CModule::IncludeModule("blog")) {
    $iBlogId = "";
    $res = CBlog::GetByUrl("gallery");
    if ($res && !empty($res) && is_array($res)) {
        $iBlogId = intVal($res["ID"]);
    } else {
        $iBlogGroupId = 0;
        $arFields = array("NAME" => GetMessage("P_BLOG_GROUP_NAME"));
        $db_res = CBlogGroup::GetList(array(), $arFields, false, false, array("ID"));
        if ($db_res && ($res = $db_res->Fetch())) {
            $iBlogGroupId = intVal($res["ID"]);
        } else {
            $arFields["SITE_ID"] = $SITE_ID;
            $iBlogGroupId = CBlogGroup::Add($arFields);
        }
        if ($iBlogGroupId > 0) {
            $arFields = array("ACTIVE" => "N", "NAME" => GetMessage("P_BLOG_NAME"), "DESCRIPTION" => GetMessage("P_BLOG_DESCRIPTION"), "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "URL" => "gallery", "OWNER_ID" => $GLOBALS["USER"]->GetId(), "GROUP_ID" => $iBlogGroupId);
            $iBlogId = CBlog::Add($arFields);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:index.php

示例13: createBlog

 private function createBlog($userId, $blogGroupId, $siteId)
 {
     global $DB;
     $arFields = array("=DATE_UPDATE" => $DB->CurrentTimeFunction(), "GROUP_ID" => $blogGroupId, "ACTIVE" => "Y", "ENABLE_COMMENTS" => "Y", "ENABLE_IMG_VERIF" => "Y", "EMAIL_NOTIFY" => "Y", "ENABLE_RSS" => "Y", "ALLOW_HTML" => "N", "ENABLE_TRACKBACK" => "N", "SEARCH_INDEX" => "Y", "USE_SOCNET" => "Y", "=DATE_CREATE" => $DB->CurrentTimeFunction(), "PERMS_POST" => array(1 => "I", 2 => "I"), "PERMS_COMMENT" => array(1 => "P", 2 => "P"));
     $bRights = false;
     $rsUser = CUser::GetByID($userId);
     $arUser = $rsUser->Fetch();
     if (strlen($arUser["NAME"] . "" . $arUser["LAST_NAME"]) <= 0) {
         $arFields["NAME"] = GetMessage("SNBPA_BLOG_NAME") . " " . $arUser["LOGIN"];
     } else {
         $arFields["NAME"] = GetMessage("SNBPA_BLOG_NAME") . " " . $arUser["NAME"] . " " . $arUser["LAST_NAME"];
     }
     $arFields["URL"] = str_replace(" ", "_", $arUser["LOGIN"]) . "-blog-" . $siteId;
     $arFields["OWNER_ID"] = $userId;
     $urlCheck = preg_replace("/[^a-zA-Z0-9_-]/is", "", $arFields["URL"]);
     if ($urlCheck != $arFields["URL"]) {
         $arFields["URL"] = "u" . $userId . "-blog-" . $siteId;
     }
     if (CBlog::GetByUrl($arFields["URL"])) {
         $uind = 0;
         do {
             $uind++;
             $arFields["URL"] = $arFields["URL"] . $uind;
         } while (CBlog::GetByUrl($arFields["URL"]));
     }
     $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $arFields["OWNER_ID"], "blog", "view_post");
     if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
         $bRights = true;
     }
     $blogID = CBlog::Add($arFields);
     BXClearCache(true, "/blog/form/blog/");
     if ($bRights) {
         CBlog::AddSocnetRead($blogID);
     }
     return CBlog::GetByID($blogID, $blogGroupId);
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:36,代码来源:socnetblogpostactivity.php

示例14: IsModuleInstalled

													"POST_VAR" => "",
													"USER_VAR" => "",
													"PAGE_VAR" => "",
													"CACHE_TYPE" => "A",
													"CACHE_TIME" => "36000000",
													"GROUP_ID" => "",
													"BLOG_URL" => "admin-blog-s1"
												),
												false
											);?>
										</div>
										<b class="r0"></b><b class="r1"></b><b class="r2"></b>
									</div>
									<?if(IsModuleInstalled("search") && IsModuleInstalled("blog"))
									{
										$arBlog = CBlog::GetByUrl("admin-blog-s1");
										if(!empty($arBlog))
										{
											?>
											<div class="sidebar-box tags-cloud">
												<div class="sidebar-box-header"><?php 
echo GetMessage("TMPL_TAGS_CLOUD");
?>
</div>
												<div class="sidebar-box-content">
													<div class="search-cloud">
													<?
													$APPLICATION->IncludeComponent("bitrix:search.tags.cloud", ".default", array(
														"SORT" => "NAME",
														"PAGE_ELEMENTS" => "30",
														"PERIOD" => "60",
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:footer.php

示例15: array

                $arResult["OwnBlog"] = $arOwnBlog;
                $arResult["urlToOwnBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnBlog["URL"]));
                $arResult["urlToFriends"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FRIENDS"], array("user_id" => $user_id));
                $arResult["urlToOwnNewPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("blog" => $arOwnBlog["URL"], "post_id" => "new"));
                $arResult["urlToOwnBlogEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_EDIT"], array("blog" => $arOwnBlog["URL"]));
            }
        } else {
            unset($arOwnBlog);
        }
    } else {
        unset($arOwnBlog);
    }
}
if (strlen($arParams["BLOG_URL"]) > 0) {
    if ($arOwnBlog["URL"] != $arParams["BLOG_URL"]) {
        $arBlog = CBlog::GetByUrl($arParams["BLOG_URL"], $arParams["GROUP_ID"]);
        if ($arBlog["ACTIVE"] == "Y") {
            $arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
            if ($arGroup["SITE_ID"] == SITE_ID) {
                $arResult["Blog"] = $arBlog;
                $arResult["urlToCurrentBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arParams["BLOG_URL"]));
            } else {
                unset($arBlog);
            }
        } else {
            unset($arBlog);
        }
    } elseif (!empty($arOwnBlog)) {
        $arBlog = $arOwnBlog;
    }
    if (!empty($arBlog)) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


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