[ Index ]

PHP Cross Reference of phpBB-3.2.0-deutsch

title

Body

[close]

/phpbb/ -> user.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 804 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

user:: (19 methods):
  __construct()
  is_setup()
  __get()
  setup()
  lang()
  get_plural_form()
  add_lang()
  set_lang()
  add_lang_ext()
  format_date()
  create_datetime()
  get_timestamp_from_format()
  get_iso_lang_id()
  get_profile_fields()
  img()
  optionget()
  optionset()
  leave_newly_registered()
  get_passworded_forums()


Class: user  - X-Ref

Base user class

This is the overarching class which contains (through session extend)
all methods utilised for user functionality during a session.
__construct(\phpbb\language\language $lang, $datetime_class)   X-Ref
Constructor to set the lang path

param: \phpbb\language\language    $lang            phpBB's Language loader
param: string                        $datetime_class    Class name of datetime class

is_setup()   X-Ref
Returns whether user::setup was called

return: bool

__get($param_name)   X-Ref
Magic getter for BC compatibility

Implement array access for user::lang.

return: array    The appropriate array
param: string    $param_name    Name of the BC component the user want to access

setup($lang_set = false, $style_id = false)   X-Ref
Setup basic user-specific items (style, language, ...)


lang()   X-Ref
More advanced language substitution
Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
Params are the language key and the parameters to be substituted.
This function/functionality is inspired by SHS` and Ashe.

Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>

If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.


get_plural_form($number, $force_rule = false)   X-Ref
Determine which plural form we should use.
For some languages this is not as simple as for English.

return: int|bool     The plural-case we need to use for the number plural-rule combination, false if $force_rule
param: $number        int|float   The number we want to get the plural case for. Float numbers are floored.
param: $force_rule    mixed   False to use the plural rule of the language package

add_lang($lang_set, $use_db = false, $use_help = false, $ext_name = '')   X-Ref
Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)

param: mixed $lang_set specifies the language entries to include
param: bool $use_db internal variable for recursion, do not use    @deprecated 3.2.0-dev (To be removed: 3.3.0)
param: bool $use_help internal variable for recursion, do not use    @deprecated 3.2.0-dev (To be removed: 3.3.0)
param: string $ext_name The extension to load language from, or empty for core files

set_lang($lang_set, $use_help, $ext_name)   X-Ref
BC function for loading language files


add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false)   X-Ref
Add Language Items from an extension - use_db and use_help are assigned where needed (only use them to force inclusion)

param: string $ext_name The extension to load language from, or empty for core files
param: mixed $lang_set specifies the language entries to include
param: bool $use_db internal variable for recursion, do not use
param: bool $use_help internal variable for recursion, do not use

format_date($gmepoch, $format = false, $forcedate = false)   X-Ref
Format user date

return: mixed translated date
param: int $gmepoch unix timestamp
param: string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
param: bool $forcedate force non-relative date format.

create_datetime($time = 'now', \DateTimeZone $timezone = null)   X-Ref
Create a \phpbb\datetime object in the context of the current user

return: \phpbb\datetime Date time object linked to the current users locale
param: string $time String in a format accepted by strtotime().
param: DateTimeZone $timezone Time zone of the time.

get_timestamp_from_format($format, $time, \DateTimeZone $timezone = null)   X-Ref
Get the UNIX timestamp for a datetime in the users timezone, so we can store it in the database.

return: int            Returns the unix timestamp
param: string            $format        Format of the entered date/time
param: string            $time        Date/time with the timezone applied
param: DateTimeZone    $timezone    Timezone of the date/time, falls back to timezone of current user

get_iso_lang_id()   X-Ref
Get language id currently used by the user


get_profile_fields($user_id)   X-Ref
Get users profile fields


img($img, $alt = '')   X-Ref
Specify/Get image


optionget($key, $data = false)   X-Ref
Get option bit field from user options.

return: bool true if the option is set in the bit field, false otherwise
param: int $key option key, as defined in $keyoptions property.
param: int $data bit field value to use, or false to use $this->data['user_options']

optionset($key, $value, $data = false)   X-Ref
Set option bit field for user options.

return: int|bool If $data is false, the bit field is modified and
param: int $key Option key, as defined in $keyoptions property.
param: bool $value True to set the option, false to clear the option.
param: int $data Current bit field value, or false to use $this->data['user_options']

leave_newly_registered()   X-Ref
Funtion to make the user leave the NEWLY_REGISTERED system group.


get_passworded_forums()   X-Ref
Returns all password protected forum ids the user is currently NOT authenticated for.

return: array     Array of forum ids



Generated: Sun Feb 19 19:47:08 2017 Cross-referenced by PHPXref 0.7.1