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


PHP CBlog::CanUserCreateBlog方法代码示例

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


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

示例1: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
?>
<div class="body-blog">
<div class="blog-mainpage">
<?php 
$APPLICATION->IncludeComponent("bitrix:blog.menu", "", 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"], "BLOG_URL" => $arResult["VARIABLES"]["blog"], "SET_NAV_CHAIN" => $arResult["SET_NAV_CHAIN"], "GROUP_ID" => $arParams["GROUP_ID"]), $component);
?>
	<?php 
if ($USER->IsAuthorized() && CBlog::CanUserCreateBlog($USER->GetID())) {
    if (!CBlog::GetByOwnerID($USER->GetID(), $arParams["GROUP_ID"])) {
        ?>
		<div class="blog-mainpage-create-blog">
		<a href="<?php 
        echo $arResult["PATH_TO_NEW_BLOG"];
        ?>
" class="blog-author-icon"></a>&nbsp;<a href="<?php 
        echo $arResult["PATH_TO_NEW_BLOG"];
        ?>
"><?php 
        echo GetMessage("BLOG_CREATE_BLOG");
        ?>
</a>
		</div>
			<?php 
    }
}
?>
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:index.php

示例2: unset

     $arBlog = CBlog::GetByOwnerID($USER_ID, $arParams["GROUP_ID"]);
     if ($arBlog["ACTIVE"] == "Y") {
         $arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
         if (intval($arBlog["SOCNET_GROUP_ID"]) <= 0 && $arGroup["SITE_ID"] != SITE_ID) {
             unset($arBlog);
         }
     } else {
         unset($arBlog);
     }
 }
 if (!empty($arBlog)) {
     $arBlog = CBlogTools::htmlspecialcharsExArray($arBlog);
     $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"]));
     $arResult["BLOG"] = $arBlog;
 }
 if (CBlog::CanUserManageBlog($arBlog["ID"], IntVal($USER->GetID())) || CBlog::CanUserCreateBlog($USER->GetID()) && IntVal($arBlog["ID"]) <= 0) {
     $bBlockURL = COption::GetOptionString("blog", "block_url_change", "N") == 'Y' ? true : false;
     if ($bBlockURL && !$USER->IsAdmin() && !empty($arBlog)) {
         $arResult["BlockURL"] = "Y";
     }
     if ($_POST['reset']) {
         LocalRedirect($arResult["urlToBlog"]);
     } elseif ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST['do_blog'] == "Y" && check_bitrix_sessid()) {
         if ($_POST['perms_p'][1] > BLOG_PERMS_READ) {
             $_POST['perms_p'][1] = BLOG_PERMS_READ;
         }
         if ($_POST['perms_c'][1] > BLOG_PERMS_WRITE) {
             $_POST['perms_c'][1] = BLOG_PERMS_WRITE;
         }
         $arFields = array("NAME" => $_POST['NAME'], "DESCRIPTION" => $_POST['DESCRIPTION'], "=DATE_UPDATE" => $DB->CurrentTimeFunction(), "ENABLE_IMG_VERIF" => $_POST['ENABLE_IMG_VERIF'] == "Y" ? "Y" : "N", "EMAIL_NOTIFY" => $_POST['EMAIL_NOTIFY'] == "Y" ? "Y" : "N", "ENABLE_RSS" => "Y");
         if (IntVal($_POST['GROUP_ID']) > 0) {
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php


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