本文整理汇总了PHP中CBlogUser::GetUserInfoArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogUser::GetUserInfoArray方法的具体用法?PHP CBlogUser::GetUserInfoArray怎么用?PHP CBlogUser::GetUserInfoArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogUser
的用法示例。
在下文中一共展示了CBlogUser::GetUserInfoArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arSelectedFields = array("ID", "BLOG_ID", "POST_ID", "AUTHOR_ID", "AUTHOR_NAME", "AUTHOR_EMAIL", "POST_TEXT", "DATE_CREATE", "PUBLISH_STATUS", "HAS_PROPS", "SHARE_DEST");
if ($GLOBALS["DB"]->type == "MYSQL") {
$arSelectedFields[] = "DATE_CREATE_TS";
}
$dbComment = CBlogComment::GetList($arOrder, $arFilter, false, false, $arSelectedFields);
$resComments = array();
$arCommentsAll = array();
$arIdToGet = array();
while ($arComment = $dbComment->Fetch()) {
if (IntVal($arComment["AUTHOR_ID"]) > 0) {
$arIdToGet[] = $arComment["AUTHOR_ID"];
}
$arCommentsAll[] = $arComment;
}
if (!empty($arIdToGet)) {
$arResult["userCache"] = CBlogUser::GetUserInfoArray($arIdToGet, $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"]));
foreach ($arResult["userCache"] as $userId => $arUserCache) {
$arTmpUser = array("NAME" => $arUserCache["~NAME"], "LAST_NAME" => $arUserCache["~LAST_NAME"], "SECOND_NAME" => $arUserCache["~SECOND_NAME"], "LOGIN" => $arUserCache["~LOGIN"], "NAME_LIST_FORMATTED" => "");
$arResult["userCache"][$userId]["NAME_FORMATED"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $arParams["SHOW_LOGIN"] != "N" ? true : false);
}
}
$i = 0;
if (!empty($arCommentsAll[$i])) {
$arComment = $arCommentsAll[$i];
$p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$p->LAZYLOAD = isset($arParams["LAZYLOAD"]) && $arParams["LAZYLOAD"] == "Y" ? "Y" : "N";
$p->bMobile = isset($arParams["MOBILE"]) && $arParams["MOBILE"] == "Y";
$arParserParams = array("imageWidth" => $arParams["IMAGE_MAX_WIDTH"], "imageHeight" => $arParams["IMAGE_MAX_HEIGHT"], "pathToUser" => $arParams["PATH_TO_USER"]);
$bHasImg = false;
if ($arPost["HAS_COMMENT_IMAGES"] != "N") {
$res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost['ID'], "BLOG_ID" => $arPost['BLOG_ID'], "IS_COMMENT" => "Y"), false, false, array("ID", "FILE_ID", "POST_ID", "BLOG_ID", "USER_ID", "TITLE", "COMMENT_ID", "IS_COMMENT"));
示例2: array
$repl[] = "\\1";
$patt[] = "#(\\[|<)(/?)(b|u|i|list|code|quote|url|img|color|font|right|left|center|justify|/*)(.*?)(\\]|>)#is";
$repl[] = " ";
$patt[] = "#\\s+#";
$repl[] = " ";
$allow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N");
$arPostsAll = array();
$arIdToGet = array();
while ($arPost = $dbPost->GetNext()) {
if (IntVal($arPost["AUTHOR_ID"]) > 0) {
$arIdToGet[] = $arPost["AUTHOR_ID"];
}
$arPostsAll[] = $arPost;
}
if (!empty($arIdToGet)) {
$arResult["userCache"] = CBlogUser::GetUserInfoArray($arIdToGet, $arParams["PATH_TO_USER"], array("AVATAR_SIZE" => $arParams["AVATAR_SIZE"]));
foreach ($arResult["userCache"] as $userId => $arUserCache) {
$arUserCache["~AUTHOR_NAME"] = CUser::FormatName($arParams["NAME_TEMPLATE"], array("LAST_NAME" => $arUserCache["~LAST_NAME"], "NAME" => $arUserCache["~NAME"], "SECOND_NAME" => $arUserCache["~SECOND_NAME"], "LOGIN" => $arUserCache["~LOGIN"]), $arParams["SHOW_LOGIN"], false);
$arUserCache["AUTHOR_NAME"] = htmlspecialcharsbx($arUserCache["~AUTHOR_NAME"]);
$arResult["userCache"][$userId] = $arUserCache;
}
}
$db_user = CUser::GetById($GLOBALS["USER"]->GetId());
$arResult["USER"] = $db_user->Fetch();
foreach ($arPostsAll as $arPost) {
$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"];