本文整理汇总了PHP中CBlogUser::GetUserInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogUser::GetUserInfo方法的具体用法?PHP CBlogUser::GetUserInfo怎么用?PHP CBlogUser::GetUserInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogUser
的用法示例。
在下文中一共展示了CBlogUser::GetUserInfo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ToLower
$arResult["Post"]["DATE_PUBLISH_FORMATED"] = ToLower($arResult["Post"]["DATE_PUBLISH_FORMATED"]);
$arResult["Post"]["DATE_PUBLISH_DATE"] = ToLower($arResult["Post"]["DATE_PUBLISH_DATE"]);
}
// strip current year
if (!empty($arParams['DATE_TIME_FORMAT_S']) && ($arParams['DATE_TIME_FORMAT_S'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT_S'] == 'j F Y g:i a')) {
$arResult["Post"]["DATE_PUBLISH_FORMATED"] = ltrim($arResult["Post"]["DATE_PUBLISH_FORMATED"], '0');
$arResult["Post"]["DATE_PUBLISH_DATE"] = ltrim($arResult["Post"]["DATE_PUBLISH_DATE"], '0');
$curYear = date('Y');
$arResult["Post"]["DATE_PUBLISH_FORMATED"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arResult["Post"]["DATE_PUBLISH_FORMATED"]);
$arResult["Post"]["DATE_PUBLISH_DATE"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arResult["Post"]["DATE_PUBLISH_DATE"]);
}
$arResult["Post"]["DATE_PUBLISH_TIME"] = FormatDateFromDB($arResult["Post"]["DATE_PUBLISH"], strpos($arParams["DATE_TIME_FORMAT_S"], 'a') !== false || ($arParams["DATE_TIME_FORMAT_S"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'GG:MI');
if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
$arResult["Post"]["DATE_PUBLISH_TIME"] = ToLower($arResult["Post"]["DATE_PUBLISH_TIME"]);
}
$arResult["arUser"] = CBlogUser::GetUserInfo($arPost["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE" => isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"], "AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"]));
$arResult["arUser"]["isExtranet"] = intval($arPost["AUTHOR_ID"]) > 0 && is_array($GLOBALS["arExtranetUserID"]) && in_array($arPost["AUTHOR_ID"], $GLOBALS["arExtranetUserID"]);
$arResult["Post"]["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arPost["AUTHOR_ID"]));
if (strlen($arPost["CATEGORY_ID"]) > 0) {
$bHasTag = true;
$arCategory = explode(",", $arPost["CATEGORY_ID"]);
$dbCategory = CBlogCategory::GetList(array(), array("@ID" => $arCategory));
while ($arCatTmp = $dbCategory->Fetch()) {
$arCatTmp["~NAME"] = $arCatTmp["NAME"];
$arCatTmp["NAME"] = htmlspecialcharsEx($arCatTmp["NAME"]);
$arCatTmp["urlToCategory"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_SEARCH_TAG"], array("tag" => urlencode($arCatTmp["NAME"])));
$arResult["Category"][] = $arCatTmp;
}
}
$bAll = false;
$arResult["Post"]["SPERM"] = array();
示例2: AddLiveComment
function AddLiveComment($commentId = 0, $path = "", $arParams = array())
{
if (IntVal($commentId) <= 0) {
return;
}
if (CModule::IncludeModule("pull") && CPullOptions::GetNginxStatus() && ($arComment = CBlogComment::GetByID($commentId)) && ($arPost = CBlogPost::GetByID($arComment["POST_ID"]))) {
if (strlen($path) <= 0 && strlen($arComment["PATH"]) > 0) {
$path = CComponentEngine::MakePathFromTemplate($arComment["PATH"], array("post_id" => $arComment["POST_ID"], "comment_id" => $commentId));
}
if (strlen($path) <= 0) {
$path = CComponentEngine::MakePathFromTemplate($arPost["PATH"], array("post_id" => $arComment["POST_ID"], "comment_id" => $commentId)) . "?commentId=" . $commentId;
}
$arFormatParams = array("PATH_TO_USER" => isset($arParams["PATH_TO_USER"]) ? $arParams["PATH_TO_USER"] : '', "PATH_TO_POST" => $path, "NAME_TEMPLATE" => isset($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : CSite::GetNameFormat(), "SHOW_LOGIN" => isset($arParams["SHOW_LOGIN"]) ? $arParams["SHOW_LOGIN"] : true, "AVATAR_SIZE_COMMENT" => isset($arParams["AVATAR_SIZE_COMMENT"]) ? $arParams["AVATAR_SIZE_COMMENT"] : 58, "PATH_TO_SMILE" => isset($arParams["PATH_TO_SMILE"]) ? $arParams["PATH_TO_SMILE"] : '', "DATE_TIME_FORMAT" => isset($arParams["DATE_TIME_FORMAT"]) ? $arParams["DATE_TIME_FORMAT"] : '', "SHOW_RATING" => isset($arParams["SHOW_RATING"]) ? $arParams["SHOW_RATING"] : '', "RATING_TYPE" => "like");
$arComment["DateFormated"] = FormatDateFromDB($arComment["DATE_CREATE"], $arFormatParams["DATE_TIME_FORMAT"], true);
if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
$arComment["DateFormated"] = ToLower($arComment["DateFormated"]);
}
$arComment["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_COMMENT", $commentId, LANGUAGE_ID);
$arAuthor = CBlogUser::GetUserInfo($arComment["AUTHOR_ID"], $arFormatParams["PATH_TO_USER"], array("AVATAR_SIZE_COMMENT" => $arFormatParams["AVATAR_SIZE_COMMENT"]));
if (IsModuleInstalled('extranet') && CModule::IncludeModule('socialnetwork')) {
CSocNetTools::InitGlobalExtranetArrays();
}
$arTmpUser = array("NAME" => $arAuthor["~NAME"], "LAST_NAME" => $arAuthor["~LAST_NAME"], "SECOND_NAME" => $arAuthor["~SECOND_NAME"], "LOGIN" => $arAuthor["~LOGIN"], "NAME_LIST_FORMATTED" => "");
$arAuthor["NAME_FORMATED"] = CUser::FormatName($arFormatParams["NAME_TEMPLATE"], $arTmpUser, $arFormatParams["SHOW_LOGIN"] != "N");
if (intval($arAuthor["PERSONAL_PHOTO"]) > 0) {
$image_resize = CFile::ResizeImageGet($arAuthor["PERSONAL_PHOTO"], array("width" => $arFormatParams["AVATAR_SIZE_COMMENT"], "height" => $arFormatParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT);
$arAuthor["PERSONAL_PHOTO_RESIZED"] = array("src" => $image_resize["src"]);
}
$p = new blogTextParser(false, '');
$ufCode = "UF_BLOG_COMMENT_FILE";
if (is_array($arComment["UF"][$ufCode])) {
$p->arUserfields = array($ufCode => array_merge($arComment["UF"][$ufCode], array("TAG" => "DOCUMENT ID")));
}
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y");
$arParserParams = array("imageWidth" => 800, "imageHeight" => 800);
$arComment["TextFormated"] = $p->convert($arComment["POST_TEXT"], false, array(), $arAllow, $arParserParams);
$p->bMobile = true;
$arComment["TextFormatedMobile"] = $p->convert($arComment["POST_TEXT"], false, array(), $arAllow, $arParserParams);
if ($perm >= BLOG_PERMS_MODERATE) {
if ($arComment["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
$arComment["CAN_HIDE"] = "Y";
} else {
$arComment["CAN_SHOW"] = "Y";
}
} else {
$arComment["CAN_SHOW"] = $arComment["CAN_HIDE"] = "N";
}
$urlToPost = CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arFormatParams["PATH_TO_POST"]), array("post_id" => "#source_post_id#", "user_id" => $arPost["AUTHOR_ID"]));
$urlToPost .= strpos($urlToPost, "?") !== false ? "&" : "?";
$arUrl = array("LINK" => $urlToPost, "SHOW" => $urlToPost . "show_comment_id=#comment_id#&comment_post_id=#post_id#&" . bitrix_sessid_get(), "HIDE" => $urlToPost . "hide_comment_id=#comment_id#&comment_post_id=#post_id#&" . bitrix_sessid_get(), "DELETE" => $urlToPost . "delete_comment_id=#comment_id#&comment_post_id=#post_id#&" . bitrix_sessid_get(), "USER" => htmlspecialcharsback($arFormatParams["PATH_TO_USER"]));
CRatingsComponentsMain::GetShowRating($arFormatParams);
if ($arFormatParams["SHOW_RATING"] == "Y") {
$arRating = CRatings::GetRatingVoteResult('BLOG_COMMENT', array($arComment["ID"]));
}
$arCommentParams = array("ID" => $commentId, "ENTITY_XML_ID" => "BLOG_" . $arPost["ID"], "FULL_ID" => array("BLOG_" . $arPost["ID"], $commentId), "ACTION" => "REPLY", "APPROVED" => "Y", "PANELS" => array("EDIT" => "N", "MODERATE" => "N", "DELETE" => "N"), "NEW" => "Y", "AUTHOR" => array("ID" => $GLOBALS["USER"]->GetID(), "NAME" => $arAuthor["NAME_FORMATED"], "URL" => $arAuthor["url"], "E-MAIL" => $arComment["AuthorEmail"], "AVATAR" => $arAuthor["PERSONAL_PHOTO_resized"]["src"], "IS_EXTRANET" => is_array($GLOBALS["arExtranetUserID"]) && in_array($GLOBALS["USER"]->GetID(), $GLOBALS["arExtranetUserID"])), "POST_TIMESTAMP" => $arComment["DATE_CREATE_TS"], "POST_TIME" => $arComment["DATE_CREATE_TIME"], "POST_DATE" => $arComment["DateFormated"], "POST_MESSAGE_TEXT" => $arComment["TextFormated"], "POST_MESSAGE_TEXT_MOBILE" => $arComment["TextFormatedMobile"], "URL" => array("LINK" => str_replace(array("##comment_id#", "#comment_id#"), array("", $commentId), $arUrl["LINK"]), "EDIT" => "__blogEditComment('" . $commentId . "', '" . $arPost["ID"] . "');", "MODERATE" => str_replace(array("#source_post_id#", "#post_id#", "#comment_id#", "&" . bitrix_sessid_get()), array($arPost["ID"], $arPost["ID"], $commentId, ""), $arComment["CAN_SHOW"] == "Y" ? $arUrl["SHOW"] : ($arComment["CAN_HIDE"] == "Y" ? $arUrl["HIDE"] : "")), "DELETE" => str_replace(array("#source_post_id#", "#post_id#", "#comment_id#", "&" . bitrix_sessid_get()), array($arPost["ID"], $arPost["ID"], $commentId, ""), $arUrl["DELETE"])), "AFTER" => "", "BEFORE_ACTIONS_MOBILE" => "", "AFTER_MOBILE" => "");
if ($arFormatParams["SHOW_RATING"] == "Y") {
$arRatingData = array("ENTITY_TYPE_ID" => "BLOG_COMMENT", "ENTITY_ID" => $commentId, "OWNER_ID" => $arComment["AUTHOR_ID"], "USER_VOTE" => $arRating[$commentId]["USER_VOTE"], "USER_HAS_VOTED" => $arRating[$commentId]["USER_HAS_VOTED"], "TOTAL_VOTES" => $arRating[$commentId]["TOTAL_VOTES"], "TOTAL_POSITIVE_VOTES" => $arRating[$commentId]["TOTAL_POSITIVE_VOTES"], "TOTAL_NEGATIVE_VOTES" => $arRating[$commentId]["TOTAL_NEGATIVE_VOTES"], "TOTAL_VALUE" => $arRating[$commentId]["TOTAL_VALUE"], "PATH_TO_USER_PROFILE" => $arUrl["USER"]);
ob_start();
$GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.vote", $arFormatParams["RATING_TYPE"], $arRatingData, false, array("HIDE_ICONS" => "Y"));
$arCommentParams["BEFORE_ACTIONS"] = ob_get_clean();
ob_start();
$GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.vote", "mobile_comment_" . $arFormatParams["RATING_TYPE"], $arRatingData, false, array("HIDE_ICONS" => "Y"));
$arCommentParams["BEFORE_ACTIONS_MOBILE"] = ob_get_clean();
}
$arUFResult = self::BuildUFFields($arComment["UF"]);
$arCommentParams["AFTER"] .= $arUFResult["AFTER"];
$arCommentParams["AFTER_MOBILE"] .= $arUFResult["AFTER_MOBILE"];
if ($arComment["CAN_EDIT"] == "Y") {
ob_start();
?>
<script>
top.text<?php
echo $commentId;
?>
= text<?php
echo $commentId;
?>
= '<?php
echo CUtil::JSEscape(htmlspecialcharsBack($arComment["POST_TEXT"]));
?>
';
top.title<?php
echo $commentId;
?>
= title<?php
echo $commentId;
?>
= '<?php
echo isset($arComment["TITLE"]) ? CUtil::JSEscape($arComment["TITLE"]) : '';
?>
';
top.arComFiles<?php
echo $commentId;
?>
= [];<?php
?>
</script><?php
$arCommentParams["AFTER"] .= ob_get_clean();
}
CPullWatch::AddToStack('UNICOMMENTSBLOG_' . $arPost["ID"], array('module_id' => 'unicomments', 'command' => 'comment', 'params' => $arCommentParams));
//.........这里部分代码省略.........
示例3: array
} else {
$arResult["arImages"][$aImg["COMMENT_ID"]][$aImg['ID']]["full"] = "/bitrix/components/bitrix/blog/show_file.php?fid=" . $aImg['ID'] . "&width=" . $arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"] . "&height=" . $arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"];
}
}
}
$arFieldsHave = array();
if ($arPost["HAS_COMMENT_IMAGES"] == "") {
$arFieldsHave["HAS_COMMENT_IMAGES"] = $bHasImg ? "Y" : "N";
}
if (!empty($arFieldsHave)) {
CBlogPost::Update($arPost["ID"], $arFieldsHave);
}
do {
if (IntVal($arComment["AUTHOR_ID"]) > 0) {
if (empty($arResult["userCache"][$arComment["AUTHOR_ID"]])) {
$arResult["userCache"][$arComment["AUTHOR_ID"]] = CBlogUser::GetUserInfo($arComment["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE" => $arParams["AVATAR_SIZE"], "AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"]));
}
if ($arComment["AUTHOR_ID"] == $arPost["AUTHOR_ID"]) {
$arComment["AuthorIsPostAuthor"] = "Y";
}
$arTmpUser = array("NAME" => $arResult["userCache"][$arComment["AUTHOR_ID"]]["~NAME"], "LAST_NAME" => $arResult["userCache"][$arComment["AUTHOR_ID"]]["~LAST_NAME"], "SECOND_NAME" => $arResult["userCache"][$arComment["AUTHOR_ID"]]["~SECOND_NAME"], "LOGIN" => $arResult["userCache"][$arComment["AUTHOR_ID"]]["~LOGIN"], "NAME_LIST_FORMATTED" => "");
$arResult["userCache"][$arComment["AUTHOR_ID"]]["NAME_FORMATED"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $arParams["SHOW_LOGIN"] != "N" ? true : false);
$p->authorName = $arResult["userCache"][$arComment["AUTHOR_ID"]]["NAME_FORMATED"];
} else {
$arComment["AuthorName"] = htmlspecialcharsbx($arComment["AUTHOR_NAME"]);
$arComment["AuthorEmail"] = htmlspecialcharsbx($arComment["AUTHOR_EMAIL"]);
$p->authorName = $arComment["AuthorName"];
}
unset($arComment["AUTHOR_NAME"]);
unset($arComment["AUTHOR_EMAIL"]);
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y");
示例4: addLiveComment
/**
* Use component main.post.list to work with LiveFeed
* @param int $commentId Comment ID which needs to send.
* @param array $arParams Array of settings (DATE_TIME_FORMAT, SHOW_RATING, PATH_TO_USER, AVATAR_SIZE, NAME_TEMPLATE, SHOW_LOGIN)
* @return string
*/
public static function addLiveComment($commentId = 0, $arParams = array())
{
$res = "";
if ($commentId > 0 && CModule::IncludeModule("pull") && \CPullOptions::GetNginxStatus() && ($comment = CBlogComment::GetByID($commentId)) && ($arPost = CBlogPost::GetByID($comment["POST_ID"]))) {
global $DB, $APPLICATION;
$arParams["DATE_TIME_FORMAT"] = isset($arParams["DATE_TIME_FORMAT"]) ? $arParams["DATE_TIME_FORMAT"] : $DB->DateFormatToPHP(CSite::GetDateFormat("FULL"));
$arParams["SHOW_RATING"] = $arParams["SHOW_RATING"] == "N" ? "N" : "Y";
$arParams["PATH_TO_USER"] = isset($arParams["PATH_TO_USER"]) ? $arParams["PATH_TO_USER"] : '';
$arParams["AVATAR_SIZE_COMMENT"] = $arParams["AVATAR_SIZE_COMMENT"] > 0 ? $arParams["AVATAR_SIZE_COMMENT"] : ($arParams["AVATAR_SIZE"] > $arParams["AVATAR_SIZE"] ? $arParams["AVATAR_SIZE"] : 58);
$arParams["NAME_TEMPLATE"] = isset($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : CSite::GetNameFormat();
$arParams["SHOW_LOGIN"] = $arParams["SHOW_LOGIN"] == "N" ? "N" : "Y";
$comment["DateFormated"] = FormatDateFromDB($comment["DATE_CREATE"], $arParams["DATE_TIME_FORMAT"], true);
$timestamp = MakeTimeStamp($comment["DATE_CREATE"]);
if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
$comment["DateFormated"] = ToLower($comment["DateFormated"]);
}
$comment["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_COMMENT", $commentId, LANGUAGE_ID);
$arAuthor = CBlogUser::GetUserInfo($comment["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"]));
if (intval($arAuthor["PERSONAL_PHOTO"]) > 0) {
$image_resize = CFile::ResizeImageGet($arAuthor["PERSONAL_PHOTO"], array("width" => $arParams["AVATAR_SIZE_COMMENT"], "height" => $arParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT);
$arAuthor["PERSONAL_PHOTO_RESIZED"] = array("src" => $image_resize["src"]);
}
$p = new blogTextParser(false, '');
$ufCode = "UF_BLOG_COMMENT_FILE";
if (is_array($comment["UF"][$ufCode])) {
$p->arUserfields = array($ufCode => array_merge($comment["UF"][$ufCode], array("TAG" => "DOCUMENT ID")));
}
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y");
$arParserParams = array("imageWidth" => 800, "imageHeight" => 800);
$comment["TextFormated"] = $p->convert($comment["POST_TEXT"], false, array(), $arAllow, $arParserParams);
$p->bMobile = true;
$comment["TextFormatedMobile"] = $p->convert($comment["POST_TEXT"], false, array(), $arAllow, $arParserParams);
$comment["TextFormatedJS"] = CUtil::JSEscape(htmlspecialcharsBack($comment["POST_TEXT"]));
$comment["TITLE"] = CUtil::JSEscape(htmlspecialcharsBack($comment["TITLE"]));
$eventHandlerID = AddEventHandler("main", "system.field.view.file", array("CSocNetLogTools", "logUFfileShow"));
$res = $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("TEMPLATE_ID" => 'BLOG_COMMENT_BG_', "RATING_TYPE_ID" => $arParams["SHOW_RATING"] == "Y" ? "BLOG_COMMENT" : "", "ENTITY_XML_ID" => "BLOG_" . $arPost["ID"], "RECORDS" => array($commentId => array("ID" => $comment["ID"], "NEW" => $arParams["FOLLOW"] != "N" && $comment["NEW"] == "Y" ? "Y" : "N", "APPROVED" => $comment["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH ? "Y" : "N", "POST_TIMESTAMP" => $timestamp, "POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "AUTHOR" => array("ID" => $arAuthor["ID"], "NAME" => $arAuthor["~NAME"], "LAST_NAME" => $arAuthor["~LAST_NAME"], "SECOND_NAME" => $arAuthor["~SECOND_NAME"], "AVATAR" => $arAuthor["PERSONAL_PHOTO_resized"]["src"]), "FILES" => false, "UF" => $comment["UF"], "~POST_MESSAGE_TEXT" => $comment["POST_TEXT"], "WEB" => array("POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "CLASSNAME" => "", "POST_MESSAGE_TEXT" => $comment["TextFormated"], "AFTER" => <<<HTML
<script>top.text{$commentId} = text{$commentId} = '{$comment["TextFormatedJS"]}';top.title{$commentId} = title{$commentId} = '{$comment["TITLE"]}';top.arComFiles{$commentId} = [];</script>
HTML
), "MOBILE" => array("POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "CLASSNAME" => "", "POST_MESSAGE_TEXT" => $comment["TextFormatedMobile"]))), "NAV_STRING" => "", "NAV_RESULT" => "", "PREORDER" => "N", "RIGHTS" => array("MODERATE" => "N", "EDIT" => "N", "DELETE" => "N"), "VISIBLE_RECORDS_COUNT" => 1, "ERROR_MESSAGE" => "", "OK_MESSAGE" => "", "RESULT" => $commentId, "PUSH&PULL" => array("ACTION" => "REPLY", "ID" => $commentId), "MODE" => "PULL_MESSAGE", "VIEW_URL" => "", "EDIT_URL" => "", "MODERATE_URL" => "", "DELETE_URL" => "", "AUTHOR_URL" => "", "AVATAR_SIZE" => $arParams["AVATAR_SIZE_COMMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "DATE_TIME_FORMAT" => "", "LAZYLOAD" => "", "NOTIFY_TAG" => "", "NOTIFY_TEXT" => "", "SHOW_MINIMIZED" => "Y", "SHOW_POST_FORM" => "", "IMAGE_SIZE" => "", "mfi" => ""), array(), null);
if ($eventHandlerID !== false && intval($eventHandlerID) > 0) {
RemoveEventHandler('main', 'system.field.view.file', $eventHandlerID);
}
}
return $res;
}
示例5: elseif
if (isset($arFileStorage["DISC_FOLDER"])) {
$arResult["DISK_FILE_ID"] = $arSaveResult["ID"];
} elseif (isset($arFileStorage["WEBDAV_DATA"])) {
$arResult["DOCUMENT_ID"] = $arSaveResult["ID"];
} else {
$arResult["FILE_ID"] = $arSaveResult["ID"];
}
$arResult["BLOG_COMMENT_ID"] = $commentId;
$arResult["SONET_COMMENT_ID"] = $log_comment_id;
if (CModule::IncludeModule("pull") && CPullOptions::GetNginxStatus() && ($arComment = CBlogComment::GetByID($commentId))) {
$arParams = array("PATH_TO_USER" => $_REQUEST["p_user"], "PATH_TO_POST" => $_REQUEST["p_bpost"], "NAME_TEMPLATE" => $_REQUEST["nt"], "SHOW_LOGIN" => $_REQUEST["sl"], "AVATAR_SIZE_COMMENT" => isset($_REQUEST["as"]) ? intval($_REQUEST["as"]) : 58, "PATH_TO_SMILE" => '', "DATE_TIME_FORMAT" => $_REQUEST["dtf"], "SHOW_RATING" => $_REQUEST["sr"]);
$arComment["DateFormated"] = FormatDateFromDB($arComment["DATE_CREATE"], $arParams["DATE_TIME_FORMAT"], true);
if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
$arComment["DateFormated"] = ToLower($arComment["DateFormated"]);
}
$arAuthor = CBlogUser::GetUserInfo($arComment["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"]));
if (IsModuleInstalled('extranet')) {
CSocNetTools::InitGlobalExtranetArrays();
}
$arTmpUser = array("NAME" => $arAuthor["~NAME"], "LAST_NAME" => $arAuthor["~LAST_NAME"], "SECOND_NAME" => $arAuthor["~SECOND_NAME"], "LOGIN" => $arAuthor["~LOGIN"], "NAME_LIST_FORMATTED" => "");
$arAuthor["NAME_FORMATED"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $arParams["SHOW_LOGIN"] != "N" ? true : false);
if (intval($arAuthor["PERSONAL_PHOTO"]) > 0) {
$image_resize = CFile::ResizeImageGet($arAuthor["PERSONAL_PHOTO"], array("width" => $arParams["AVATAR_SIZE_COMMENT"], "height" => $arParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT);
$arAuthor["PERSONAL_PHOTO_RESIZED"] = array("src" => $image_resize["src"]);
}
$p = new blogTextParser(false, '');
$arPostFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_COMMENT", $arComment["ID"], LANGUAGE_ID);
if (is_array($arPostFields[$ufCode])) {
$p->arUserfields = array($ufCode => array_merge($arPostFields[$ufCode], array("TAG" => "DOCUMENT ID")));
}
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y");
示例6: preg_replace
$text = preg_replace($patt, $repl, $arPost["~DETAIL_TEXT"]);
$text = TruncateText($text, $arParams["MESSAGE_LENGTH"]);
$text = CBlogTools::DeleteDoubleBR($p->convert($text, true, false, $allow));
$arPost["~CLEAR_TEXT"] = $text;
$arPost["CLEAR_TEXT"] = $p->wrap_long_words($text);
$arPost["perms"] = $arResult["perms"];
if(!$bGroupMode && $arParams["USER_ID"] == $user_id && (empty($arParams["4ME"]) || $arPost["AUTHOR_ID"] == $user_id))
$arPost["perms"] = BLOG_PERMS_FULL;
elseif((!$bGroupMode && $arParams["USER_ID"] != $user_id) || strlen($arParams["4ME"]) > 0)
$arPost["perms"] = CBlogPost::GetSocNetPostPerms($arPost["ID"], true);
$arUser = $arResult["userCache"][$arPost["AUTHOR_ID"]];
if (empty($arUser))
{
$arUser = CBlogUser::GetUserInfo($arPost["AUTHOR_ID"], $arParams["PATH_TO_USER"],array("AVATAR_SIZE" => $arParams["AVATAR_SIZE"]));
$arUser["~AUTHOR_NAME"] = CUser::FormatName($arParams["NAME_TEMPLATE"],
array("LAST_NAME" => $arUser["~LAST_NAME"], "NAME" => $arUser["~NAME"],
"SECOND_NAME" => $arUser["~SECOND_NAME"], "LOGIN" => $arUser["~LOGIN"]),
$arParams["SHOW_LOGIN"], false);
$arUser["AUTHOR_NAME"] = htmlspecialcharsbx($arUser["~AUTHOR_NAME"]);
$arResult["userCache"][$arPost["AUTHOR_ID"]] = $arUser;
}
$arPost["~AUTHOR_NAME"] = $arUser["~AUTHOR_NAME"];
$arPost["AUTHOR_NAME"] = $arUser["AUTHOR_NAME"];
$arPost["AUTHOR_AVATAR"] = $arUser["PERSONAL_PHOTO_resized"];
$arPost["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_POST"],
array("post_id"=> CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"]));
$arPost["urlToPosts"] = CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_BLOG_POSTS"],
array("user_id" => $arPost["BLOG_OWNER_ID"]));