本文整理汇总了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;
}