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


PHP CBlogUser::GetUserName方法代码示例

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


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

示例1: unset

         if (CModule::IncludeModule("socialnetwork") && $arParams["USE_SOCNET"] == "Y") {
             unset($arFilter[">PERMS"]);
             $arSelectFields[] = "SOCNET_BLOG_READ";
             $arFilter["USE_SOCNET"] = "Y";
         }
         if ($arParams["SHOW_BLOG_WITHOUT_POSTS"] != "Y") {
             $arFilter[">LAST_POST_ID"] = 0;
         }
         $dbBlog = CBlog::GetList($SORT, $arFilter, false, array("nPageSize" => $arParams["BLOG_COUNT"], "bShowAll" => false), $arSelectFields);
         $arResult["NAV_STRING"] = $dbBlog->GetPageNavString(GetMessage("B_B_GR_TITLE"), $arParams["NAV_TEMPLATE"], false, $component);
         $arResult["BLOG"] = array();
         while ($arBlog = $dbBlog->GetNext()) {
             $arBlog["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "post_id" => $arBlog["LAST_POST_ID"], "user_id" => $arBlog["OWNER_ID"]));
             $arBlog["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"]));
             $arBlog["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arBlog["OWNER_ID"]));
             $arBlog["AuthorName"] = CBlogUser::GetUserName($arBlog["BLOG_USER_ALIAS"], $arBlog["OWNER_NAME"], $arBlog["OWNER_LAST_NAME"], $arBlog["OWNER_LOGIN"]);
             $arBlog["BLOG_USER_AVATAR_ARRAY"] = CFile::GetFileArray($arBlog["BLOG_USER_AVATAR"]);
             if ($arBlog["BLOG_USER_AVATAR_ARRAY"] !== false) {
                 $arBlog["Avatar_resized"] = CFile::ResizeImageGet($arBlog["BLOG_USER_AVATAR_ARRAY"], array("width" => 100, "height" => 100), BX_RESIZE_IMAGE_EXACT, false);
                 $arBlog["BLOG_USER_AVATAR_IMG"] = CFile::ShowImage($arBlog["Avatar_resized"]["src"], 100, 100, 'align="right"');
             }
             $arBlog["LAST_POST_DATE_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arBlog["LAST_POST_DATE"], CSite::GetDateFormat("FULL")));
             $arResult["BLOG"][] = $arBlog;
         }
         if ($arParams["CACHE_TIME"] > 0) {
             $cache->EndDataCache(array("templateCachedData" => $this->GetTemplateCachedData(), "arResult" => $arResult));
         }
     }
 } else {
     $arResult["FATAL_ERROR"] = GetMessage("B_B_GR_NO_GROUP");
     CHTTP::SetStatus("404 Not Found");
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: array

 }
 if ($ID > 0) {
     // Проверяем: новая запись или изменение старой
     $newID = CBlogPost::Update($ID, $arFields);
 } else {
     $arFields['=DATE_CREATE'] = $DB->GetNowFunction();
     $arFields['AUTHOR_ID'] = $USER_ID;
     $arFields['BLOG_ID'] = $BLOG_ID;
     $newID = CBlogPost::Add($arFields);
     if ($newID && $arBlog['EMAIL_NOTIFY'] == 'Y' && $USER_ID != $arBlog['OWNER_ID']) {
         $BlogUser = CBlogUser::GetByID($USER_ID, BLOG_BY_USER_ID);
         $res = CUser::GetByID($arBlog['OWNER_ID']);
         $arOwner = $res->Fetch();
         $dbUser = CUser::GetByID($USER_ID);
         $arUser = $dbUser->Fetch();
         $AuthorName = CBlogUser::GetUserName($BlogUser["ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"]);
         CEvent::Send("NEW_BLOG_MESSAGE", SITE_ID, array("BLOG_ID" => $BLOG_ID, "BLOG_NAME" => $arBlog['NAME'], "BLOG_URL" => $arBlog['URL'], "MESSAGE_TITLE" => $_POST['POST_TITLE'], "MESSAGE_TEXT" => $_POST['POST_MESSAGE'], "MESSAGE_DATE" => $DATE_PUBLISH, "MESSAGE_PATH" => "http://" . (COption::GetOptionString("main", "server_name") . $sBlogPath . "/" . ($is404 ? $arBlog['URL'] . "/" . $newID . ".php" : "post.php?blog=" . $arBlog['URL'] . "&post_id=" . $newID)), "AUTHOR" => $AuthorName, "EMAIL_FROM" => COption::GetOptionString("main", "email_from", "nobody@nobody.com"), "EMAIL_TO" => $arOwner['EMAIL']));
     }
 }
 if ($newID > 0) {
     $DB->Query("UPDATE b_blog_image SET POST_ID='{$newID}' WHERE BLOG_ID={$BLOG_ID} AND POST_ID=0", true);
     if (strlen($TRACKBACK) > 0) {
         $arPingUrls = explode("\n", $TRACKBACK);
         CBlogTrackback::SendPing($newID, $arPingUrls);
     }
     BXClearCache(True, "/" . SITE_ID . "/blog/" . $arBlog['URL'] . "/first_page/");
     BXClearCache(True, "/" . SITE_ID . "/blog/" . $arBlog['URL'] . "/calendar/");
     BXClearCache(True, "/" . SITE_ID . "/blog/last_messages/");
     BXClearCache(True, "/" . SITE_ID . "/blog/groups/" . $arBlog['GROUP_ID'] . "/");
     BXClearCache(True, "/" . SITE_ID . "/blog/" . $arBlog['URL'] . "/trackback/" . $ID . "/");
     BXClearCache(True, "/" . SITE_ID . "/blog/" . $arBlog['URL'] . "/comment/" . $ID . "/");
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: UpdateLog

	public static function UpdateLog($commentID, $arBlogUser, $arUser, $arComment, $arPost, $arParams)
	{
		if (!CModule::IncludeModule('socialnetwork'))
			return;

		$AuthorName = CBlogUser::GetUserName($arBlogUser["~ALIAS"], $arUser["~NAME"], $arUser["~LAST_NAME"], $arUser["~LOGIN"], $arUser["~SECOND_NAME"]);
		$parserBlog = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);

		$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
		$text4message = $parserBlog->convert($arComment["POST_TEXT"], false, $arParams["IMAGES"], $arAllow, array("isSonetLog"=>true));
		$text4mail = $parserBlog->convert4mail($arComment["POST_TEXT"], $arParams["IMAGES"]);

		$arSoFields = Array(
			"TITLE_TEMPLATE" => htmlspecialcharsback($AuthorName)." ".GetMessage("BLG_SONET_COMMENT_TITLE"),
			"TITLE" => $arPost['~TITLE'],
			"MESSAGE" => $text4message,
			"TEXT_MESSAGE" => $text4mail
		);

		$dbRes = CSocNetLogComments::GetList(
			array("ID" => "DESC"),
			array(
				"EVENT_ID"	=> array("blog_comment", "blog_comment_micro"),
				"SOURCE_ID" => $commentID
			),
			false,
			false,
			array("ID")
		);
		while ($arRes = $dbRes->Fetch())
			CSocNetLogComments::Update($arRes["ID"], $arSoFields);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:32,代码来源:blog_comment.php

示例4: array

     $arResult["IDS"] = $ids;
     if (!empty($arImgPosts)) {
         $dbImage = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arImgPosts, "IS_COMMENT" => "N"));
         while ($arImage = $dbImage->Fetch()) {
             if (empty($arResult[$arImage["POST_ID"]]["IMG"])) {
                 if ($file = CFile::ResizeImageGet($arImage["FILE_ID"], array("width" => $arParams["PREVIEW_WIDTH"], "height" => $arParams["PREVIEW_HEIGHT"]))) {
                     $arResult[$arImage["POST_ID"]]["IMG"] = CFile::ShowImage($file["src"], false, false, 'align="left" hspace="2" vspace="2"');
                 }
             }
         }
     }
     if (!empty($arUsrTmp)) {
         $dbUser = CUser::GetList($b = "ID", $o = "DESC", array("ID" => implode(' | ', $arUsrTmp)), array("FIELDS" => array("ID", "LOGIN", "NAME", "LAST_NAME", "SECOND_NAME", "PERSONAL_PHOTO")));
         while ($arUser = $dbUser->GetNext()) {
             $urlToAuthor = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUser["ID"]));
             $AuthorName = CBlogUser::GetUserName($arUsrTmpAlias[$arUser["ID"]], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"], $arUser["SECOND_NAME"]);
             foreach ($arUsrTmpPostId[$arUser["ID"]] as $postId) {
                 $arResult[$postId]["arUser"] = $arUser;
                 $arResult[$postId]["urlToAuthor"] = $urlToAuthor;
                 $arResult[$postId]["AuthorName"] = $AuthorName;
                 $arResult[$postId]["~AUTHOR_LOGIN"] = $arUser["~LOGIN"];
                 $arResult[$postId]["~AUTHOR_SECOND_NAME"] = $arUser["~SECOND_NAME"];
                 $arResult[$postId]["~AUTHOR_LAST_NAME"] = $arUser["~LAST_NAME"];
                 $arResult[$postId]["~AUTHOR_NAME"] = $arUser["~NAME"];
             }
         }
     }
 }
 if ($arParams["CACHE_TIME"] > 0) {
     $cache->EndDataCache(array("templateCachedData" => $this->GetTemplateCachedData(), "arResult" => $arResult));
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: OnSearchReindex


//.........这里部分代码省略.........
                         $socnetPerms = $arF["SC_PERM"];
                         if (!in_array("U" . $ar["AUTHOR_ID"], $socnetPerms)) {
                             $socnetPerms[] = "U" . $ar["AUTHOR_ID"];
                         }
                         $socnetPerms[] = "SA";
                         // socnet admin
                         CSocNetLogRights::DeleteByLogID($ar["SLID"]);
                         CSocNetLogRights::Add($ar["SLID"], $socnetPerms);
                     }
                 }
             }
             if ($ar["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH && $ar["SEARCH_INDEX"] == "Y") {
                 //CBlogSearch::Trace('OnSearchReindex', 'Result', $Result);
                 if ($oCallback) {
                     $res = call_user_func(array($oCallback, $callback_method), $Result);
                     if (!$res) {
                         return $Result["ID"];
                     }
                 } else {
                     $arResult[] = $Result;
                 }
             }
         }
         //all blog posts indexed so let's start index users
         $category = 'C';
         $id = 0;
         COption::SetOptionString("blog", "socNetNewPerms", "Y");
     }
     if ($category == 'C') {
         $strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\tbc.ID\n\t\t\t\t\t,bg.SITE_ID\n\t\t\t\t\t,bp.ID as POST_ID\n\t\t\t\t\t,b.URL\n\t\t\t\t\t,bp.TITLE as POST_TITLE\n\t\t\t\t\t,b.OWNER_ID\n\t\t\t\t\t,b.SOCNET_GROUP_ID\n\t\t\t\t\t,bc.TITLE\n\t\t\t\t\t,bc.POST_TEXT\n\t\t\t\t\t,bc.POST_ID\n\t\t\t\t\t,bc.BLOG_ID\n\t\t\t\t\t,b.USE_SOCNET\n\t\t\t\t\t,b.SEARCH_INDEX\n\t\t\t\t\t,bc.PATH\n\t\t\t\t\t," . $DB->DateToCharFunction("bc.DATE_CREATE") . " as DATE_CREATE\n\t\t\t\t\t,bc.AUTHOR_ID\n\t\t\t\tFROM\n\t\t\t\t\tb_blog_comment bc\n\t\t\t\t\tINNER JOIN b_blog_post bp ON (bp.ID = bc.POST_ID)\n\t\t\t\t\tINNER JOIN b_blog b ON (bc.BLOG_ID = b.ID)\n\t\t\t\t\tINNER JOIN b_blog_group bg ON (b.GROUP_ID = bg.ID)\n\t\t\t\tWHERE\n\t\t\t\t\tbc.ID > " . $id . " \n\t\t\t\t\t" . ($NS["SITE_ID"] != "" ? " AND bg.SITE_ID='" . $DB->ForSQL($NS["SITE_ID"]) . "'" : "") . "\n\t\t\t\t\tAND b.SEARCH_INDEX = 'Y'\n\t\t\t\tORDER BY\n\t\t\t\t\tbc.ID\n\t\t\t";
         //CBlogSearch::Trace('OnSearchReindex', 'strSql', $strSql);
         $rs = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         while ($ar = $rs->Fetch()) {
             //Check permissions
             $tag = "";
             $PostPerms = CBlogUserGroup::GetGroupPerms(1, $ar["BLOG_ID"], $ar["POST_ID"], BLOG_PERMS_POST);
             if ($PostPerms < BLOG_PERMS_READ) {
                 continue;
             }
             //CBlogSearch::Trace('OnSearchReindex', 'ar', $ar);
             if (strlen($ar["PATH"]) > 0) {
                 $arSite = array($ar["SITE_ID"] => str_replace("#comment_id#", $ar["ID"], $ar["PATH"]));
             } else {
                 $arSite = array($ar["SITE_ID"] => CBlogPost::PreparePath($ar["URL"], $ar["POST_ID"], $ar["SITE_ID"], false, $ar["OWNER_ID"], $ar["SOCNET_GROUP_ID"]));
             }
             $Result = array("ID" => "C" . $ar["ID"], "SITE_ID" => $arSite, "LAST_MODIFIED" => $ar["DATE_CREATE"], "PARAM1" => "COMMENT", "PARAM2" => $ar["BLOG_ID"] . "|" . $ar["POST_ID"], "PERMISSIONS" => array(2), "TITLE" => $ar["TITLE"], "BODY" => blogTextParser::killAllTags($ar["POST_TEXT"]), "INDEX_TITLE" => false, "USER_ID" => IntVal($ar["AUTHOR_ID"]) > 0 ? $ar["AUTHOR_ID"] : false, "ENTITY_TYPE_ID" => "BLOG_COMMENT", "ENTITY_ID" => $ar["ID"]);
             if ($ar["USE_SOCNET"] == "Y") {
                 $arSp = CBlogComment::GetSocNetCommentPerms($ar["POST_ID"]);
                 if (is_array($arSp)) {
                     $Result["PERMISSIONS"] = $arSp;
                 }
             }
             if (strlen($ar["TITLE"]) <= 0) {
                 $Result["TITLE"] = substr($Result["BODY"], 0, 100);
             }
             if ($oCallback) {
                 $res = call_user_func(array($oCallback, $callback_method), $Result);
                 if (!$res) {
                     return $Result["ID"];
                 }
             } else {
                 $arResult[] = $Result;
             }
         }
         //all blog posts indexed so let's start index users
         $category = 'U';
         $id = 0;
     }
     if ($category == 'U') {
         $strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\tbu.ID\n\t\t\t\t\t,bg.SITE_ID\n\t\t\t\t\t," . $DB->DateToCharFunction("bu.LAST_VISIT") . " as LAST_VISIT\n\t\t\t\t\t," . $DB->DateToCharFunction("u.DATE_REGISTER") . " as DATE_REGISTER\n\t\t\t\t\t,bu.ALIAS\n\t\t\t\t\t,bu.DESCRIPTION\n\t\t\t\t\t,bu.INTERESTS\n\t\t\t\t\t,u.NAME\n\t\t\t\t\t,u.LAST_NAME\n\t\t\t\t\t,u.LOGIN\n\t\t\t\t\t,bu.USER_ID\n\t\t\t\t\t,b.OWNER_ID\n\t\t\t\t\t,b.USE_SOCNET\n\t\t\t\t\t,b.SEARCH_INDEX\n\t\t\t\tFROM\n\t\t\t\t\tb_blog_user bu\n\t\t\t\t\tINNER JOIN b_user u  ON (u.ID = bu.USER_ID)\n\t\t\t\t\tINNER JOIN b_blog b ON (u.ID = b.OWNER_ID)\n\t\t\t\t\tINNER JOIN b_blog_group bg ON (b.GROUP_ID = bg.ID)\n\t\t\t\tWHERE\n\t\t\t\t\tb.ACTIVE = 'Y'\n\t\t\t\t\t" . ($NS["SITE_ID"] != "" ? "AND bg.SITE_ID='" . $DB->ForSQL($NS["SITE_ID"]) . "'" : "") . "\n\t\t\t\t\tAND bu.ID > " . $id . "\n\t\t\t\t\tAND b.SEARCH_INDEX = 'Y'\n\t\t\t\tORDER BY\n\t\t\t\t\tbu.ID\n\t\t\t";
         //CBlogSearch::Trace('OnSearchReindex', 'strSql', $strSql);
         $rs = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         while ($ar = $rs->Fetch()) {
             if ($ar["USE_SOCNET"] == "Y") {
                 $Result = array("ID" => "U" . $ar["ID"], "BODY" => "", "TITLE" => "");
             } else {
                 //CBlogSearch::Trace('OnSearchReindex', 'ar', $ar);
                 $arSite = array($ar["SITE_ID"] => CBlogUser::PreparePath($ar["USER_ID"], $ar["SITE_ID"]));
                 //CBlogSearch::Trace('OnSearchReindex', 'arSite', $arSite);
                 $Result = array("ID" => "U" . $ar["ID"], "LAST_MODIFIED" => $ar["LAST_VISIT"], "TITLE" => CBlogUser::GetUserName($ar["ALIAS"], $ar["NAME"], $ar["LAST_NAME"], $ar["LOGIN"]), "BODY" => blogTextParser::killAllTags($ar["DESCRIPTION"] . " " . $ar["INTERESTS"]), "SITE_ID" => $arSite, "PARAM1" => "USER", "PARAM2" => $ar["ID"], "PERMISSIONS" => array(2));
                 if (strlen($Result["LAST_MODIFIED"]) <= 0) {
                     $Result["LAST_MODIFIED"] = $ar["DATE_REGISTER"];
                 }
             }
             //CBlogSearch::Trace('OnSearchReindex', 'Result', $Result);
             if ($oCallback) {
                 $res = call_user_func(array($oCallback, $callback_method), $Result);
                 if (!$res) {
                     return $Result["ID"];
                 }
             } else {
                 $arResult[] = $Result;
             }
         }
     }
     if ($oCallback) {
         return false;
     }
     return $arResult;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:blog_search.php

