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


PHP CBlogUser::GetUserNameEx方法代码示例

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


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

示例1: 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::GetUserNameEx($arUsrTmp["arUser"], $arUsrTmp["BlogUser"], $arParams);
         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 (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

示例2: Notify

 function Notify($arPost, $arBlog, $arParams)
 {
     global $DB;
     if (empty($arBlog)) {
         $arBlog = CBlog::GetByID($arPost["BLOG_ID"]);
     }
     if ($arParams["bSoNet"] || $arBlog["EMAIL_NOTIFY"] == "Y" && $arParams["user_id"] != $arBlog["OWNER_ID"]) {
         $BlogUser = CBlogUser::GetByID($arParams["user_id"], BLOG_BY_USER_ID);
         $BlogUser = CBlogTools::htmlspecialcharsExArray($BlogUser);
         $res = CUser::GetByID($arBlog["OWNER_ID"]);
         $arOwner = $res->GetNext();
         $dbUser = CUser::GetByID($arParams["user_id"]);
         $arUser = $dbUser->Fetch();
         $AuthorName = CBlogUser::GetUserNameEx($arUser, $BlogUser, $arParams);
         $parserBlog = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
         $text4mail = $arPost["DETAIL_TEXT"];
         if ($arPost["DETAIL_TEXT_TYPE"] == "html") {
             $text4mail = HTMLToTxt($text4mail);
         }
         $arImages = array();
         $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "N"));
         while ($arImage = $res->Fetch()) {
             $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         }
         $text4mail = $parserBlog->convert4mail($text4mail, $arImages);
         $dbSite = CSite::GetByID(SITE_ID);
         $arSite = $dbSite->Fetch();
         $serverName = htmlspecialcharsEx($arSite["SERVER_NAME"]);
         if (strlen($serverName) <= 0) {
             if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
                 $serverName = SITE_SERVER_NAME;
             } else {
                 $serverName = COption::GetOptionString("main", "server_name", "");
             }
         }
     }
     if (!$arParams["bSoNet"] && $arBlog["EMAIL_NOTIFY"] == "Y" && $arParams["user_id"] != $arBlog["OWNER_ID"] && IntVal($arBlog["OWNER_ID"]) > 0) {
         CEvent::Send("NEW_BLOG_MESSAGE", SITE_ID, array("BLOG_ID" => $arBlog["ID"], "BLOG_NAME" => htmlspecialcharsBack($arBlog["NAME"]), "BLOG_URL" => $arBlog["URL"], "MESSAGE_TITLE" => $arPost["TITLE"], "MESSAGE_TEXT" => $text4mail, "MESSAGE_DATE" => GetTime(MakeTimeStamp($arPost["DATE_PUBLISH"]) - CTimeZone::GetOffset(), "FULL"), "MESSAGE_PATH" => "http://" . $serverName . CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("blog" => $arBlog["URL"], "post_id" => $arPost["ID"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"])), "AUTHOR" => $AuthorName, "EMAIL_FROM" => COption::GetOptionString("main", "email_from", "nobody@nobody.com"), "EMAIL_TO" => $arOwner["EMAIL"]));
     }
     if ($arParams["bSoNet"] && $arPost["ID"] && CModule::IncludeModule("socialnetwork")) {
         if ($arPost["DETAIL_TEXT_TYPE"] == "html" && $arParams["allowHTML"] == "Y" && $arBlog["ALLOW_HTML"] == "Y") {
             $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "Y", "QUOTE" => "Y", "CODE" => "Y");
             if ($arParams["allowVideo"] != "Y") {
                 $arAllow["VIDEO"] = "N";
             }
             $text4message = $parserBlog->convert($arPost["DETAIL_TEXT"], false, $arImages, $arAllow);
         } else {
             $arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "TABLE" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
             $text4message = $parserBlog->convert($arPost["DETAIL_TEXT"], false, $arImages, $arAllow, array("isSonetLog" => true));
         }
         $arSoFields = array("EVENT_ID" => "blog_post", "=LOG_DATE" => strlen($arPost["DATE_PUBLISH"]) > 0 ? MakeTimeStamp($arPost["DATE_PUBLISH"], CSite::GetDateFormat("FULL", $SITE_ID)) > time() + CTimeZone::GetOffset() ? $DB->CharToDateFunction($arPost["DATE_PUBLISH"], "FULL", SITE_ID) : $DB->CurrentTimeFunction() : $DB->CurrentTimeFunction(), "TITLE_TEMPLATE" => "#USER_NAME# " . GetMessage("BLG_SONET_TITLE"), "TITLE" => $arPost["TITLE"], "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "MODULE_ID" => "blog", "CALLBACK_FUNC" => false, "SOURCE_ID" => $arPost["ID"], "ENABLE_COMMENTS" => array_key_exists("ENABLE_COMMENTS", $arPost) && $arPost["ENABLE_COMMENTS"] == "N" ? "N" : "Y");
         $arSoFields["RATING_TYPE_ID"] = "BLOG_POST";
         $arSoFields["RATING_ENTITY_ID"] = intval($arPost["ID"]);
         if ($arParams["bGroupMode"]) {
             $arSoFields["ENTITY_TYPE"] = SONET_ENTITY_GROUP;
             $arSoFields["ENTITY_ID"] = $arParams["SOCNET_GROUP_ID"];
             $arSoFields["URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"], "post_id" => $arPost["ID"]));
         } else {
             $arSoFields["ENTITY_TYPE"] = SONET_ENTITY_USER;
             $arSoFields["ENTITY_ID"] = $arBlog["OWNER_ID"];
             $arSoFields["URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"], "post_id" => $arPost["ID"]));
         }
         if (intval($arParams["user_id"]) > 0) {
             $arSoFields["USER_ID"] = $arParams["user_id"];
         }
         $logID = CSocNetLog::Add($arSoFields, false);
         if (intval($logID) > 0) {
             $socnetPerms = CBlogPost::GetSocNetPermsCode($arPost["ID"]);
             if (!in_array("U" . $arPost["AUTHOR_ID"], $socnetPerms)) {
                 $socnetPerms[] = "U" . $arPost["AUTHOR_ID"];
             }
             $socnetPerms[] = "SA";
             // socnet admin
             CSocNetLog::Update($logID, array("TMP_ID" => $logID));
             if (CModule::IncludeModule("extranet")) {
                 $arSiteID = CExtranet::GetSitesByLogDestinations($socnetPerms);
                 CSocNetLog::Update($logID, array("SITE_ID" => $arSiteID));
             }
             CSocNetLogRights::DeleteByLogID($logID);
             CSocNetLogRights::Add($logID, $socnetPerms);
             CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
             return $logID;
         }
     }
 }
