本文整理匯總了PHP中CBlogPost::__AddSocNetPerms方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBlogPost::__AddSocNetPerms方法的具體用法?PHP CBlogPost::__AddSocNetPerms怎麽用?PHP CBlogPost::__AddSocNetPerms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBlogPost
的用法示例。
在下文中一共展示了CBlogPost::__AddSocNetPerms方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AddSocNetPerms
function AddSocNetPerms($ID, $perms = false, $arPost = array())
{
if (IntVal($ID) <= 0) {
return false;
}
$arResult = array();
// D - department
// U - user
// SG - socnet group
// DR - department and hier
// G - user group
// AU - authorized user
//$bAU = false;
if (empty($perms) || in_array("UA", $perms)) {
CBlogPost::__AddSocNetPerms($ID, "U", $arPost["AUTHOR_ID"], "US" . $arPost["AUTHOR_ID"]);
// for myself
$perms1 = CBlogPost::GetSocnetGroups("U", $arPost["AUTHOR_ID"]);
foreach ($perms1 as $val) {
if (strlen($val) > 0) {
CBlogPost::__AddSocNetPerms($ID, "U", $arPost["AUTHOR_ID"], $val);
if (!in_array($val, $arResult)) {
$arResult[] = $val;
}
}
}
}
if (!empty($perms)) {
foreach ($perms as $val) {
if ($val == "UA") {
continue;
}
if (strlen($val) > 0) {
$scID = 0;
$scT = substr($val, 0, 2);
if (in_array($scT, array("DR", "SG"))) {
$scID = IntVal(substr($val, 2));
} else {
$scT = substr($val, 0, 1);
$scID = IntVal(substr($val, 1));
}
if ($scT == "SG") {
$permsNew = CBlogPost::GetSocnetGroups("G", $scID);
foreach ($permsNew as $val1) {
CBlogPost::__AddSocNetPerms($ID, $scT, $scID, $val1);
if (!in_array($val1, $arResult)) {
$arResult[] = $val1;
}
}
}
CBlogPost::__AddSocNetPerms($ID, $scT, $scID, $val);
if (!in_array($val, $arResult)) {
$arResult[] = $val;
}
}
}
}
BXClearCache(true, "/blog/getsocnetperms/" . $ID . "/");
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->ClearByTag("blog_post_getsocnetperms_" . $ID);
}
return $arResult;
}