示例6: array

        CSocNetLog::Update($logID, array("TMP_ID" => $logID));
        CSocNetLogRights::DeleteByLogID($logID);
        CSocNetLogRights::Add($logID, $socnetPerms);
    }
}
foreach ($categoryID as $v) {
    CBlogPostCategory::Add(array("BLOG_ID" => $blogID, "POST_ID" => $postID, "CATEGORY_ID" => $v));
}
$arBlogCommentFields = array("TITLE" => GetMessage("BLOG_DEMO_COMMENT_TITLE"), "POST_TEXT" => GetMessage("BLOG_DEMO_COMMENT_BODY"), "BLOG_ID" => $blogID, "POST_ID" => $postID, "PARENT_ID" => 0, "AUTHOR_ID" => 1, "DATE_CREATE" => ConvertTimeStamp(false, "FULL"), "AUTHOR_IP" => "192.168.0.108");
$commmentId = CBlogComment::Add($arBlogCommentFields);
if (CModule::IncludeModule("socialnetwork")) {
    $arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
    $text4message = $parserBlog->convert($arBlogCommentFields["POST_TEXT"], false, array(), $arAllow);
    $text4mail = $parserBlog->convert4mail($arBlogCommentFields["POST_TEXT"]);
    $arBlogUser = CBlogUser::GetByID(1, BLOG_BY_USER_ID);
    $arBlogUser = CBlogTools::htmlspecialcharsExArray($arBlogUser);
    $AuthorName = CBlogUser::GetUserName($arBlogUser["~ALIAS"], $arUser["~NAME"], $arUser["~LAST_NAME"], $arUser["~LOGIN"]);
    $commentUrl = CComponentEngine::MakePathFromTemplate(WIZARD_SITE_DIR . "company/personal/user/#user_id#/blog/#post_id#/", array("post_id" => $postID, "user_id" => 1));
    if (strpos($commentUrl, "?") !== false) {
        $commentUrl .= "&";
    } else {
        $commentUrl .= "?";
    }
    $commentUrl .= "commentId=" . $commmentId . "#" . $commmentId;
    $arSoFields = array("ENTITY_TYPE" => "U", "ENTITY_ID" => 1, "EVENT_ID" => "blog_comment", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "URL" => $commentUrl, "MODULE_ID" => false, "SOURCE_ID" => $commmentId, "USER_ID" => 1, "LOG_ID" => $logID, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => intval($commmentId));
    CSocNetLogComments::Add($arSoFields);
}
//CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH."/community/index.php", Array("SONET_GROUP_ID" => $SocNetGroupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/company/personal.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:index.php