开发者ID:,项目名称:,代码行数:85,代码来源:

示例3: GetMessage

                 }
             }
         } else {
             $strErrorMessage .= GetMessage("B_B_PU_NO_RIGHTS") . "<br />";
         }
     }
     if (strlen($strErrorMessage) <= 0) {
         LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arParams["ID"])));
     } else {
         $arResult["ERROR_MESSAGE"] = $strErrorMessage;
     }
 }
 $arResult["BlogUser"] = CBlogUser::GetByID($arParams["ID"], BLOG_BY_USER_ID);
 $arResult["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arResult["BlogUser"]);
 $arResult["arSex"] = array("M" => GetMessage("B_B_USER_SEX_M"), "F" => GetMessage("B_B_USER_SEX_F"));
 $arResult["userName"] = CBlogUser::GetUserNameEx($arResult["arUser"], $arResult["BlogUser"], $arParams);
 $arResult["User"] = $arResult["arUser"];
 $arResult["BlogUser"]["LAST_VISIT_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arResult["BlogUser"]["LAST_VISIT"], CSite::GetDateFormat("FULL")));
 foreach ($arResult["BlogUser"] as $k => $v) {
     $arResult["User"][$k] = $v;
 }
 if ($arResult["bEdit"] == "Y") {
     $arResult["User"]["ALIAS"] = htmlspecialcharsbx($_POST["ALIAS"]);
     $arResult["User"]["DESCRIPTION"] = htmlspecialcharsbx($_POST["DESCRIPTION"]);
     $arResult["User"]["PERSONAL_WWW"] = htmlspecialcharsbx($_POST["PERSONAL_WWW"]);
     $arResult["User"]["PERSONAL_GENDER"] = htmlspecialcharsbx($_POST["PERSONAL_GENDER"]);
     $arResult["User"]["PERSONAL_BIRTHDAY"] = htmlspecialcharsbx($_POST["PERSONAL_BIRTHDAY"]);
     $arResult["User"]["INTERESTS"] = htmlspecialcharsbx($_POST["INTERESTS"]);
 }
 if ($arParams["SET_TITLE"] == "Y") {
     if ($arResult["bEdit"] == "Y") {
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php


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