本文整理汇总了PHP中CSocNetUser::GetFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUser::GetFields方法的具体用法?PHP CSocNetUser::GetFields怎么用?PHP CSocNetUser::GetFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetUser
的用法示例。
在下文中一共展示了CSocNetUser::GetFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("socialnetwork")) {
return false;
}
$arRes = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER");
$userProp = array();
if (!empty($arRes)) {
foreach ($arRes as $key => $val) {
$userProp[$val["FIELD_NAME"]] = strLen($val["EDIT_FORM_LABEL"]) > 0 ? $val["EDIT_FORM_LABEL"] : $val["FIELD_NAME"];
}
}
$userProp1 = CSocNetUser::GetFields();
unset($userProp1["PASSWORD"]);
$arComponentParameters = array("GROUPS" => array("VARIABLE_ALIASES" => array("NAME" => GetMessage("SONET_VARIABLE_ALIASES"))), "PARAMETERS" => array("SET_NAV_CHAIN" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_SET_NAVCHAIN"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), "PAGE_VAR" => array("NAME" => GetMessage("SONET_PAGE_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "USER_VAR" => array("NAME" => GetMessage("SONET_USER_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "PATH_TO_USER" => array("NAME" => GetMessage("SONET_PATH_TO_USER"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_SEARCH" => array("NAME" => GetMessage("SONET_PATH_TO_SEARCH"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_SEARCH_INNER" => array("NAME" => GetMessage("SONET_PATH_TO_SEARCH_INNER"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_USER_FRIENDS_ADD" => array("NAME" => GetMessage("SONET_PATH_TO_USER_FRIENDS_ADD"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_MESSAGE_FORM" => array("NAME" => GetMessage("SONET_PATH_TO_MESSAGE_FORM"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_MESSAGES_CHAT" => array("NAME" => GetMessage("SONET_PATH_TO_MESSAGES_CHAT"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "ITEMS_COUNT" => array("NAME" => GetMessage("SONET_ITEMS_COUNT"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VISUAL"), "DATE_TIME_FORMAT" => CComponentUtil::GetDateTimeFormatField(GetMessage("SONET_DATE_TIME_FORMAT"), "VISUAL"), "SET_TITLE" => array(), "SHOW_USERS_WITHOUT_FILTER_SET" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_SHOW_USERS_WITHOUT_FILTER_SET"), "TYPE" => "CHECKBOX", "DEFAULT" => "N"), "USER_FIELDS_SEARCH_SIMPLE" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_USER_FIELDS_SIMPLE"), "TYPE" => "LIST", "VALUES" => $userProp1, "MULTIPLE" => "Y", "DEFAULT" => array()), "USER_PROPERTIES_SEARCH_SIMPLE" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_USER_PROPERTY_SIMPLE"), "TYPE" => "LIST", "VALUES" => $userProp, "MULTIPLE" => "Y", "DEFAULT" => array()), "USER_FIELDS_SEARCH_ADV" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_USER_FIELDS_ADV"), "TYPE" => "LIST", "VALUES" => $userProp1, "MULTIPLE" => "Y", "DEFAULT" => array()), "USER_PROPERTIES_SEARCH_ADV" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_USER_PROPERTY_ADV"), "TYPE" => "LIST", "VALUES" => $userProp, "MULTIPLE" => "Y", "DEFAULT" => array()), "USER_FIELDS_LIST" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_USER_FIELDS_LIST"), "TYPE" => "LIST", "VALUES" => $userProp1, "MULTIPLE" => "Y", "DEFAULT" => array()), "USER_PROPERTIES_LIST" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_USER_PROPERTY_LIST"), "TYPE" => "LIST", "VALUES" => $userProp, "MULTIPLE" => "Y", "DEFAULT" => array()), "USER_FIELDS_SEARCHABLE" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_SONET_USER_FIELDS_SEARCHABLE"), "TYPE" => "LIST", "VALUES" => $userProp1, "MULTIPLE" => "Y", "DEFAULT" => array("NAME", "SECOND_NAME", "LAST_NAME", "LOGIN", "PERSONAL_BIRTHDAY", "PERSONAL_PROFESSION", "PERSONAL_GENDER", "PERSONAL_COUNTRY", "PERSONAL_STATE", "PERSONAL_CITY", "PERSONAL_ZIP", "PERSONAL_STREET", "PERSONAL_MAILBOX", "WORK_COMPANY", "WORK_DEPARTMENT", "WORK_POSITION", "WORK_COUNTRY", "WORK_STATE", "WORK_CITY", "WORK_ZIP", "WORK_STREET", "WORK_MAILBOX")), "USER_PROPERTY_SEARCHABLE" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_SONET_USER_PROPERTY_SEARCHABLE"), "TYPE" => "LIST", "VALUES" => $userProp, "MULTIPLE" => "Y", "DEFAULT" => array()), 'SHOW_YEAR' => array('TYPE' => 'LIST', 'MULTIPLE' => 'N', 'DEFAULT' => 'Y', 'VALUES' => array('Y' => GetMessage('INTR_ISBN_PARAM_SHOW_YEAR_VALUE_Y'), 'M' => GetMessage('INTR_ISBN_PARAM_SHOW_YEAR_VALUE_M'), 'N' => GetMessage('INTR_ISBN_PARAM_SHOW_YEAR_VALUE_N')), 'NAME' => GetMessage('INTR_ISBN_PARAM_SHOW_YEAR'), "PARENT" => "ADDITIONAL_SETTINGS"), "CACHE_TIME" => array('DEFAULT' => 3600), "NAME_TEMPLATE" => array("TYPE" => "LIST", "NAME" => GetMessage("SONET_NAME_TEMPLATE"), "VALUES" => CComponentUtil::GetDefaultNameTemplates(), "MULTIPLE" => "N", "ADDITIONAL_VALUES" => "Y", "DEFAULT" => "", "PARENT" => "VISUAL")));
$arComponentParameters["PARAMETERS"]["ALLOW_RATING_SORT"] = array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_ALLOW_RATING_SORT"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "REFRESH" => "Y");
$arComponentParameters["PARAMETERS"]["SHOW_RATING"] = array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SHOW_RATING"), "TYPE" => "LIST", "VALUES" => array("" => GetMessage("SHOW_RATING_CONFIG"), "Y" => GetMessage("MAIN_YES"), "N" => GetMessage("MAIN_NO")), "MULTIPLE" => "N", "DEFAULT" => "");
if ($arCurrentValues["SHOW_RATING"] != "N" || $arCurrentValues["ALLOW_RATING_SORT"] == "Y") {
$arRatingsList = array();
$db_res = CRatings::GetList($aSort = array("ID" => "ASC"), array("ACTIVE" => "Y", "ENTITY_ID" => "USER"));
while ($res = $db_res->Fetch()) {
$arRatingsList[$res["ID"]] = "[ " . $res["ID"] . " ] " . $res["NAME"];
}
$arComponentParameters["PARAMETERS"]["RATING_ID"] = array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("SONET_RATING_ID"), "TYPE" => "LIST", "VALUES" => $arRatingsList, "DEFAULT" => "", "REFRESH" => "Y");
$arComponentParameters["PARAMETERS"]["RATING_TYPE"] = array("NAME" => GetMessage("RATING_TYPE"), "TYPE" => "LIST", "VALUES" => array("" => GetMessage("RATING_TYPE_CONFIG"), "like" => GetMessage("RATING_TYPE_LIKE_TEXT"), "like_graphic" => GetMessage("RATING_TYPE_LIKE_GRAPHIC"), "standart_text" => GetMessage("RATING_TYPE_STANDART_TEXT"), "standart" => GetMessage("RATING_TYPE_STANDART_GRAPHIC")), "MULTIPLE" => "N", "DEFAULT" => "", "PARENT" => "ADDITIONAL_SETTINGS");
}
示例2: GetFieldsMap
public static function GetFieldsMap($bAdditional = false)
{
$arUserFields = CSocNetUser::GetFields($bAdditional);
return array_keys($arUserFields);
}
示例3: FormatDateFromDB
if ($arResult["User"]["AUTO_TIME_ZONE"] != "N") {
continue 2;
}
break;
case 'LAST_LOGIN':
if (StrLen($val) > 0) {
$val = FormatDateFromDB($val, $arParams["DATE_TIME_FORMAT"], true);
}
break;
default:
if (in_array($userFieldName, $arParams["SONET_USER_FIELDS_SEARCHABLE"])) {
$strSearch = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($userFieldName) . "=" . UrlEncode($val);
}
break;
}
$userFields = CSocNetUser::GetFields();
if (in_array($userFieldName, $arParams["USER_FIELDS_MAIN"])) {
$arResult["UserFieldsMain"]["DATA"][$userFieldName] = array("NAME" => $userFields[$userFieldName], "VALUE" => $val, "SEARCH" => $strSearch);
}
if (in_array($userFieldName, $arParams["USER_FIELDS_CONTACT"])) {
$arResult["UserFieldsContact"]["DATA"][$userFieldName] = array("NAME" => $userFields[$userFieldName], "VALUE" => $val, "SEARCH" => $strSearch);
}
if (in_array($userFieldName, $arParams["USER_FIELDS_PERSONAL"])) {
$arResult["UserFieldsPersonal"]["DATA"][$userFieldName] = array("NAME" => $userFields[$userFieldName], "VALUE" => $val, "SEARCH" => $strSearch);
}
}
}
if (count($arResult["UserFieldsMain"]["DATA"]) > 0) {
$arResult["UserFieldsMain"]["SHOW"] = "Y";
}
if (count($arResult["UserFieldsContact"]["DATA"]) > 0) {