本文整理汇总了PHP中CBlogUser::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogUser::GetList方法的具体用法?PHP CBlogUser::GetList怎么用?PHP CBlogUser::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogUser
的用法示例。
在下文中一共展示了CBlogUser::GetList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFields
function CheckFields($ACTION, &$arFields, $ID = 0)
{
global $DB;
if ((is_set($arFields, "USER_ID") || $ACTION == "ADD") && IntVal($arFields["USER_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_EMPTY_USER_ID"), "EMPTY_USER_ID");
return false;
} elseif (is_set($arFields, "USER_ID")) {
$dbResult = CUser::GetByID($arFields["USER_ID"]);
if (!$dbResult->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_NO_USER_ID"), "ERROR_NO_USER_ID");
return false;
}
}
if (is_set($arFields, "ALIAS") && strlen($arFields["ALIAS"]) > 0) {
$dbResult = CBlogUser::GetList(array(), array("ALIAS" => $arFields["ALIAS"], "!ID" => IntVal($ID)), false, false, array("ID"));
if ($dbResult->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_DUPL_ALIAS"), "ERROR_DUPL_ALIAS");
return false;
}
}
if (is_set($arFields, "LAST_VISIT") && !$DB->IsDate($arFields["LAST_VISIT"], false, LANG, "FULL")) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_LAST_VISIT"), "ERROR_LAST_VISIT");
return false;
}
if (is_set($arFields, "DATE_REG") && !$DB->IsDate($arFields["DATE_REG"], false, LANG, "FULL")) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_DATE_REG"), "ERROR_DATE_REG");
return false;
}
if ((is_set($arFields, "ALLOW_POST") || $ACTION == "ADD") && $arFields["ALLOW_POST"] != "Y" && $arFields["ALLOW_POST"] != "N") {
$arFields["ALLOW_POST"] = "Y";
}
if (is_set($arFields, "AVATAR") && strlen($arFields["AVATAR"]["name"]) <= 0 && strlen($arFields["AVATAR"]["del"]) <= 0) {
unset($arFields["AVATAR"]);
}
if (is_set($arFields, "AVATAR")) {
$max_size = COption::GetOptionInt("blog", "avatar_max_size", 30000);
//$max_width = COption::GetOptionInt("blog", "avatar_max_width", 100);
//$max_height = COption::GetOptionInt("blog", "avatar_max_height", 100);
$res = CFile::CheckImageFile($arFields["AVATAR"], $max_size, 0, 0);
if (strlen($res) > 0) {
$GLOBALS["APPLICATION"]->ThrowException($res, "ERROR_AVATAR");
return false;
}
}
return True;
}
示例2: IncludeModuleLangFile
<?php
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/blog/options_user_settings.php");
if (CModule::IncludeModule("blog")) {
$ID = IntVal($ID);
$str_blog_AVATAR = "";
ClearVars("str_blog_");
$db_res = CBlogUser::GetList(array(), array("USER_ID" => $ID));
if (!$db_res->ExtractFields("str_blog_", True)) {
if (!isset($str_blog_ALLOW_POST) || $str_blog_ALLOW_POST != "Y" && $str_blog_ALLOW_POST != "N") {
$str_blog_ALLOW_POST = "Y";
}
}
if ($COPY_ID > 0) {
$str_blog_AVATAR = "";
}
if (strlen($strError) > 0) {
$str_blog_ALLOW_POST = htmlspecialcharsbx($_POST["blog_ALLOW_POST"]);
$str_blog_ALIAS = htmlspecialcharsbx($_POST["blog_ALIAS"]);
$str_blog_DESCRIPTION = htmlspecialcharsbx($_POST["blog_DESCRIPTION"]);
$str_blog_INTERESTS = htmlspecialcharsbx($_POST["blog_INTERESTS"]);
$str_blog_ALLOW_POST = htmlspecialcharsbx($_POST["blog_ALLOW_POST"]);
}
?>
<input type="hidden" name="profile_module_id[]" value="blog">
<?php
if ($USER->IsAdmin()) {
?>
<tr>
<td width="40%"><?php
echo GetMessage("blog_ALLOW_POST");
示例3: array
$canUseAlias = COption::GetOptionString("blog", "allow_alias", "Y");
if ($canUseAlias == "Y") {
$arOrderBy = array("ALIAS" => "ASC", "USER_LAST_NAME" => "ASC", "USER_NAME" => "ASC");
} else {
$arOrderBy = array("USER_LAST_NAME" => "ASC", "USER_NAME" => "ASC");
}
$dbUsers = CBlogCandidate::GetList($arOrderBy, array("BLOG_ID" => $arBlog["ID"]), false, false, array("ID", "USER_ID", "BLOG_USER_ALIAS", "USER_LOGIN", "USER_NAME", "USER_LAST_NAME"));
$arResult["Candidate"] = array();
while ($arUsers = $dbUsers->GetNext()) {
$arUsers["urlToUser"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUsers["USER_ID"]));
$arUsers["NameFormated"] = CBlogUser::GetUserName($arUsers["BLOG_USER_ALIAS"], $arUsers["USER_NAME"], $arUsers["USER_LAST_NAME"], $arUsers["USER_LOGIN"]);
$arUsers["urlToEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS_EDIT"], array("user_id" => $arUsers["USER_ID"], "blog" => $arBlog["URL"]));
$arUsers["urlToDelete"] = htmlspecialcharsex($APPLICATION->GetCurPageParam("del_id=" . $arUsers["USER_ID"] . '&' . bitrix_sessid_get(), array("del_id", "sessid")));
$arResult["Candidate"][] = $arUsers;
}
$dbUsers = CBlogUser::GetList($arOrderBy, array("GROUP_BLOG_ID" => $arBlog["ID"]), array("ID", "USER_ID", "ALIAS", "USER_LOGIN", "USER_NAME", "USER_LAST_NAME"));
$arResult["Users"] = array();
while ($arUsers = $dbUsers->GetNext()) {
$arUsers["urlToUser"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUsers["USER_ID"]));
$arUsers["NameFormated"] = CBlogUser::GetUserName($arUsers["BLOG_USER_ALIAS"], $arUsers["USER_NAME"], $arUsers["USER_LAST_NAME"], $arUsers["USER_LOGIN"]);
$arUsers["urlToEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS_EDIT"], array("user_id" => $arUsers["USER_ID"], "blog" => $arBlog["URL"]));
$arUsers["urlToDelete"] = htmlspecialcharsex($APPLICATION->GetCurPageParam("del_id=" . $arUsers["USER_ID"] . '&' . bitrix_sessid_get(), array("del_id", "sessid")));
$dbUserGroups = CBlogUserGroup::GetList(array(), array("USER2GROUP_USER_ID" => $arUsers["USER_ID"], "BLOG_ID" => $arBlog["ID"]), false, false, array("ID", "NAME"));
$bNeedComa = False;
while ($arUserGroups = $dbUserGroups->GetNext()) {
if ($bNeedComa) {
$arUsers["groupsFormated"] .= ", ";
}
$arUsers["groups"][] = $arUserGroups;
$arUsers["groupsFormated"] .= $arUserGroups["NAME"];
$bNeedComa = True;
示例4: foreach
}
}
}
if ($arParams['IS_FORUM'] == 'Y') {
$arForumUser = CForumUser::GetByUSER_ID($arParams["ID"]);
if (is_array($arForumUser) && count($arForumUser) > 0) {
foreach ($arForumUser as $key => $value) {
if (true || in_array('FORUM_' . $key, $arParams['EDITABLE_FIELDS'])) {
$arResult['User']['FORUM_' . $key] = htmlspecialcharsbx($value);
$arResult['User']['~FORUM_' . $key] = $value;
}
}
}
}
if ($arParams['IS_BLOG'] == 'Y') {
$dbRes = CBlogUser::GetList(array(), array("USER_ID" => $arParams['ID']));
if ($arBlogUser = $dbRes->Fetch()) {
foreach ($arBlogUser as $key => $value) {
$arResult['User']['BLOG_' . $key] = htmlspecialcharsbx($value);
$arResult['User']['~BLOG_' . $key] = $value;
}
}
}
$SONET_USER_ID = $arParams['ID'];
//intval($_POST["SONET_USER_ID"]);
if ($arResult['bEdit'] == 'Y' && $_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["submit"]) > 0 && check_bitrix_sessid()) {
if (CModule::IncludeModule("socialservices")) {
$arPerm = array();
if (is_array($_POST["SPERM"]) && isset($_POST["USER_ID_TWITTER"]) && !empty($_POST["USER_ID_TWITTER"])) {
$arPerm = $_POST["SPERM"];
}
示例5: IsFriend
function IsFriend($ID, $userID)
{
global $DB;
$ID = IntVal($ID);
$userID = IntVal($userID);
if ($ID <= 0 || $userID <= 0) {
return False;
}
$cnt = CBlogUser::GetList(array(), array("USER_ID" => $userID, "GROUP_BLOG_ID" => $ID), array());
return $cnt > 0;
}