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


PHP CBlogComment::GetSocNetUserPerms方法代码示例

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


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

示例1: strlen

        if ($arResult["PostPerm"] > BLOG_PERMS_DENY) {
            $arResult["Perm"] = CBlogComment::GetSocNetUserPerms($arParams["ID"], $arPost["AUTHOR_ID"]);
        }
    }
    $arResult["is_ajax_post"] = "Y";
} else {
    $arResult["PostPerm"] = strlen($arParams["POST_DATA"]["perms"]) <= 0 ? CBlogPost::GetSocNetPostPerms($arParams["ID"]) : $arParams["POST_DATA"]["perms"];
    if ($arResult["PostPerm"] > BLOG_PERMS_DENY) {
        if ($bIntranetInstalled && IsModuleInstalled("bitrix24") && $arParams["POST_DATA"]["HAVE_ALL_IN_ADR"] == "Y") {
            if ($arPost["AUTHOR_ID"] != $user_id) {
                $arResult["Perm"] = BLOG_PERMS_WRITE;
            } else {
                $arResult["Perm"] = BLOG_PERMS_FULL;
            }
        } else {
            $arResult["Perm"] = CBlogComment::GetSocNetUserPerms($arParams["ID"], $arPost["AUTHOR_ID"]);
        }
    }
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['mfi_mode']) && $_REQUEST['mfi_mode'] == "upload") {
    CBlogImage::AddImageResizeHandler(array("width" => 400, "height" => 400));
}
if (!empty($arPost) && $arPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH && $arPost["ENABLE_COMMENTS"] == "Y") {
    //Comment delete
    if (IntVal($_GET["delete_comment_id"]) > 0) {
        if ($_GET["success"] == "Y") {
            $arResult["MESSAGE"] = GetMessage("B_B_PC_MES_DELED");
        } else {
            $arComment = CBlogComment::GetByID(IntVal($_GET["delete_comment_id"]));
            if (($arResult["Perm"] >= BLOG_PERMS_MODERATE || IntVal($user_id) > 0 && $arComment["AUTHOR_ID"] == $user_id) && !empty($arComment)) {
                if (check_bitrix_sessid()) {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例2: BuildRSS


//.........这里部分代码省略.........
					}
					elseif ($type == "atom.03")
					{
						$atomID = "tag:".htmlspecialcharsbx($serverName).",".date("Y-m-d").":".$postID;

						$rssText .= "<"."?xml version=\"1.0\" encoding=\"".$charset."\"?".">\n\n";
						$rssText .= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\" xml:lang=\"".$language."\">\n";
						$rssText .= "  <title>".$blogName."</title>\n";
						$rssText .= "  <tagline>".$url."</tagline>\n";
						$rssText .= "  <id>".$atomID."</id>\n";
						$rssText .= "  <link rel=\"alternate\" type=\"text/html\" href=\"".$url."\" />\n";
						$rssText .= "  <modified>".$nowISO."</modified>\n";

						$BlogUser = CBlogUser::GetByID($arPost["AUTHOR_ID"], BLOG_BY_USER_ID);
						$authorP = htmlspecialcharsex(CBlogUser::GetUserName($BlogUser["ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"], $arUser["SECOND_NAME"]));
						if(strLen($arPathTemplate["PATH_TO_USER"])>0)
							$authorURLP = htmlspecialcharsbx("http://".$serverName.CComponentEngine::MakePathFromTemplate($arPathTemplate["PATH_TO_USER"], array("user_id"=>$arPost["AUTHOR_ID"])));
						else
							$authorURLP = "http://".$serverName.CBlogUser::PreparePath($arPost["AUTHOR_ID"], $arGroup["SITE_ID"]);

						$rssText .= "  <author>\n";
						$rssText .= "  		<name>".$authorP."</name>\n";
						$rssText .= "  		<uri>".$authorURLP."</uri>\n";
						$rssText .= "  </author>\n";

						$rssText .= "\n";
					}

					$user_id = $GLOBALS["USER"]->GetID();
					if($arPathTemplate["USE_SOCNET"] == "Y")
					{
						$postPerm = CBlogPost::GetSocNetPostPerms($postID);
						if($postPerm > BLOG_PERMS_DENY)
							$postPerm = CBlogComment::GetSocNetUserPerms($postID, $arPost["AUTHOR_ID"]);
					}
					else
						$postPerm = CBlogPost::GetBlogUserCommentPerms($postID, IntVal($user_id));

					if($postPerm >= BLOG_PERMS_READ)
					{
						$parser = new blogTextParser();
						$arParserParams = Array(
							"imageWidth" => $arPathTemplate["IMAGE_MAX_WIDTH"],
							"imageHeight" => $arPathTemplate["IMAGE_MAX_HEIGHT"],
						);

						CTimeZone::Disable();
						$dbComments = CBlogComment::GetList(
							array("DATE_CREATE" => "DESC"),
							array(
								//"BLOG_ID" => $blogID,
								"POST_ID" => $postID,
								"PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH,
							),
							false,
							array("nTopCount" => $numPosts),
							array("ID", "TITLE", "DATE_CREATE", "POST_TEXT", "AUTHOR_EMAIL", "AUTHOR_ID", "AUTHOR_NAME", "USER_LOGIN", "USER_LAST_NAME", "USER_SECOND_NAME", "USER_NAME", "BLOG_USER_ALIAS")
						);
						CTimeZone::Enable();
						$arImages = Array();
						$dbImages = CBlogImage::GetList(Array(), Array("BLOG_ID" => $blogID, "POST_ID" => $postID, "IS_COMMENT" => "Y", "!COMMENT_ID" => false));
						while($arI = $dbImages->Fetch())
							$arImages[$arI["ID"]] = $arI["FILE_ID"];

						while ($arComments = $dbComments->Fetch())
						{
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:67,代码来源:blog_comment.php

示例3: htmlspecialcharsback

             }
             $arResult["CommentDetailText"] = htmlspecialcharsback($arComment["POST_TEXT"]);
             $bDiskOrWebDavInstalled = IsModuleInstalled('disk') || IsModuleInstalled('webdav');
             $ufCode = $bDiskOrWebDavInstalled ? "UF_BLOG_COMMENT_FILE" : "UF_BLOG_COMMENT_DOC";
             $arResult["CommentUFCode"] = $ufCode;
             $arResult["CommentFiles"] = CMobileHelper::getUFForPostForm(array("ENTITY_TYPE" => "BLOG_COMMENT", "ENTITY_ID" => $comment_id, "UF_CODE" => $ufCode, "IS_DISK_OR_WEBDAV_INSTALLED" => $bDiskOrWebDavInstalled));
         }
     }
 } elseif ($action == "file_comment_upload") {
     $perm = BLOG_PERMS_DENY;
     $postPerm = CBlogPost::GetSocNetPostPerms($arBlogPost["ID"]);
     if ($postPerm > BLOG_PERMS_DENY) {
         if (IsModuleInstalled("bitrix24")) {
             $perm = $arBlogPost["AUTHOR_ID"] != $GLOBALS["USER"]->GetId() ? BLOG_PERMS_WRITE : BLOG_PERMS_FULL;
         } else {
             $perm = CBlogComment::GetSocNetUserPerms($arBlogPost["ID"], $arBlogPost["AUTHOR_ID"]);
         }
     }
     if ($perm < BLOG_PERMS_PREMODERATE) {
         $strError = "Can't save file";
     }
     if (!$strError && (!is_array($_FILES) || count($_FILES) <= 0 || !array_key_exists("file", $_FILES))) {
         $strError = "Empty file";
     }
     if (!$strError) {
         $arFileStorage = CMobileHelper::InitFileStorage();
         if (isset($arFileStorage["ERROR_CODE"])) {
             $strError = !empty($arFileStorage["ERROR_MESSAGE"]) ? $arFileStorage["ERROR_MESSAGE"] : "Cannot init storage";
         }
     }
     if (!$strError) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


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