當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CBlogPost::GetBlogUserCommentPerms方法代碼示例

本文整理匯總了PHP中CBlogPost::GetBlogUserCommentPerms方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBlogPost::GetBlogUserCommentPerms方法的具體用法?PHP CBlogPost::GetBlogUserCommentPerms怎麽用?PHP CBlogPost::GetBlogUserCommentPerms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CBlogPost的用法示例。


在下文中一共展示了CBlogPost::GetBlogUserCommentPerms方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: GetMessage

    $arBlog = CBlog::GetByUrl($arParams["BLOG_URL"], $arParams["GROUP_ID"]);
    $arBlog = CBlogTools::htmlspecialcharsExArray($arBlog);
}
$arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
$arResult["Blog"] = $arBlog;
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 (!$bSoNet) {
    if (IntVal($arParams["ID"]) > 0) {
        $arResult["Perm"] = CBlogPost::GetBlogUserCommentPerms($arParams["ID"], $user_id);
    } else {
        $arResult["Perm"] = CBlog::GetBlogUserCommentPerms($arBlog["ID"], $user_id);
    }
}
if ((!empty($arPost) && ($arPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH || $arResult["IDEA_MODERATOR"]) && $arPost["ENABLE_COMMENTS"] == "Y" || $simpleComment) && ($arBlog["ACTIVE"] == "Y" && $arGroup["SITE_ID"] == SITE_ID || $simpleComment)) {
    $arPost = CBlogTools::htmlspecialcharsExArray($arPost);
    $arResult["Post"] = $arPost;
    if ($arPost["BLOG_ID"] == $arBlog["ID"] || $simpleComment) {
        //Comment delete
        if (IntVal($_GET["delete_comment_id"]) > 0 && $arResult["IDEA_MODERATOR"]) {
            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 && !empty($arComment)) {
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:component.php

示例2: BuildRSS


//.........這裏部分代碼省略.........
						$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())
						{
							$arDate = ParseDateTime($arComments["DATE_CREATE"], CSite::GetDateFormat("FULL", $arGroup["SITE_ID"]));
							$date = date("r", mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
開發者ID:ASDAFF,項目名稱:bxApiDocs,代碼行數:66,代碼來源:blog_comment.php


注:本文中的CBlogPost::GetBlogUserCommentPerms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。