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


PHP CBlogUser::CheckFields方法代码示例

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


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

示例1: 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,代码来源:


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