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


PHP CBlog::GetByOwnerID方法代码示例

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


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

示例1: Execute

 public function Execute()
 {
     global $DB;
     if (!CModule::IncludeModule("socialnetwork") || !CModule::IncludeModule("blog")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $siteId = $this->PostSite ? $this->PostSite : SITE_ID;
     $ownerId = CBPHelper::ExtractUsers($this->OwnerId, $documentId, true);
     $pathToPost = COption::GetOptionString("socialnetwork", "userblogpost_page", false, $siteId);
     $pathToSmile = COption::GetOptionString("socialnetwork", "smile_page", false, $siteId);
     $blogGroupID = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, $siteId);
     $blog = CBlog::GetByOwnerID($ownerId);
     if (!$blog) {
         $blog = $this->createBlog($ownerId, $blogGroupID, $siteId);
     }
     $micro = 'N';
     $title = trim($this->PostTitle);
     if (!$title) {
         $micro = 'Y';
         $title = trim(preg_replace(array("/\n+/is" . BX_UTF_PCRE_MODIFIER, '/\\s+/is' . BX_UTF_PCRE_MODIFIER), " ", blogTextParser::killAllTags($this->PostMessage)));
     }
     try {
         $postFields = array('TITLE' => $title, 'DETAIL_TEXT' => $this->PostMessage, 'DETAIL_TEXT_TYPE' => $this->PostMessageType == 'html' ? 'html' : 'text', '=DATE_PUBLISH' => $DB->CurrentTimeFunction(), 'PUBLISH_STATUS' => BLOG_PUBLISH_STATUS_PUBLISH, 'CATEGORY_ID' => '', 'PATH' => CComponentEngine::MakePathFromTemplate($pathToPost, array("post_id" => "#post_id#", "user_id" => $ownerId)), 'URL' => $blog['URL'], 'PERMS_POST' => array(), 'PERMS_COMMENT' => array(), 'MICRO' => $micro, 'SOCNET_RIGHTS' => $this->getSocnetRights($this->UsersTo), '=DATE_CREATE' => $DB->CurrentTimeFunction(), 'AUTHOR_ID' => $ownerId, 'BLOG_ID' => $blog['ID'], "HAS_IMAGES" => "N", "HAS_TAGS" => "N", "HAS_PROPS" => "N", "HAS_SOCNET_ALL" => "N");
         if (!empty($postFields["SOCNET_RIGHTS"]) && count($postFields["SOCNET_RIGHTS"]) == 1 && in_array("UA", $postFields["SOCNET_RIGHTS"])) {
             $postFields['HAS_SOCNET_ALL'] = 'Y';
         }
         $newId = CBlogPost::add($postFields);
         $postFields["ID"] = $newId;
         $arParamsNotify = array("bSoNet" => true, "UserID" => $ownerId, "allowVideo" => COption::GetOptionString("blog", "allow_video", "Y"), "PATH_TO_SMILE" => $pathToSmile, "PATH_TO_POST" => $pathToPost, "SOCNET_GROUP_ID" => $blogGroupID, "user_id" => $ownerId, "NAME_TEMPLATE" => CSite::GetNameFormat(false));
         CBlogPost::Notify($postFields, $blog, $arParamsNotify);
         BXClearCache(true, "/" . $siteId . "/blog/last_messages_list/");
         $arFieldsIM = array("TYPE" => "POST", "TITLE" => $postFields["TITLE"], "URL" => CComponentEngine::MakePathFromTemplate($pathToPost, array("post_id" => $newId, "user_id" => $ownerId)), "ID" => $newId, "FROM_USER_ID" => $ownerId, "TO_USER_ID" => array(), "TO_SOCNET_RIGHTS" => $postFields["SOCNET_RIGHTS"], "TO_SOCNET_RIGHTS_OLD" => array());
         CBlogPost::NotifyIm($arFieldsIM);
     } catch (Exception $e) {
         $this->WriteToTrackingService($e->getMessage());
     }
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:40,代码来源:socnetblogpostactivity.php

示例2: array

 $arResult["FRIENDS_POSTS"] = array();
 $arResult["IDS"] = array();
 $p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
 $arParserParams = array("imageWidth" => $arParams["IMAGE_MAX_WIDTH"], "imageHeight" => $arParams["IMAGE_MAX_HEIGHT"]);
 while ($arList = $dbList->Fetch()) {
     $arResult["IDS"][] = $arList["ID"];
     $arPost = CBlogPost::GetByID($arList["ID"]);
     $arPost = CBlogTools::htmlspecialcharsExArray($arPost);
     $arBlog = CBlog::GetByID($arPost["BLOG_ID"]);
     $arBlog = CBlogTools::htmlspecialcharsExArray($arBlog);
     $arPost["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"])));
     $arPost["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arPost["AUTHOR_ID"]));
     if ($arPost["AUTHOR_ID"] == $arBlog["OWNER_ID"]) {
         $arPost["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"]));
     } else {
         if ($arOwnerBlog = CBlog::GetByOwnerID($arPost["AUTHOR_ID"], $arParams["GROUP_ID"])) {
             $arPost["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnerBlog["URL"]));
         }
     }
     $arImages = array();
     $dbImage = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "N"));
     while ($arImage = $dbImage->Fetch()) {
         $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         $arPost["arImages"][$arImage['ID']] = array("small" => "/bitrix/components/bitrix/blog/show_file.php?fid=" . $arImage['ID'] . "&width=70&height=70&type=square", "full" => "/bitrix/components/bitrix/blog/show_file.php?fid=" . $arImage['ID'] . "&width=1000&height=1000");
     }
     if ($arPost["DETAIL_TEXT_TYPE"] == "html" && COption::GetOptionString("blog", "allow_html", "N") == "Y") {
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "QUOTE" => "Y", "CODE" => "Y");
         if (COption::GetOptionString("blog", "allow_video", "Y") != "Y") {
             $arAllow["VIDEO"] = "N";
         }
         $arPost["TEXT_FORMATED"] = $p->convert($arPost["~DETAIL_TEXT"], true, $arImages, $arAllow, $arParserParams);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例3: array

                $rsSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
                while ($arSite = $rsSite->Fetch()) {
                    $arIdeaBlogGroupID[] = COption::GetOptionInt("idea", "blog_group_id", false, $arSite["LID"]);
                }
            }
            if (empty($arIdeaBlogGroupID)) {
                $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"]);
            } else {
                $arBlogGroupID = array();
                $rsBlogGroup = CBlogGroup::GetList(array(), array(), false, false, array("ID"));
                while ($arBlogGroup = $rsBlogGroup->Fetch()) {
                    if (!in_array($arBlogGroup["ID"], $arIdeaBlogGroupID)) {
                        $arBlogGroupID[] = $arBlogGroup["ID"];
                    }
                }
                $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"], $arBlogGroupID);
            }
        }
        $obCache->EndDataCache($arBlog);
    }
    $arResult["Blog"] = $arBlog;
    if ($GLOBALS["USER"]->IsAuthorized()) {
        CSocNetTools::InitGlobalExtranetArrays();
        if (isset($GLOBALS["arExtranetGroupID"])) {
            $arResult["arExtranetGroupID"] = $GLOBALS["arExtranetGroupID"];
        }
    }
}
$arParams["ID"] = trim($arParams["ID"]);
if (preg_match("/^[1-9][0-9]*\$/", $arParams["ID"])) {
    $arParams["ID"] = IntVal($arParams["ID"]);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例4: array

     $arUsrTmp = array();
     $arUsrTmp["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComment["AUTHOR_ID"]));
     $arUsrTmp["BlogUser"] = CBlogUser::GetByID($arComment["AUTHOR_ID"], BLOG_BY_USER_ID);
     $arUsrTmp["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arUsrTmp["BlogUser"]);
     $dbUser = CUser::GetByID($arComment["AUTHOR_ID"]);
     $arUsrTmp["arUser"] = $dbUser->GetNext();
     $arUsrTmp["AuthorName"] = CBlogUser::GetUserName($arUsrTmp["BlogUser"]["ALIAS"], $arUsrTmp["arUser"]["NAME"], $arUsrTmp["arUser"]["LAST_NAME"], $arUsrTmp["arUser"]["LOGIN"]);
     if (IntVal($arUsrTmp["BlogUser"]["AVATAR"]) > 0) {
         $arUsrTmp["AVATAR_file"] = CFile::ResizeImageGet($arUsrTmp["BlogUser"]["AVATAR"], array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_EXACT, false);
     } elseif ($arResult["bSoNet"] && IntVal($arUsrTmp["arUser"]["PERSONAL_PHOTO"]) > 0) {
         $arUsrTmp["AVATAR_file"] = CFile::ResizeImageGet($arUsrTmp["arUser"]["PERSONAL_PHOTO"], array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_EXACT, false);
     }
     if ($arUsrTmp["AVATAR_file"] !== false) {
         $arUsrTmp["AVATAR_img"] = CFile::ShowImage($arUsrTmp["AVATAR_file"]["src"], 30, 30, "border=0 align='right'");
     }
     $arUsrTmp["Blog"] = CBlog::GetByOwnerID(IntVal($arComment["AUTHOR_ID"]), $arParams["GROUP_ID"]);
     if ($arUsrTmp["AUTHOR_ID"] == $arUsrTmp["AUTHOR_ID"]) {
         $arUsrTmp["AuthorIsPostAuthor"] = "Y";
     }
     $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]] = $arUsrTmp;
 }
 $arComment["urlToAuthor"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["urlToAuthor"];
 $arComment["BlogUser"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["BlogUser"];
 $arComment["arUser"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["arUser"];
 $arComment["AuthorName"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["AuthorName"];
 $arComment["AVATAR_file"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["AVATAR_file"];
 $arComment["AVATAR_img"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["AVATAR_img"];
 $arComment["Blog"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["Blog"];
 $arComment["AuthorIsPostAuthor"] = $arResult["USER_CACHE"][$arComment["AUTHOR_ID"]]["AuthorIsPostAuthor"];
 if (!empty($arComment["Blog"])) {
     $arComment["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arComment["Blog"]["URL"], "user_id" => $arComment["Blog"]["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"]));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例5: PostIntoBuzzAsBlog

 public static function PostIntoBuzzAsBlog($userTwit, $arSiteId = array(), $userLogin = '')
 {
     global $DB;
     if (!CModule::IncludeModule("blog")) {
         return;
     }
     $arParams = array();
     if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME') && $userLogin != '') {
         if ($arUserTwit = unserialize(base64_decode($userTwit))) {
             $userTwit = $arUserTwit;
         }
         if ($arSiteIdCheck = unserialize(base64_decode($arSiteId))) {
             $arSiteId = $arSiteIdCheck;
         }
         $dbUser = CUser::GetByLogin($userLogin);
         if ($arUser = $dbUser->Fetch()) {
             $arParams["USER_ID"] = $arUser["ID"];
         }
     } else {
         $arParams["USER_ID"] = $userTwit['kp_user_id'];
     }
     if (isset($arSiteId[$userTwit['kp_user_id']])) {
         $siteId = $arSiteId[$userTwit['kp_user_id']];
     }
     if (strlen($siteId) <= 0) {
         $siteId = SITE_ID;
     }
     if (isset($userTwit['text'])) {
         $arParams["GROUP_ID"] = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, $siteId);
         $arParams["PATH_TO_BLOG"] = COption::GetOptionString("socialnetwork", "userblogpost_page", false, $siteId);
         $arParams["PATH_TO_SMILE"] = COption::GetOptionString("socialnetwork", "smile_page", false, $siteId);
         $arParams["NAME_TEMPLATE"] = COption::GetOptionString("main", "TOOLTIP_NAME_TEMPLATE", false, $siteId);
         $arParams["SHOW_LOGIN"] = 'Y';
         $arParams["PATH_TO_POST"] = $arParams["PATH_TO_BLOG"];
         $arFilterblg = array("ACTIVE" => "Y", "USE_SOCNET" => "Y", "GROUP_ID" => $arParams["GROUP_ID"], "GROUP_SITE_ID" => $siteId, "OWNER_ID" => $arParams["USER_ID"]);
         $groupId = is_array($arParams["GROUP_ID"]) ? IntVal($arParams["GROUP_ID"][0]) : IntVal($arParams["GROUP_ID"]);
         if (isset($GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]]) && !empty($GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]])) {
             $arBlog = $GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]];
         } else {
             $dbBl = CBlog::GetList(array(), $arFilterblg);
             $arBlog = $dbBl->Fetch();
             if (!$arBlog && IsModuleInstalled("intranet")) {
                 $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"]);
             }
             $GLOBALS["BLOG_POST"]["BLOG_P_" . $groupId . "_" . $arParams["USER_ID"]] = $arBlog;
         }
         $arResult["Blog"] = $arBlog;
         if (empty($arBlog)) {
             if (!empty($arParams["GROUP_ID"])) {
                 $arFields = array("=DATE_UPDATE" => $DB->CurrentTimeFunction(), "GROUP_ID" => is_array($arParams["GROUP_ID"]) ? IntVal($arParams["GROUP_ID"][0]) : IntVal($arParams["GROUP_ID"]), "ACTIVE" => "Y", "ENABLE_COMMENTS" => "Y", "ENABLE_IMG_VERIF" => "Y", "EMAIL_NOTIFY" => "Y", "ENABLE_RSS" => "Y", "ALLOW_HTML" => "N", "ENABLE_TRACKBACK" => "N", "SEARCH_INDEX" => "Y", "USE_SOCNET" => "Y", "=DATE_CREATE" => $DB->CurrentTimeFunction(), "PERMS_POST" => array(1 => "I", 2 => "I"), "PERMS_COMMENT" => array(1 => "P", 2 => "P"));
                 $bRights = false;
                 $rsUser = CUser::GetByID($arParams["USER_ID"]);
                 $arUser = $rsUser->Fetch();
                 if (strlen($arUser["NAME"] . "" . $arUser["LAST_NAME"]) <= 0) {
                     $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["LOGIN"];
                 } else {
                     $arFields["NAME"] = GetMessage("BLG_NAME") . " " . $arUser["NAME"] . " " . $arUser["LAST_NAME"];
                 }
                 $arFields["URL"] = str_replace(" ", "_", $arUser["LOGIN"]) . "-blog-" . SITE_ID;
                 $arFields["OWNER_ID"] = $arParams["USER_ID"];
                 $urlCheck = preg_replace("/[^a-zA-Z0-9_-]/is", "", $arFields["URL"]);
                 if ($urlCheck != $arFields["URL"]) {
                     $arFields["URL"] = "u" . $arParams["USER_ID"] . "-blog-" . SITE_ID;
                 }
                 if (CBlog::GetByUrl($arFields["URL"])) {
                     $uind = 0;
                     do {
                         $uind++;
                         $arFields["URL"] = $arFields["URL"] . $uind;
                     } while (CBlog::GetByUrl($arFields["URL"]));
                 }
                 $featureOperationPerms = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER, $arFields["OWNER_ID"], "blog", "view_post");
                 if ($featureOperationPerms == SONET_RELATIONS_TYPE_ALL) {
                     $bRights = true;
                 }
                 $arFields["PATH"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arFields["URL"], "user_id" => $arFields["OWNER_ID"], "group_id" => $arFields["SOCNET_GROUP_ID"]));
                 $blogID = CBlog::Add($arFields);
                 if ($bRights) {
                     CBlog::AddSocnetRead($blogID);
                 }
                 $arBlog = CBlog::GetByID($blogID, $arParams["GROUP_ID"]);
             }
         }
         //	$DATE_PUBLISH = "";
         //	if(strlen($_POST["DATE_PUBLISH_DEF"]) > 0)
         //		$DATE_PUBLISH = $_POST["DATE_PUBLISH_DEF"];
         //	elseif (strlen($_POST["DATE_PUBLISH"])<=0)
         $DATE_PUBLISH = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
         //	else
         //		$DATE_PUBLISH = $_POST["DATE_PUBLISH"];
         $arFields = array("DETAIL_TEXT" => $userTwit['text'], "DETAIL_TEXT_TYPE" => "text", "DATE_PUBLISH" => $DATE_PUBLISH, "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "PATH" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => "#post_id#", "user_id" => $arBlog["OWNER_ID"])), "URL" => $arBlog["URL"], "SOURCE_TYPE" => "twitter");
         $arFields["PERMS_POST"] = array();
         $arFields["PERMS_COMMENT"] = array();
         $arFields["MICRO"] = "N";
         if (strlen($arFields["TITLE"]) <= 0) {
             $arFields["MICRO"] = "Y";
             $arFields["TITLE"] = trim(blogTextParser::killAllTags($arFields["DETAIL_TEXT"]));
             if (strlen($arFields["TITLE"]) <= 0) {
                 $arFields["TITLE"] = GetMessage("BLOG_EMPTY_TITLE_PLACEHOLDER");
             }
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:authmanager.php

示例6: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$arResult["urlToOwnBlog"] = "";
$arResult["urlToOwnProfile"] = "";
if (CModule::IncludeModule("blog") && $GLOBALS["USER"]->IsAuthorized()) {
    $arOwnBlog = CBlog::GetByOwnerID($GLOBALS["USER"]->GetID());
    if ($arOwnBlog && array_key_exists("URL", $arOwnBlog) && strlen($arOwnBlog["URL"]) > 0) {
        $arResult["urlToOwnBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnBlog["URL"], "user_id" => $GLOBALS["USER"]->GetID()));
        $arResult["urlToCreateMessageInBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_NEW_POST"], array("blog" => $arOwnBlog["URL"], "user_id" => $GLOBALS["USER"]->GetID(), "post_id" => "new"));
    } else {
        $arResult["urlToCreateInBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_NEW_BLOG"], array("user_id" => $GLOBALS["USER"]->GetID()));
    }
}
if ($GLOBALS["USER"]->IsAuthorized()) {
    $arResult["urlToOwnProfile"] = CComponentEngine::MakePathFromTemplate($arParams["PROFILE_URL"], array("user_id" => $GLOBALS["USER"]->GetID()));
}
开发者ID:webgksupport,项目名称:alpina,代码行数:19,代码来源:result_modifier.php

示例7: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
?>
<div class="body-blog">
<div class="blog-mainpage">
<?php 
$APPLICATION->IncludeComponent("bitrix:blog.menu", "", array("BLOG_VAR" => $arResult["ALIASES"]["blog"], "POST_VAR" => $arResult["ALIASES"]["post_id"], "USER_VAR" => $arResult["ALIASES"]["user_id"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "PATH_TO_BLOG" => $arResult["PATH_TO_BLOG"], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_BLOG_EDIT" => $arResult["PATH_TO_BLOG_EDIT"], "PATH_TO_BLOG_INDEX" => $arResult["PATH_TO_BLOG_INDEX"], "PATH_TO_DRAFT" => $arResult["PATH_TO_DRAFT"], "PATH_TO_POST_EDIT" => $arResult["PATH_TO_POST_EDIT"], "PATH_TO_USER_FRIENDS" => $arResult["PATH_TO_USER_FRIENDS"], "PATH_TO_USER_SETTINGS" => $arResult["PATH_TO_USER_SETTINGS"], "PATH_TO_GROUP_EDIT" => $arResult["PATH_TO_GROUP_EDIT"], "PATH_TO_CATEGORY_EDIT" => $arResult["PATH_TO_CATEGORY_EDIT"], "BLOG_URL" => $arResult["VARIABLES"]["blog"], "SET_NAV_CHAIN" => $arResult["SET_NAV_CHAIN"], "GROUP_ID" => $arParams["GROUP_ID"]), $component);
?>
	<?php 
if ($USER->IsAuthorized() && CBlog::CanUserCreateBlog($USER->GetID())) {
    if (!CBlog::GetByOwnerID($USER->GetID(), $arParams["GROUP_ID"])) {
        ?>
		<div class="blog-mainpage-create-blog">
		<a href="<?php 
        echo $arResult["PATH_TO_NEW_BLOG"];
        ?>
" class="blog-author-icon"></a>&nbsp;<a href="<?php 
        echo $arResult["PATH_TO_NEW_BLOG"];
        ?>
"><?php 
        echo GetMessage("BLOG_CREATE_BLOG");
        ?>
</a>
		</div>
			<?php 
    }
}
?>
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:index.php

示例8: htmlspecialcharsEx

                echo $pathToGroup;
                ?>
"><?php 
                echo htmlspecialcharsEx($arGroup["NAME"]);
                ?>
</a></li>
				<?php 
            }
        }
    }
    if (strlen($arResult["VARIABLES"]["blog"]) > 0 || IntVal($arResult["VARIABLES"]["user_id"]) > 0) {
        if (empty($arBlog)) {
            $arBlog = CBlog::GetByUrl($arResult["VARIABLES"]["blog"], $arParams["GROUP_ID"]);
        }
        if (empty($arBlog)) {
            $arBlog = CBlog::GetByOwnerID($arResult["VARIABLES"]["user_id"], $arParams["GROUP_ID"]);
        }
        if (!empty($arBlog)) {
            if ($arBlog["ACTIVE"] == "Y") {
                $arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
                if ($arGroup["SITE_ID"] == SITE_ID) {
                    $pathToBlog = CComponentEngine::MakePathFromTemplate($arResultTmp["PATH_TO_BLOG"], array("blog" => $arBlog["URL"]));
                    ?>
					<li><span class="blog-navigation-sep">&nbsp;&raquo;&nbsp;</span></li>
					<li><a href="<?php 
                    echo $pathToBlog;
                    ?>
"><?php 
                    echo htmlspecialcharsEx($arBlog["NAME"]);
                    ?>
</a></li>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:result_modifier.php

示例9: elseif

    }
} elseif ($arParams["USER_ID"] == $user_id || $APPLICATION->GetGroupRight("blog") >= "W" || CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_USER, $arParams["USER_ID"], "blog", "full_post", CSocNetUser::IsCurrentUserModuleAdmin())) {
    $arResult["perms"] = BLOG_PERMS_FULL;
}
$cacheTtl = 3153600;
$cacheId = 'blog_post_blog_' . md5(serialize($arFilterblg));
$cacheDir = '/blog/form/blog/';
$obCache = new CPHPCache();
if ($obCache->InitCache($cacheTtl, $cacheId, $cacheDir)) {
    $arBlog = $obCache->GetVars();
} else {
    $obCache->StartDataCache();
    $dbBl = CBlog::GetList(array(), $arFilterblg);
    $arBlog = $dbBl->Fetch();
    if (!$arBlog && IsModuleInstalled("intranet")) {
        $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"]);
    }
    $obCache->EndDataCache($arBlog);
}
$arResult["Blog"] = $arBlog;
if ($arResult["bGroupMode"]) {
    $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_BLOG"], array("blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"]));
} else {
    $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"]));
}
$arPostFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_POST", $arParams["ID"], LANGUAGE_ID);
$arParams["CACHE_TIME"] = defined("BX_COMP_MANAGED_CACHE") ? 3600 * 24 * 365 : 3600 * 24;
$arResult["PostToShow"]["GRATS"] = array();
$arResult["PostToShow"]["GRATS_DEF"] = false;
$cache = new CPHPCache();
$cache_id = "blog_post_grats_" . SITE_ID;
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例10: intval

    $arResult["NEED_AUTH"] = "Y";
} else {
    if (CBlog::CanUserCreateBlog($USER->GetID())) {
        $USER_ID = intval($USER->GetID());
        if (strlen($arParams["BLOG_URL"]) > 0) {
            $arBlog = CBlog::GetByUrl($arParams["BLOG_URL"], $arParams["GROUP_ID"]);
            if ($arBlog["ACTIVE"] == "Y") {
                $arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
                if (intval($arBlog["SOCNET_GROUP_ID"]) <= 0 && $arGroup["SITE_ID"] != SITE_ID) {
                    unset($arBlog);
                }
            } else {
                unset($arBlog);
            }
        } else {
            $arBlog = CBlog::GetByOwnerID($USER_ID, $arParams["GROUP_ID"]);
            if ($arBlog["ACTIVE"] == "Y") {
                $arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
                if (intval($arBlog["SOCNET_GROUP_ID"]) <= 0 && $arGroup["SITE_ID"] != SITE_ID) {
                    unset($arBlog);
                }
            } else {
                unset($arBlog);
            }
        }
        if (!empty($arBlog)) {
            $arBlog = CBlogTools::htmlspecialcharsExArray($arBlog);
            $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"]));
            $arResult["BLOG"] = $arBlog;
        }
        if (CBlog::CanUserManageBlog($arBlog["ID"], IntVal($USER->GetID())) || CBlog::CanUserCreateBlog($USER->GetID()) && IntVal($arBlog["ID"]) <= 0) {
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例11: array

     $COUNT = array("nPageSize" => $arParams["MESSAGES_PER_PAGE"], "bShowAll" => false);
 } else {
     $COUNT = false;
 }
 $arResult = array();
 $dbPosts = CBlogPost::GetList($SORT, $arFilter, false, $COUNT, $arSelectedFields);
 $arResult["NAV_STRING"] = $dbPosts->GetPageNavString(GetMessage("B_B_GR_TITLE"), $arParams["NAV_TEMPLATE"]);
 $arResult["IDS"] = array();
 $p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
 while ($arPost = $dbPosts->GetNext()) {
     $arResult["IDS"][] = $arPost["ID"];
     $arTmp = $arPost;
     if ($arTmp["AUTHOR_ID"] == $arTmp["BLOG_OWNER_ID"]) {
         $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arPost["BLOG_URL"], "user_id" => $arPost["AUTHOR_ID"]));
     } else {
         $arOwnerBlog = CBlog::GetByOwnerID($arTmp["AUTHOR_ID"]);
         if (!empty($arOwnerBlog)) {
             $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnerBlog["URL"], "user_id" => $arOwnerBlog["OWNER_ID"]));
         } else {
             $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arPost["BLOG_URL"], "user_id" => $arPost["AUTHOR_ID"]));
         }
     }
     if (IntVal($arPost["BLOG_SOCNET_GROUP_ID"]) > 0) {
         $arTmp["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => $arPost["ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"]));
     } else {
         $arTmp["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => $arPost["ID"], "user_id" => $arPost["BLOG_OWNER_ID"]));
     }
     $arTmp["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arPost["AUTHOR_ID"]));
     $arTmp["AuthorName"] = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arPost["AUTHOR_NAME"], $arPost["AUTHOR_LAST_NAME"], $arPost["AUTHOR_LOGIN"]);
     $arImage = array();
     $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost['ID']));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例12: htmlspecialcharsbx

