[ Index ]

PHP Cross Reference of phpBB-3.3.14-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: 880 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

user:: (21 methods):
  __construct()
  is_setup()
  get_token_expiration()
  __get()
  setup()
  lang()
  get_plural_form()
  add_lang()
  set_lang()
  add_lang_ext()
  format_date()
  create_timezone()
  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_token_expiration()   X-Ref
Get expiration time for user tokens, e.g. activation or reset password tokens

return: int Expiration for user tokens

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

Implement array access for user::lang.

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

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.

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
return: int|bool     The plural-case we need to use for the number plural-rule combination, false if $force_rule

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: 4.0.0)
param: bool $use_help internal variable for recursion, do not use    @deprecated 3.2.0-dev (To be removed: 4.0.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

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.
return: mixed translated date

create_timezone($user_timezone = null)   X-Ref
Create a DateTimeZone object in the context of the current user

param: string $user_timezone Time zone of the current user.
return: \DateTimeZone DateTimeZone object linked to the current users locale

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

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

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.

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
return: int            Returns the unix timestamp

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.

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']
return: bool true if the option is set in the bit field, false otherwise

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

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']
return: int|bool If $data is false, the bit field is modified and

leave_newly_registered()   X-Ref
Function 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: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1