示例7: Update

 function Update($ID, $arFields)
 {
     global $DB;
     $ID = IntVal($ID);
     $arFields1 = array();
     foreach ($arFields as $key => $value) {
         if (substr($key, 0, 1) == "=") {
             $arFields1[substr($key, 1)] = $value;
             unset($arFields[$key]);
         }
     }
     if (!CBlogUser::CheckFields("UPDATE", $arFields, $ID)) {
         return false;
     }
     $strUpdate = $DB->PrepareUpdate("b_blog_user", $arFields, "blog/avatar");
     foreach ($arFields1 as $key => $value) {
         if (strlen($strUpdate) > 0) {
             $strUpdate .= ", ";
         }
         $strUpdate .= $key . "=" . $value . " ";
     }
     if (strlen($strUpdate) > 0) {
         $arUser = CBlogUser::GetByID($ID, BLOG_BY_BLOG_USER_ID);
         $strSql = "UPDATE b_blog_user SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
         $DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         unset($GLOBALS["BLOG_USER_CACHE_" . $ID]);
         unset($GLOBALS["BLOG_USER1_CACHE_" . $arUser["USER_ID"]]);
     } else {
         $ID = false;
     }
     if ($ID && !(count($arFields1) == 1 && strlen($arFields1["LAST_VISIT"]) > 0)) {
         if (CModule::IncludeModule("search")) {
             $arBlogUser = CBlogUser::GetByID($ID);
             $dbUser = CUser::GetByID($arBlogUser["USER_ID"]);
             $arUser = $dbUser->Fetch();
             $arBlog = CBlog::GetByOwnerID($arBlogUser["USER_ID"]);
             if ($arBlog) {
                 $arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
                 $arPostSite = array($arGroup["SITE_ID"] => CBlogUser::PreparePath($arBlogUser["USER_ID"], $arGroup["SITE_ID"]));
             } else {
                 $arPostSite = array(SITE_ID => CBlogUser::PreparePath($arBlogUser["USER_ID"], SITE_ID));
             }
             if (strlen($arBlogUser["LAST_VISIT"]) <= 0) {
                 $arBlogUser["LAST_VISIT"] = ConvertTimeStamp(false, "FULL", false);
             }
             $arSearchIndex = array("SITE_ID" => $arPostSite, "LAST_MODIFIED" => $arBlogUser["LAST_VISIT"], "PARAM1" => "USER", "PARAM2" => $arBlogUser["USER_ID"], "PERMISSIONS" => array(2), "TITLE" => CBlogUser::GetUserName($arBlogUser["ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"]), "BODY" => blogTextParser::killAllTags($arBlogUser["INTERESTS"] . " " . $arBlogUser["DESCRIPTION"]));
             CSearch::Index("blog", "U" . $ID, $arSearchIndex);
         }
     }
     return $ID;
 }
