Exemplo n.º 1
0
 function AddSocnetRead($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         return false;
     }
     if (CBlog::GetSocnetReadByBlog($ID)) {
         return true;
     }
     $strSql = "INSERT INTO b_blog_socnet(BLOG_ID) " . "VALUES(" . $ID . ")";
     if ($DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__)) {
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 if (CModule::IncludeModule("socialnetwork")) {
     if ($arFields["USE_SOCNET"] == "Y") {
         $bRights = false;
         $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $arFields["OWNER_ID"], "blog", "view_post");
         if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
             $bRights = true;
         }
         if ($bRights) {
             CBlog::AddSocnetRead($ID);
         } else {
             if (CBlog::GetSocnetReadByBlog($ID)) {
                 CBlog::DeleteSocnetRead($ID);
             }
         }
     } else {
         if (CBlog::GetSocnetReadByBlog($ID)) {
             CBlog::DeleteSocnetRead($ID);
         }
     }
 }
 if (!$result) {
     $bVarsFromForm = true;
     if ($ex = $APPLICATION->GetException()) {
         $errorMessage .= $ex->GetString() . "<br />";
     } else {
         $errorMessage .= GetMessage("BLBE_SAVE_ERROR") . "<br />";
     }
 }
 if (strlen($errorMessage) <= 0) {
     if (!empty($arBlogOld)) {
         if ($arBlogOld["GROUP_ID"] != $arFields["GROUP_ID"]) {