本文整理汇总了PHP中CBlogPost::GetSocnetPerms方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogPost::GetSocnetPerms方法的具体用法?PHP CBlogPost::GetSocnetPerms怎么用?PHP CBlogPost::GetSocnetPerms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogPost
的用法示例。
在下文中一共展示了CBlogPost::GetSocnetPerms方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetSocNetCommentPerms
public static function GetSocNetCommentPerms($postID = 0)
{
$postID = IntVal($postID);
if($postID <= 0)
return false;
$arSp = Array();
$sp = CBlogPost::GetSocnetPerms($postID);
if(is_array($sp) && !empty($sp))
{
foreach($sp as $et => $v)
{
foreach($v as $eid => $tv)
{
if($et == "U" && in_array($et.$eid, $tv))
{
$arSp[] = $et.$eid;
}
elseif(in_array($et, Array("U", "SG")))
{
$spt = CBlogPost::GetSocnetGroups(($et == "SG" ? "G" : "U"), $eid, "view_comment");
foreach($spt as $vv)
{
if(!in_array($vv, $arSp))
$arSp[] = $vv;
}
}
else
{
$arSp[] = $et.$eid;
}
}
}
}
return $arSp;
}
示例2: array
$arResult["PostToShow"]["TITLE"] = $arPost["TITLE"];
$arResult["PostToShow"]["DETAIL_TEXT"] = $arPost["DETAIL_TEXT"];
$arResult["PostToShow"]["~DETAIL_TEXT"] = $arPost["~DETAIL_TEXT"];
$arResult["PostToShow"]["DETAIL_TEXT_TYPE"] = $arPost["DETAIL_TEXT_TYPE"];
$arResult["PostToShow"]["PUBLISH_STATUS"] = $arPost["PUBLISH_STATUS"];
$arResult["PostToShow"]["ENABLE_TRACKBACK"] = $arPost["ENABLE_TRACKBACK"] == "Y";
$arResult["PostToShow"]["ENABLE_COMMENTS"] = $arPost["ENABLE_COMMENTS"];
$arResult["PostToShow"]["ATTACH_IMG"] = $arPost["ATTACH_IMG"];
$arResult["PostToShow"]["DATE_PUBLISH"] = $arPost["DATE_PUBLISH"];
$arResult["PostToShow"]["CATEGORY_ID"] = $arPost["CATEGORY_ID"];
$arResult["PostToShow"]["FAVORITE_SORT"] = $arPost["FAVORITE_SORT"];
$arResult["PostToShow"]["MICRO"] = $arPost["MICRO"];
if ($arParams["ALLOW_POST_CODE"]) {
$arResult["PostToShow"]["CODE"] = $arPost["CODE"];
}
$arResult["PostToShow"]["SPERM"] = CBlogPost::GetSocnetPerms($arPost["ID"]);
if (is_array($arResult["PostToShow"]["SPERM"]["U"][$arPost["AUTHOR_ID"]]) && in_array("US" . $arPost["AUTHOR_ID"], $arResult["PostToShow"]["SPERM"]["U"][$arPost["AUTHOR_ID"]])) {
$arResult["PostToShow"]["SPERM"]["U"]["A"] = array();
}
if (!is_array($arResult["PostToShow"]["SPERM"]["U"][$arPost["AUTHOR_ID"]]) || !in_array("U" . $arPost["AUTHOR_ID"], $arResult["PostToShow"]["SPERM"]["U"][$arPost["AUTHOR_ID"]])) {
unset($arResult["PostToShow"]["SPERM"]["U"][$arPost["AUTHOR_ID"]]);
}
} else {
$arResult["PostToShow"]["TITLE"] = htmlspecialcharsEx($_POST["POST_TITLE"]);
$arResult["PostToShow"]["CATEGORY_ID"] = $_POST["CATEGORY_ID"];
$arResult["PostToShow"]["CategoryText"] = htmlspecialcharsEx($_POST["TAGS"]);
$arResult["PostToShow"]["DETAIL_TEXT"] = $_POST["POST_MESSAGE"];
$arResult["PostToShow"]["~DETAIL_TEXT"] = $_POST["POST_MESSAGE"];
$arResult["PostToShow"]["PUBLISH_STATUS"] = htmlspecialcharsEx($_POST["PUBLISH_STATUS"]);
$arResult["PostToShow"]["ENABLE_COMMENTS"] = htmlspecialcharsEx($_POST["ENABLE_COMMENTS"]);
$arResult["PostToShow"]["DATE_PUBLISH"] = $_POST["DATE_PUBLISH"] ? htmlspecialcharsEx($_POST["DATE_PUBLISH"]) : ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
示例3: array
$res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "Y", "COMMENT_ID" => $commentId));
while ($arImage = $res->Fetch()) {
$arImages[$arImage["ID"]] = $arImage["FILE_ID"];
}
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "TABLE" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
$text4mail = $parserBlog->convert4mail($_POST['comment'], $arImages);
if (intval($log_id) > 0) {
$text4message = $parserBlog->convert($_POST['comment'], false, $arImages, $arAllow, array("isSonetLog" => true));
$arFieldsForSocnet = array("ENTITY_TYPE" => SONET_ENTITY_USER, "ENTITY_ID" => $arBlog["OWNER_ID"], "EVENT_ID" => "blog_comment", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "URL" => $commentUrl, "MODULE_ID" => false, "SOURCE_ID" => $commentId, "LOG_ID" => $log_id, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => intval($commentId));
if (intval($user_id) > 0) {
$arFieldsForSocnet["USER_ID"] = $user_id;
}
$log_comment_id = CSocNetLogComments::Add($arFieldsForSocnet, false, false);
CSocNetLog::CounterIncrement($log_comment_id, false, false, "LC", CSocNetLogRights::CheckForUserAll($log_id));
}
$arPSR = CBlogPost::GetSocnetPerms($arPost["ID"]);
$arUsrS = array();
if (!empty($arPSR["U"])) {
foreach ($arPSR["U"] as $k => $v) {
$arUsrS[] = "U" . $k;
}
}
preg_match_all("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/is" . BX_UTF_PCRE_MODIFIER, $_POST['comment'], $arMention);
$arFieldsIM = array("TYPE" => "COMMENT", "TITLE" => htmlspecialcharsBack($arPost["TITLE"]), "URL" => $commentUrl, "ID" => $arPost["ID"], "FROM_USER_ID" => $user_id, "TO_USER_ID" => array($arPost["AUTHOR_ID"]), "TO_SOCNET_RIGHTS" => $arUsrS, "TO_SOCNET_RIGHTS_OLD" => array("U" => array(), "SG" => array()), "AUTHOR_ID" => $arPost["AUTHOR_ID"], "BODY" => $text4mail);
if (!empty($arMention)) {
$arFieldsIM["MENTION_ID"] = $arMention[1];
if ($_POST["act"] != "edit" && is_array($arMention[1]) && !empty($arMention[1])) {
$arMentionedDestCode = array();
foreach ($arMention[1] as $val) {
$arMentionedDestCode[] = "U" . $val;
}
示例4: array
}
return true;
}
}
if (intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork")) {
if ($arSonetGroup = CSocNetGroup::GetByID($arParams["SOCNET_GROUP_ID"])) {
$arResult["SONET_GROUP_NAME"] = $arSonetGroup["NAME"];
}
}
if (intval($_REQUEST["post_id"]) > 0 && CModule::IncludeModule("blog") && CModule::IncludeModule("socialnetwork") && ($arBlogPost = CBlogPost::GetByID(intval($_REQUEST["post_id"])))) {
$postPerms = CBlogPost::GetSocNetPostPerms(intval($_REQUEST["post_id"]), true, $GLOBALS["USER"]->GetID(), $arBlogPost["AUTHOR_ID"]);
if ($postPerms > BLOG_PERMS_MODERATE || $postPerms >= BLOG_PERMS_WRITE && $arBlogPost["AUTHOR_ID"] == $GLOBALS["USER"]->GetID()) {
$arResult["Post"] = $arBlogPost;
$arResult["Post"]["arSonetPerms"] = array();
$arResult["Post"]["arSonetPermsHidden"] = array();
$arSonetPerms = CBlogPost::GetSocnetPerms(intval($_REQUEST["post_id"]));
$bExtranetInstalled = CModule::IncludeModule("extranet");
$arAvailableGroupID = CSocNetLogTools::GetAvailableGroups();
foreach ($arSonetPerms as $key => $arSonetPerm) {
foreach ($arSonetPerm as $entityId => $arPerm) {
if ($key == "U") {
if (in_array("G2", $arPerm)) {
$arResult["Post"]["arSonetPerms"][] = array("type" => "groups", "item" => array("id" => "UA"));
} else {
$rsUserTmp = CUser::GetByID($entityId);
if ($arUserTmp = $rsUserTmp->Fetch()) {
$arResult["Post"][!$bExtranetInstalled || CExtranet::IsProfileViewable($arUserTmp) ? "arSonetPerms" : "arSonetPermsHidden"][] = array("type" => "users", "item" => array("id" => "U" . $entityId, "name" => CUser::FormatName(CSite::GetNameFormat(), $arUserTmp, true)));
}
}
} elseif ($key == "SG") {
$arSonetGroup = CSocNetGroup::GetByID($entityId);