本文整理汇总了PHP中CBlog::CanUserManageBlog方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlog::CanUserManageBlog方法的具体用法?PHP CBlog::CanUserManageBlog怎么用?PHP CBlog::CanUserManageBlog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlog
的用法示例。
在下文中一共展示了CBlog::CanUserManageBlog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arResult["urlToModeration"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODERATION"], array("blog" => $arBlog["URL"]));
$dbPost = CBlogPost::GetList(array(), array("BLOG_ID" => $arBlog["ID"], "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_READY), array("COUNT" => "ID"), false, array("ID", "BLOG_ID"));
if ($arPost = $dbPost->Fetch()) {
$arResult["CntToModerate"] = $arPost["ID"];
}
}
$dbPost = CBlogPost::GetList(array(), array("BLOG_ID" => $arBlog["ID"], "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_DRAFT, "AUTHOR_ID" => $user_id), array("COUNT" => "ID"), false, array("ID", "BLOG_ID"));
if ($arPost = $dbPost->Fetch()) {
$arResult["CntToDraft"] = $arPost["ID"];
}
$arResult["SecondLine"] = "Y";
} elseif ($perm >= BLOG_PERMS_PREMODERATE) {
$arResult["urlToNewPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("blog" => $arBlog["URL"], "post_id" => "new"));
$arResult["SecondLine"] = "Y";
}
if (CBlog::CanUserManageBlog($arBlog["ID"], $user_id)) {
$arResult["urlToUserSettings"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS"], array("blog" => $arBlog["URL"]));
$arResult["urlToGroupEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_EDIT"], array("blog" => $arBlog["URL"]));
$arResult["urlToCategoryEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_CATEGORY_EDIT"], array("blog" => $arBlog["URL"]));
$arResult["urlToBlogEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_EDIT"], array("blog" => $arBlog["URL"]));
$arResult["ThirdLine"] = "Y";
}
}
if (empty($arOwnBlog) || $arOwnBlog["URL"] != $arBlog["URL"]) {
if (IntVal($user_id) > 0) {
if (!CBlog::IsFriend($arBlog["ID"], $user_id)) {
$arResult["urlToBecomeFriend"] = $arResult["urlToCurrentBlog"] . (strpos($arResult["urlToCurrentBlog"], "?") === false ? "?" : "&") . "become_friend=Y&" . bitrix_sessid_get();
$arResult["SecondLine"] = "Y";
}
if (!empty($arOwnBlog)) {
if (!CBlog::IsFriend($arOwnBlog["ID"], $arBlog["OWNER_ID"])) {
示例2: preg_replace
}
$arParams["BLOG_URL"] = preg_replace("/[^a-zA-Z0-9_-]/is", "", Trim($arParams["BLOG_URL"]));
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle(GetMessage("BLOG_CATEGORY_TITLE"));
}
$USER_ID = intval($USER->GetID());
$arResult["CATEGORY"] = array();
if ($arBlog = CBlog::GetByUrl($arParams["BLOG_URL"])) {
if ($arBlog["ACTIVE"] == "Y") {
$arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
if ($arGroup["SITE_ID"] == SITE_ID) {
$arResult["BLOG"] = $arBlog;
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle(GetMessage("BLOG_CATEGORY_TITLE") . "\"" . $arBlog["NAME"] . "\"");
}
if (CBlog::CanUserManageBlog($arBlog["ID"], $USER_ID)) {
if ($_POST["save"] && check_bitrix_sessid()) {
$arFields = array('NAME' => $_POST["NAME"]);
if (IntVal($_POST['ID']) > 0) {
$res = CBlogCategory::GetList(array("NAME" => "ASC"), array("BLOG_ID" => $arBlog["ID"], "ID" => IntVal($_POST["ID"])));
if ($res->Fetch()) {
if ($_POST["category_del"] == "Y") {
CBlogCategory::Delete(IntVal($_POST['ID']));
} else {
$res = CBlogCategory::GetList(array("NAME" => "ASC"), array("BLOG_ID" => $arBlog["ID"], "NAME" => $arFields["NAME"]));
if (!$res->Fetch()) {
$newID = CBlogCategory::Update(IntVal($_POST["ID"]), $arFields);
} else {
$arResult["ERROR_MESSAGE"] = GetMessage("BLOG_CATEGORY_EXIST_1") . " \"" . htmlspecialcharsEx($arFields["NAME"]) . "\" " . GetMessage("BLOG_CATEGORY_EXIST_2");
}
}
示例3: 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) {