if (strlen($arParams["PATH_TO_MODERATION"]) <= 0) {
    $arParams["PATH_TO_MODERATION"] = htmlspecialcharsbx($APPLICATION->GetCurPage() . "?" . $arParams["PAGE_VAR"] . "=moderation&" . $arParams["BLOG_VAR"] . "=#blog#");
}
if (!$USER->IsAuthorized()) {
    $arResult["urlToAuth"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("auth=Y", array("login", "logout", "register", "forgot_password", "change_password")));
    if (COption::GetOptionString("main", "new_user_registration", "Y") == "Y") {
        $arResult["urlToRegister"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("auth=Y&register=yes", array("login", "logout", "register", "forgot_password", "change_password", "backurl")));
    }
} else {
    $arResult["urlToLogout"] = $APPLICATION->GetCurPageParam("logout=yes", array("login", "logout", "register", "forgot_password", "change_password", "backurl"));
}
$user_id = $USER->GetID();
if (IntVal($user_id) > 0) {
    CBlogUser::SetLastVisit();
    $arResult["urlToUser"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $user_id));
    $arOwnBlog = CBlog::GetByOwnerID($user_id, $arParams["GROUP_ID"]);
    if ($arOwnBlog["ACTIVE"] == "Y") {
        $arGroup = CBlogGroup::GetByID($arOwnBlog["GROUP_ID"]);
        if ($arGroup["SITE_ID"] == SITE_ID) {
            if (!empty($arOwnBlog)) {
                $arResult["OwnBlog"] = $arOwnBlog;
                $arResult["urlToOwnBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnBlog["URL"]));
                $arResult["urlToFriends"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FRIENDS"], array("user_id" => $user_id));
                $arResult["urlToOwnNewPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("blog" => $arOwnBlog["URL"], "post_id" => "new"));
                $arResult["urlToOwnBlogEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_EDIT"], array("blog" => $arOwnBlog["URL"]));
            }
        } else {
            unset($arOwnBlog);
        }
    } else {
        unset($arOwnBlog);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


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