开发者ID:,项目名称:,代码行数:51,代码来源:

示例8: Delete

 function Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     $bSuccess = True;
     $arUser = CBlogUser::GetByID($ID, BLOG_BY_USER_ID);
     if ($arUser) {
         $dbResult = CBlog::GetList(array(), array("OWNER_ID" => $arUser["USER_ID"]), false, false, array("ID"));
         if ($dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_OWNER"), "ERROR_OWNER");
             $bSuccess = False;
         }
         if ($bSuccess) {
             $dbResult = CBlogPost::GetList(array(), array("AUTHOR_ID" => $arUser["USER_ID"]), false, false, array("ID"));
             if ($arResult = $dbResult->Fetch()) {
                 if (!CBlogPost::Delete($arResult["ID"])) {
                     $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_AUTHOR"), "ERROR_AUTHOR");
                     $bSuccess = False;
                 }
             }
         }
         if ($bSuccess) {
             $dbGloUser = CUser::GetByID($arUser["USER_ID"]);
             $arGloUser = $dbGloUser->Fetch();
             $DB->Query("UPDATE b_blog_comment SET " . "\tAUTHOR_NAME = '" . $DB->ForSql(CBlogUser::GetUserName($arUser["ALIAS"], $arGloUser["NAME"], $arGloUser["LAST_NAME"], $arGloUser["LOGIN"], $arGloUser["SECOND_NAME"])) . "', " . "\tAUTHOR_ID = null " . "WHERE AUTHOR_ID = " . $arUser["USER_ID"] . "", true);
             $DB->Query("DELETE FROM b_blog_user2user_group WHERE USER_ID = " . $arUser["USER_ID"] . "", true);
         }
         if ($bSuccess) {
             $strSql = "SELECT F.ID " . "FROM b_blog_user FU, b_file F " . "WHERE FU.ID = " . $arUser["ID"] . " " . "\tAND FU.AVATAR = F.ID ";
             $z = $DB->Query($strSql, false, "FILE: " . __FILE__ . " LINE:" . __LINE__);
             while ($zr = $z->Fetch()) {
                 CFile::Delete($zr["ID"]);
             }
             if (CModule::IncludeModule("search")) {
                 CSearch::Index("blog", "U" . $arUser["ID"], array("TITLE" => "", "BODY" => ""));
             }
             unset($GLOBALS["BLOG_USER"]["BLOG_USER_CACHE_" . $arUser["ID"]]);
             unset($GLOBALS["BLOG_USER"]["BLOG_USER1_CACHE_" . $arUser["USER_ID"]]);
             unset($GLOBALS["BLOG_USER"]["BLOG_USER2GROUP_CACHE_" . $arUser["ID"]]);
             unset($GLOBALS["BLOG_USER"]["BLOG_USER2GROUP1_CACHE_" . $arUser["USER_ID"]]);
             return $DB->Query("DELETE FROM b_blog_user WHERE ID = " . $arUser["ID"] . "", true);
         }
         if (!$bSuccess) {
             return false;
         }
     }
     return True;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:48,代码来源:blog_user.php

示例9: LocalRedirect

                 if (strlen($GLOBALS["cancel"]) > 0) {
                     LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS"], array("blog" => $arBlog["URL"])));
                 }
                 if (empty($arBlogUser)) {
                     CBlogUser::Add(array("USER_ID" => $arUser["ID"], "=LAST_VISIT" => $DB->GetNowFunction(), "=DATE_REG" => $DB->GetNowFunction(), "ALLOW_POST" => "Y"));
                 }
                 CBlogUser::AddToUserGroup($arUser["ID"], $arBlog["ID"], $GLOBALS["add2groups"], "", BLOG_BY_USER_ID, BLOG_CHANGE);
                 $dbCandidate = CBlogCandidate::GetList(array(), array("BLOG_ID" => $arBlog["ID"], "USER_ID" => $arUser["ID"]));
                 if ($arCandidate = $dbCandidate->Fetch()) {
                     CBlogCandidate::Delete($arCandidate["ID"]);
                 }
                 LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS"], array("blog" => $arBlog["URL"])));
             }
             $arResult["ERROR_MESSAGE"] = $errorMessage;
             $arResult["OK_MESSAGE"] = $okMessage;
             $arResult["userName"] = CBlogUser::GetUserName($arBlogUser["ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"]);
             $arResult["urlToUser"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUser["ID"]));
             $arResult["arUserGroups"] = CBlogUser::GetUserGroups($arUser["ID"], $arBlog["ID"], "Y", BLOG_BY_USER_ID);
             $dbBlogGroups = CBlogUserGroup::GetList(array("NAME" => "ASC"), array("BLOG_ID" => $arBlog["ID"]), false, false, array("ID", "NAME"));
             while ($arBlogGroups = $dbBlogGroups->GetNext()) {
                 $arResult["Groups"][] = $arBlogGroups;
             }
         } else {
             $arResult["FATAL_ERROR"] = GetMessage("B_B_US_NO_RIGHT");
         }
     } else {
         $arResult["FATAL_ERROR"] = GetMessage("B_B_US_NO_BLOG");
     }
 } else {
     $arResult["FATAL_ERROR"] = GetMessage("B_B_US_NO_BLOG");
 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例10: GetRSS


//.........这里部分代码省略.........
         $arSettings["RSS"] .= "<" . "?xml version=\"1.0\" encoding=\"" . $arSettings["CHARSET"] . "\"?" . ">\n\n";
         $arSettings["RSS"] .= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\" xml:lang=\"" . $arSettings["LANGUAGE"] . "\">\n";
         $arSettings["RSS"] .= "  <title>" . $arSettings["BLOG_NAME"] . "</title>\n";
         $arSettings["RSS"] .= "  <tagline>" . $arSettings["BLOG_URL"] . "</tagline>\n";
         $arSettings["RSS"] .= "  <id>" . $atomID . "</id>\n";
         $arSettings["RSS"] .= "  <link rel=\"alternate\" type=\"text/html\" href=\"" . $arSettings["BLOG_URL"] . "\" />\n";
         $arSettings["RSS"] .= "  <copyright>Copyright (c) " . $arSettings["SERVER_NAME"] . "</copyright>\n";
         $arSettings["RSS"] .= "  <modified>" . $arSettings["NOW_ISO"] . "</modified>\n";
         $arSettings["RSS"] .= "\n";
     }
     $arParserParams = array("imageWidth" => $arPathTemplates["IMAGE_MAX_WIDTH"], "imageHeight" => $arPathTemplates["IMAGE_MAX_HEIGHT"]);
     //Text Parser
     $parser = new blogTextParser();
     //SELECT
     $arSelFields = array("ID", "TITLE", "DETAIL_TEXT", "DATE_PUBLISH", "AUTHOR_ID", "BLOG_USER_ALIAS", "BLOG_ID", "DETAIL_TEXT_TYPE", "BLOG_URL", "BLOG_OWNER_ID", "BLOG_SOCNET_GROUP_ID", "BLOG_GROUP_SITE_ID", "CODE", self::UFCategroryCodeField);
     //WHERE
     $arFilter = array("<=DATE_PUBLISH" => ConvertTimeStamp(false, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "BLOG_ENABLE_RSS" => "Y", "MICRO" => "N");
     if (intval($arSettings["BLOG_CODE"]) === $arSettings["BLOG_CODE"]) {
         $arFilter["BLOG_ID"] = $arSettings["BLOG_CODE"];
     } else {
         $arFilter["BLOG_URL"] = $arSettings["BLOG_CODE"];
     }
     //Extend standart filter
     $arFilter = array_merge($arFilter, $arFilterExt);
     CTimeZone::Disable();
     $dbPosts = CBlogPost::GetList(array("DATE_PUBLISH" => "DESC"), $arFilter, false, array("nTopCount" => $numPosts), $arSelFields);
     CTimeZone::Enable();
     while ($arPost = $dbPosts->Fetch()) {
         //Can read
         if (CBlogPost::GetBlogUserPostPerms($arPost["ID"], $arSettings["CURRENT_USER_ID"]) < BLOG_PERMS_READ) {
             continue;
         }
         $arAuthorUser = $USER->GetByID($arPost["AUTHOR_ID"])->Fetch();
         $author = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arAuthorUser["NAME"], $arAuthorUser["LAST_NAME"], $arAuthorUser["LOGIN"], $arAuthorUser["SECOND_NAME"]);
         $title = str_replace(array("&", "<", ">", "\""), array("&amp;", "&lt;", "&gt;", "&quot;"), $author . ": " . $arPost["TITLE"]);
         //Idea Images
         $arImages = array();
         $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "IS_COMMENT" => "N"));
         while ($arImage = $res->Fetch()) {
             $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         }
         $arDate = ParseDateTime($arPost["DATE_PUBLISH"], CSite::GetDateFormat("FULL", $arPost["BLOG_GROUP_SITE_ID"]));
         $date = date("r", mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
         if (!empty($arPathTemplates)) {
             $url = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CComponentEngine::MakePathFromTemplate($arPathTemplates["BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplates["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $url = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CBlogPost::PreparePath(htmlspecialcharsbx($arPost["BLOG_URL"]), $arPost["ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         $category = "";
         if (isset($arPost[self::UFCategroryCodeField]) && is_array($arSettings["CATEGORIES"][ToUpper($arPost[self::UFCategroryCodeField])])) {
             $category = htmlspecialcharsbx($arSettings["CATEGORIES"][ToUpper($arPost[self::UFCategroryCodeField])]["NAME"]);
         }
         if (strlen($arPathTemplates["USER"]) > 0) {
             $authorURL = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CComponentEngine::MakePathFromTemplate($arPathTemplates["USER"], array("user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $authorURL = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CBlogUser::PreparePath($arPost["AUTHOR_ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         if ($arPost["DETAIL_TEXT_TYPE"] == "html") {
             $IdeaText = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "QUOTE" => "Y", "CODE" => "Y"), true, $arParserParams);
         } else {
             $IdeaText = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, false, true, $arParserParams);
         }
         $IdeaText .= "<br /><a href=\"" . $url . "\">" . GetMessage("BLG_GB_RSS_DETAIL") . "</a>";
         $IdeaText = "<![CDATA[" . $IdeaText . "]]>";
         if ($arSettings["RSS_TYPE"] == "rss.92") {
             $arSettings["RSS"] .= "\t<item>\n";
开发者ID:rasuldev,项目名称:torino,代码行数:67,代码来源:idea.php

示例11: array

 $arComment["ShowIP"] = $arResult["ShowIP"];
 if (empty($resComments[IntVal($arComment["PARENT_ID"])])) {
     $resComments[IntVal($arComment["PARENT_ID"])] = array();
     if (strlen($arResult["firstLevel"]) <= 0) {
         $arResult["firstLevel"] = IntVal($arComment["PARENT_ID"]);
     }
 }
 if (IntVal($arComment["AUTHOR_ID"]) > 0) {
     if (empty($arResult["USER_CACHE"][$arComment["AUTHOR_ID"]])) {
         $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"], $arUsrTmp["arUser"]["SECOND_NAME"]);
         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"];
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例12: array

     if ($arResult["allowVideo"] != "Y") {
         $arAllow["VIDEO"] = "N";
     }
     $arResult["postPreview"]["textFormated"] = $p->convert($arResult["postPreview"]["~DETAIL_TEXT"], false, $arImages, $arAllow, $arParserParams);
 } else {
     $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y");
     if ($arResult["allowVideo"] != "Y") {
         $arAllow["VIDEO"] = "N";
     }
     $arResult["postPreview"]["textFormated"] = $p->convert($arResult["postPreview"]["DETAIL_TEXT"], false, $arImages, $arAllow, $arParserParams);
 }
 $arResult["postPreview"]["BlogUser"] = CBlogUser::GetByID($arResult["UserID"], BLOG_BY_USER_ID);
 $arResult["postPreview"]["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arResult["postPreview"]["BlogUser"]);
 $dbUser = CUser::GetByID($arResult["UserID"]);
 $arResult["postPreview"]["arUser"] = $dbUser->GetNext();
 $arResult["postPreview"]["AuthorName"] = CBlogUser::GetUserName($arResult["postPreview"]["BlogUser"]["ALIAS"], $arResult["postPreview"]["arUser"]["NAME"], $arResult["postPreview"]["arUser"]["LAST_NAME"], $arResult["postPreview"]["arUser"]["LOGIN"]);
 $arResult["postPreview"]["BlogUser"]["AVATAR_file"] = CFile::GetFileArray($arResult["postPreview"]["BlogUser"]["AVATAR"]);
 if ($arResult["postPreview"]["BlogUser"]["AVATAR_file"] !== false) {
     $arResult["postPreview"]["BlogUser"]["Avatar_resized"] = CFile::ResizeImageGet($arResult["postPreview"]["BlogUser"]["AVATAR_file"], array("width" => 100, "height" => 100), BX_RESIZE_IMAGE_EXACT, false);
     $arResult["postPreview"]["BlogUser"]["AVATAR_img"] = CFile::ShowImage($arResult["postPreview"]["BlogUser"]["Avatar_resized"]["src"], 100, 100, "border=0 align='right'");
 }
 if (strlen($arResult["PostToShow"]["CategoryText"]) > 0) {
     $arCatTmp = explode(",", $arResult["PostToShow"]["CategoryText"]);
     if (is_array($arCatTmp)) {
         foreach ($arCatTmp as $v) {
             $arResult["postPreview"]["Category"][] = array("NAME" => htmlspecialcharsbx(trim($v)));
         }
     }
 } elseif (strlen($arResult["postPreview"]["CATEGORY_ID"]) > 0) {
     foreach ($arResult["postPreview"]["CATEGORY_ID"] as $v) {
         if (strlen($v) > 0) {
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例13: BuildRSSAll


//.........这里部分代码省略.........
         $rssText .= "  <modified>" . $nowISO . "</modified>\n";
         $rssText .= "\n";
     }
     $parser = new blogTextParser();
     $arParserParams = array("imageWidth" => $arPathTemplates["IMAGE_MAX_WIDTH"], "imageHeight" => $arPathTemplates["IMAGE_MAX_HEIGHT"]);
     $arFilter = array("<=DATE_PUBLISH" => ConvertTimeStamp(false, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "BLOG_ENABLE_RSS" => "Y", "MICRO" => "N");
     $arSelFields = array("ID", "TITLE", "DETAIL_TEXT", "DATE_PUBLISH", "AUTHOR_ID", "BLOG_USER_ALIAS", "BLOG_ID", "DETAIL_TEXT_TYPE", "BLOG_URL", "BLOG_OWNER_ID", "BLOG_SOCNET_GROUP_ID", "BLOG_GROUP_SITE_ID", "CODE", "PATH");
     if (!empty($arGroup)) {
         $arFilter["BLOG_GROUP_ID"] = $arGroup["ID"];
     } elseif (count($arGroupID) > 0) {
         $arFilter["BLOG_GROUP_ID"] = $arGroupID;
     }
     if (count($arAvBlog) > 0) {
         $arFilter["BLOG_ID"] = $arAvBlog;
     }
     if ($siteID !== false) {
         $arFilter["BLOG_GROUP_SITE_ID"] = $siteID;
     }
     if ($bUserSocNet == "Y") {
         $arFilter["BLOG_USE_SOCNET"] = "Y";
         $arFilter["FOR_USER"] = $user_id;
         unset($arFilter["MICRO"]);
     }
     CTimeZone::Disable();
     $dbPosts = CBlogPost::GetList(array("DATE_PUBLISH" => "DESC"), $arFilter, false, array("nTopCount" => $numPosts), $arSelFields);
     CTimeZone::Enable();
     while ($arPost = $dbPosts->Fetch()) {
         $perms = CBlogPost::GetBlogUserPostPerms($arPost["ID"], $GLOBALS["USER"]->IsAuthorized() ? $GLOBALS["USER"]->GetID() : 0);
         if ($perms < BLOG_PERMS_READ) {
             continue;
         }
         $dbUser = CUser::GetByID($arPost["AUTHOR_ID"]);
         $arUser = $dbUser->Fetch();
         $author = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"], $arUser["SECOND_NAME"]);
         $title = str_replace(array("&", "<", ">", "\""), array("&amp;", "&lt;", "&gt;", "&quot;"), $author . ": " . $arPost["TITLE"]);
         $arImages = array();
         $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "IS_COMMENT" => "N"));
         while ($arImage = $res->Fetch()) {
             $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         }
         $arDate = ParseDateTime($arPost["DATE_PUBLISH"], CSite::GetDateFormat("FULL", $arPost["BLOG_GROUP_SITE_ID"]));
         $date = date("r", mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
         if (strlen($arPost["PATH"]) > 0) {
             $url = htmlspecialcharsbx("http://" . $serverName . str_replace("#post_id#", CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), $arPost["PATH"]));
         } elseif (!empty($arPathTemplates)) {
             if (IntVal($arPost["BLOG_SOCNET_GROUP_ID"]) > 0 && strlen($arPathTemplates["GROUP_BLOG_POST"]) > 0) {
                 $url = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPathTemplates["GROUP_BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplates["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
             } else {
                 $url = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPathTemplates["BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplates["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
             }
         } elseif (strLen($postTemplate) > 0) {
             $url = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($postTemplate, array("blog" => $arPost["BLOG_URL"], "post_id" => $arPost["ID"], "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $url = htmlspecialcharsbx("http://" . $serverName . CBlogPost::PreparePath(htmlspecialcharsbx($arPost["BLOG_URL"]), $arPost["ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         $category = htmlspecialcharsbx($arPost["CATEGORY_NAME"]);
         if (strlen($arPathTemplates["USER"]) > 0) {
             $authorURL = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPathTemplates["USER"], array("user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } elseif (strLen($userTemplate) > 0) {
             $authorURL = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($userTemplate, array("user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $authorURL = htmlspecialcharsbx("http://" . $serverName . CBlogUser::PreparePath($arPost["AUTHOR_ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         if ($arPost["DETAIL_TEXT_TYPE"] == "html") {
             $text = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "QUOTE" => "Y", "CODE" => "Y"), true, $arParserParams);
         } else {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:67,代码来源:blog.php

示例14: strLen

             }
             $arPostField["EDIT_FORM_LABEL"] = strLen($arPostField["EDIT_FORM_LABEL"]) > 0 ? $arPostField["EDIT_FORM_LABEL"] : $arPostField["FIELD_NAME"];
             $arPostField["EDIT_FORM_LABEL"] = htmlspecialcharsEx($arPostField["EDIT_FORM_LABEL"]);
             $arPostField["~EDIT_FORM_LABEL"] = $arPostField["EDIT_FORM_LABEL"];
             $arPost["POST_PROPERTIES"]["DATA"][$FIELD_NAME] = $arPostField;
         }
     }
     if (!empty($arPost["POST_PROPERTIES"]["DATA"])) {
         $arPost["POST_PROPERTIES"]["SHOW"] = "Y";
     }
 }
 $arPost["BlogUser"] = CBlogUser::GetByID($arPost["AUTHOR_ID"], BLOG_BY_USER_ID);
 $arPost["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arPost["BlogUser"]);
 $dbUser = CUser::GetByID($arPost["AUTHOR_ID"]);
 $arPost["arUser"] = $dbUser->GetNext();
 $arPost["AuthorName"] = CBlogUser::GetUserName($arPost["BlogUser"]["ALIAS"], $arPost["arUser"]["NAME"], $arPost["arUser"]["LAST_NAME"], $arPost["arUser"]["LOGIN"]);
 if (preg_match("/(\\[CUT\\])/i", $arPost["DETAIL_TEXT"]) || preg_match("/(<CUT>)/i", $arPost["DETAIL_TEXT"])) {
     $arPost["CUT"] = "Y";
 }
 if (strlen($arPost["CATEGORY_ID"]) > 0) {
     $arCategory = explode(",", $arPost["CATEGORY_ID"]);
     foreach ($arCategory as $v) {
         if (IntVal($v) > 0) {
             $arCatTmp = CBlogTools::htmlspecialcharsExArray(CBlogCategory::GetByID($v));
             $arCatTmp["urlToCategory"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_CATEGORY"], array("blog" => $arBlog["URL"], "category_id" => $v));
             $arPost["Category"][] = $arCatTmp;
         }
     }
 }
 $arPost["DATE_PUBLISH_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arPost["DATE_PUBLISH"], CSite::GetDateFormat("FULL")));
 $arResult["FRIENDS_POSTS"][] = array("POST" => $arPost, "BLOG" => $arBlog);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例15: IsModuleInstalled

     CSocNetLogComponent::saveRawFilesToUF($_POST["attachedFilesRaw"], IsModuleInstalled("webdav") || IsModuleInstalled("disk") ? "UF_BLOG_COMMENT_FILE" : "UF_BLOG_COMMENT_DOC", $arFields);
 }
 if ($commentID = CBlogComment::Update($commentID, $arFields)) {
     BXClearCache(true, "/blog/comment/" . intval($arParams["ID"] / 100) . "/" . $arParams["ID"] . "/");
     $images = array();
     $res = CBlogImage::GetList(array(), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "COMMENT_ID" => $commentID, "IS_COMMENT" => "Y"));
     while ($aImg = $res->Fetch()) {
         $images[$aImg["ID"]] = $aImg["FILE_ID"];
     }
     $arParamsUpdateLog = array("PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "IMAGES" => $images);
     if (IntVal($user_id) > 0) {
         $arResult["BlogUser"] = CBlogUser::GetByID($user_id, BLOG_BY_USER_ID);
         $arResult["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arResult["BlogUser"]);
         $dbUser = CUser::GetByID($user_id);
         $arResult["arUser"] = $dbUser->GetNext();
         $arResult["User"]["NAME"] = CBlogUser::GetUserName($arResult["BlogUser"]["ALIAS"], $arResult["arUser"]["NAME"], $arResult["arUser"]["LAST_NAME"], $arResult["arUser"]["LOGIN"]);
     }
     CBlogComment::UpdateLog($commentID, $arResult["BlogUser"], $arResult["User"], $arFields, $arPost, $arParamsUpdateLog);
     $res = CBlogImage::GetList(array(), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "Y", "COMMENT_ID" => false, "<=TIMESTAMP_X" => ConvertTimeStamp(AddToTimeStamp(array("HH" => -3)), "FULL")));
     while ($aImg = $res->Fetch()) {
         CBlogImage::Delete($aImg["ID"]);
     }
     $commentUrl = CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arBlog["OWNER_ID"]));
     $commentUrl .= strpos($commentUrl, "?") !== false ? "&" : "?";
     if (strlen($arFields["PUBLISH_STATUS"]) > 0 && $arFields["PUBLISH_STATUS"] != BLOG_PUBLISH_STATUS_PUBLISH) {
         $arResult["MESSAGE"] = GetMessage("B_B_PC_MES_HIDDEN_EDITED");
     }
     $arResult["ajax_comment"] = $commentID;
     $bHasImg = false;
     $bHasProps = false;
     $dbImg = CBlogImage::GetList(array(), array("BLOG_ID" => $arBlog["ID"], "POST_ID" => $arPost["ID"], "IS_COMMENT" => "Y"), false, false, array("ID"));
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php


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