phpBB3


Functions


Function Summary
void

_build_hidden_fields(mixed key, mixed value, mixed specialchar, mixed stripslashes)

Little helper for the build_hidden_fields function

void

_hash_crypt_private(mixed password, mixed setting, mixed itoa64)

The crypt function/replacement

void

_hash_encode64(mixed input, mixed count, mixed itoa64)

Encode hash

void

_hash_gensalt_private(mixed input, mixed itoa64, int iteration_count_log2)

Generate salt for hash generation

void

_sort_last_active(mixed first, mixed second)

void

add_form_key(string form_name)

Add a secret token to the form (requires the S_FORM_TOKEN template variable)

void

add_log()

Add log event

void

append_sid(string url, mixed params, bool is_amp, string session_id)

Append session id to url.

Returns

array_combine(array keys, array values)

A wrapper for the PHP5 function array_combine()

void

avatar_delete(mixed mode, mixed row, bool clean_db)

Remove avatar

void

avatar_gallery(mixed category, mixed avatar_select, mixed items_per_column, str block_var)

Avatar Gallery

void

avatar_get_dimensions(mixed avatar, mixed avatar_type, mixed error, int current_x, int current_y)

Tries to (re-)establish avatar dimensions

void

avatar_process_user(mixed error, bool custom_userdata, mixed can_upload)

Uploading/Changing user avatar

void

avatar_remote(mixed data, mixed error)

Remote avatar linkage

void

avatar_remove_db(mixed avatar_name)

Remove avatar also for users not having the group as default

void

avatar_upload(mixed data, mixed error)

Avatar upload using the upload class

static void

bbcode_nl2br(mixed text)

custom version of nl2br which takes custom BBCodes into account

string

build_hidden_fields(array field_ary, bool specialchar, bool stripslashes)

Build simple hidden fields from array

void

build_url(bool strip_vars)

Returns url from the session/current page with an re-appended SID with optionally stripping vars from the url

void

bump_topic_allowed(mixed forum_id, mixed topic_bumped, mixed last_post_time, mixed topic_poster, mixed last_topic_poster)

Bump Topic Check - used by posting and viewtopic

static void

censor_text(mixed text)

Censoring

void

check_form_key(string form_name, int timespan, string return_page, bool trigger)

Check the form key.

boolean

check_link_hash(string token, string link_name)

checks a link hash - for GET requests

void

check_rule(mixed rules, mixed rule_row, mixed message_row, mixed user_id)

Check Rule against Message Information

void

clean_sentbox(mixed num_sentbox_messages)

Delete Messages From Sentbox we are doing this here because this saves us a bunch of checks and queries

void

confirm_box(boolean check, string title, string hidden, string html_body, string u_action)

Build Confirm box

void

create_thumbnail(mixed source, mixed destination, mixed mimetype)

Create Thumbnail

void

decode_message(mixed message, str bbcode_uid)

Decode text whereby text is coming from the db and expected to be pre-parsed content We are placing this outside of the message parser because we are often in need of it...

void

delete_pm(mixed user_id, mixed msg_ids, mixed folder_id)

Delete PM(s)

void

delete_post(mixed forum_id, mixed topic_id, mixed post_id, mixed data)

Delete Post

void

display_custom_bbcodes()

Assign/Build custom bbcodes for display in screens supporting using of bbcodes The custom bbcodes buttons will be placed within the template block 'custom_codes'

void

display_forums(str root_data, bool display_moderators, bool return_moderators)

Display Forums

void

display_reasons(int reason_id)

Display reasons

void

display_user_activity(mixed userdata)

Display user activity (action forum/topic)

void

download_allowed()

Check if downloading item is allowed

void

exit_handler()

Handler for exit calls in phpBB.

bool

extension_allowed(mixed forum_id, string extension, array &$extensions, mixed extensions)

Check if extension is allowed to be posted.

void

feed_format_date(mixed time)

Generate ISO 8601 date string (RFC 3339)

static void

feed_generate_content(mixed content, mixed uid, mixed bitfield, mixed options)

Generate text content

void

file_gc()

void

garbage_collection()

Closing the cache object and the database Cool function name, eh? We might want to add operations to it later

void

gen_forum_auth_level(string mode, int forum_id, int forum_status)

User authorisation levels output

string

gen_rand_string(int num_chars)

Generates an alphanumeric random string of given length

string

gen_rand_string_friendly(int num_chars)

Generates a user-friendly alphanumeric random string of given length We remove 0 and O so users cannot confuse those in passwords etc.

void

gen_sort_selects(mixed limit_days, mixed sort_by_text, mixed sort_days, mixed sort_key, mixed sort_dir, mixed s_limit_days, mixed s_sort_key, mixed s_sort_dir, mixed u_sort_param, bool def_st, bool def_sk, bool def_sd)

Generate sort selection fields

string

generate_board_url(bool without_script_path)

Generate board url (example: http://www.example.com/phpBB)

void

generate_forum_nav(mixed forum_data)

Create forum navigation links for given forum, create parent list if currently null, assign basic forum info to template

void

generate_forum_rules(mixed forum_data)

Create forum rules for given forum

string

generate_link_hash(string link_name)

Add a secret hash for use in links/GET requests

void

generate_pagination(mixed base_url, mixed num_items, mixed per_page, mixed start_item, bool add_prevnext_text, str tpl_prefix)

Pagination routine, generates page number sequence tpl_prefix is for using different pagination blocks at one page

void

generate_smilies(mixed mode, mixed forum_id)

Fill smiley templates (or just the variables) with smilies, either in a window or inline

void

generate_text_for_display(mixed text, mixed uid, mixed bitfield, mixed flags)

For display of custom parsed text on user-facing pages Expects $text to be the value directly from the database (stored value)

void

generate_text_for_edit(mixed text, mixed uid, mixed flags)

For decoding custom parsed text for edits as well as extracting the flags Expects $text to be the value directly from the database (pre-parsed content)

static void

generate_text_for_storage(mixed text, mixed uid, mixed bitfield, mixed flags, bool allow_bbcode, bool allow_urls, bool allow_smilies)

For parsing custom parsed text to be stored within the database.

void

get_avatar_filename(mixed avatar_entry)

Generates avatar filename from the database entry

string

get_backtrace()

Return a nicely formatted backtrace.

string

get_censor_preg_expression(string word, bool use_unicode)

Generate regexp for naughty words censoring Depends on whether installed PHP version supports unicode properties

void

get_complete_topic_tracking(mixed forum_id, mixed topic_ids, bool global_announce_list)

Get topic tracking info from db (for cookie based tracking only this function is used)

string

get_context(string text, string words, int length)

Generates a text with approx.

void

get_folder_status(mixed folder_id, mixed folder)

Get folder status

mixed

get_formatted_filesize(mixed value, bool string_only, array allowed_units)

Return formatted string for filesizes

void

get_forum_parents(mixed forum_data)

Returns forum parents as an array.

void

get_group_name(mixed group_id)

Get group name

void

get_img_size_format(mixed width, mixed height)

Calculate the needed size for Thumbnail

void

get_moderators(mixed forum_moderators, bool forum_id)

Obtain list of moderators of each forum

void

get_preg_expression(mixed mode)

This function returns a regular expression pattern for commonly used expressions Use with / as delimiter for email mode and # for url modes mode can be: email|bbcode_htm|url|url_inline|www_url|www_url_inline|relative_url|relative_url_inline|ipv4|ipv6

array

get_recipient_strings(array pm_by_id)

Generates an array of coloured recipient names from a list of PMs - (groups & users)

void

get_supported_image_types(bool type)

Return supported image types

void

get_topic_tracking(mixed forum_id, mixed topic_ids, mixed rowset, mixed forum_mark_time, bool global_announce_list)

Get topic tracking info by using already fetched info

array[int][int]

get_unread_topics(int user_id, string sql_extra, string sql_sort, string sql_limit, string sql_limit_offset)

Get list of unread topics

string

get_user_avatar(string avatar, int avatar_type, string avatar_width, string avatar_height, string alt, bool ignore_config)

Get user avatar

void

get_user_rank(int user_rank, int user_posts, string &$rank_title, string &$rank_img, string &$rank_img_src, mixed rank_title, mixed rank_img, mixed rank_img_src)

Get user rank title and image

string

get_username_string(string mode, int user_id, string username, string username_colour, string guest_username, string custom_profile_url)

Get username details for placing into templates.

void

group_correct_avatar(mixed group_id, mixed old_entry)

Changes a group avatar's filename to conform to the naming scheme

void

group_create(mixed group_id, mixed type, mixed name, mixed desc, mixed group_attributes, bool allow_desc_bbcode, bool allow_desc_urls, bool allow_desc_smilies)

Add or edit a group.

void

group_delete(mixed group_id, bool group_name)

Group Delete

void

group_memberships(bool group_id_ary, bool user_id_ary, bool return_bool)

Obtain either the members of a specified group, the groups the specified user is subscribed to or checking if a specified user is in a specified group.

void

group_update_listings(mixed group_id)

Re-cache moderators and foes if group has a_ or m_ permissions

mixed

group_user_add(mixed group_id, bool user_id_ary, bool username_ary, bool group_name, bool default, int leader, int pending, bool group_attributes)

Add user(s) to group

void

group_user_attributes(mixed action, mixed group_id, bool user_id_ary, bool username_ary, bool group_name, bool group_attributes)

This is used to promote (to leader), demote or set as default a member/s

false

group_user_del(mixed group_id, bool user_id_ary, bool username_ary, bool group_name)

Remove a user/s from a given group.

void

group_validate_groupname(mixed group_id, mixed group_name)

A small version of validate_username to check for a group name's existence.

void

handle_mark_actions(mixed user_id, mixed mark_action)

Handle all actions possible with marked messages

void

handle_post_delete(mixed forum_id, mixed topic_id, mixed post_id, mixed post_data)

Do the various checks required for removing posts as well as removing it

void

header_filename(mixed file)

Get a browser friendly UTF-8 encoded filename

void

htmlspecialchars_decode(mixed string, mixed quote_style)

A wrapper for htmlspecialchars_decode

boolean

is_absolute(string path)

Checks if a path ($path) is absolute or relative

void

language_select(str default)

Pick a language, any language ...

void

load_drafts(int topic_id, int forum_id, int id, str pm_action, int msg_id)

Load Drafts

void

login_box(str redirect, str l_explain, str l_success, bool admin, bool s_display)

Generate login box or verify password

void

login_forum_box(mixed forum_data)

Generate forum login box

void

mail_encode(string eol, mixed str)

Encodes the given string for proper display in UTF-8.

void

make_clickable(mixed text, bool server_url, str class)

make_clickable functionReplace magic urls of form http://xxx.xxx., www.xxx.

void

make_clickable_callback(mixed type, mixed whitespace, mixed url, mixed relative_url, mixed class)

A subroutine of make_clickable used with preg_replace It places correct HTML around an url, shortens the displayed text and makes sure no entities are inside URLs

void

make_jumpbox(mixed action, bool forum_id, bool select_all, bool acl_list, bool force_display)

Generate Jumpbox

void

markread(int user_id, mixed mode, bool forum_id, bool topic_id, int post_time)

Marks a topic/forum as read Marks a topic as posted to

void

message_history(mixed msg_id, mixed user_id, mixed message_row, mixed folder, bool in_post_mode)

Display Message History

void

meta_refresh(int time, string url, bool disable_cd_check)

Meta refresh assignment Adds META template variable with meta http tag.

void

move_pm(mixed user_id, mixed message_limit, mixed move_msg_ids, mixed dest_folder, mixed cur_folder_id)

Move PM from one to another folder

void

msg_handler(mixed errno, mixed msg_text, mixed errfile, mixed errline)

Error and message handler, call with trigger_error if reqd

static int

obtain_guest_count(int item_id, string item)

Queries the session table to get information about online guests

array

obtain_users_online(int item_id, string item)

Queries the session table to get information about online users

array

obtain_users_online_string(mixed online_users, int item_id, string item)

Uses the result of obtain_users_online to generate a localized, readable representation.

void

on_page(mixed num_items, mixed per_page, mixed start)

Return current page (pagination)

void

page_footer(bool run_cron)

Generate page footer

void

page_header(str page_title, bool display_online_list, int item_id, str item)

Generate page header

void

parse_attachments(mixed forum_id, string &$message, array &$attachments, array &$update_count, bool preview, mixed message, mixed attachments, mixed update_count)

General attachment parsing

void

parse_cfg_file(mixed filename, bool lines)

Parse cfg file

string

phpbb_bump_topic(int forum_id, int topic_id, array post_data, int bump_time)

Handle topic bumping

bool

phpbb_check_hash(string password, string hash)

Check for correct password

mixed

phpbb_checkdnsrr(string host, string type)

Wrapper for php's checkdnsrr function.

bool

phpbb_chmod(string filename, int perms)

Global function for chmodding directories and files for internal useThis function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.

string

phpbb_clean_path(string path)

Eliminates useless .

boolean

phpbb_delete_user_pms(int user_id)

Delete all PM(s) for a given user and delete the ones without references

string

phpbb_email_hash(string email)

Hashes an email address to a big integer

string

phpbb_filter_root_path(string errfile)

Removes absolute path to phpBB root directory from error messages and converts backslashes to forward slashes.

array

phpbb_get_banned_user_ids(array user_ids)

Gets user ids of currently banned registered users.

array

phpbb_gmgetdate(int time)

Wrapper for getdate() which returns the equivalent array for UTC timestamps.

static void

phpbb_hash(mixed password)

null

phpbb_http_login(array param)

Login using http authenticate.

bool

phpbb_is_greater_ie_version(string user_agent, int version)

Check if the browser is internet explorer version 7+

static bool

phpbb_is_writable(string file)

Test if a file/directory is writableThis function calls the native is_writable() when not running under Windows and it is not disabled.

void

phpbb_mail(mixed to, mixed subject, mixed msg, mixed headers, mixed eol, mixed err_msg)

Wrapper for sending out emails with the PHP's mail function

static int

phpbb_mt_rand(int min, int max)

Wrapper for mt_rand() which allows swapping $min and $max parameters.

bool

phpbb_optionget(int bit, int data)

Get option bitfield from custom data

int

phpbb_optionset(int bit, bool set, int data)

Set option bitfield

mixed

phpbb_own_realpath(string path)

void

phpbb_realpath(mixed path)

A wrapper for realpath

boolean

phpbb_style_is_active(int style_id)

Verifies whether a style ID corresponds to an active style.

null

phpbb_update_rows_avoiding_duplicates(dbal db, string table, string column, array from_values, int to_value)

Updates rows in given table from a set of values to a new value.

null

phpbb_update_rows_avoiding_duplicates_notify_status(dbal db, string table, string column, array from_values, int to_value)

Updates rows in given table from a set of values to a new value.

void

phpbb_user_session_handler()

Handler for init calls in phpBB.

bool|string

phpbb_validate_hex_colour(string colour, bool optional)

Validate hex colour value

mixed

phpbb_version_compare(string version1, string version2, string operator)

Wrapper for version_compare() that allows using uppercase A and B for alpha and beta releases.

void

place_pm_into_folder(mixed global_privmsgs_rules, bool release)

Place new messages into appropriate folder

void

pm_notification(mixed mode, mixed author, mixed recipients, mixed subject, mixed message, mixed msg_id)

PM Notification

void

posting_gen_attachment_entry(mixed attachment_data, mixed filename_data, bool show_attach_box)

Generate inline attachment entry

void

posting_gen_inline_attachments(mixed attachment_data)

Assign Inline attachments (build option fields)

void

posting_gen_topic_icons(mixed mode, mixed icon_id)

Generate Topic Icons for display

void

posting_gen_topic_types(mixed forum_id, mixed cur_topic_type)

Build topic types able to be selected

void

reapply_sid(mixed url)

Re-Apply session id after page reloads

void

rebuild_header(mixed check_ary)

Rebuild message header

void

redirect(string url, bool return, bool disable_cd_check)

Redirects the user to another page then exits the script nicely This function is intended for urls within the board.

void

remove_default_avatar(mixed group_id, mixed user_ids)

Removes the group avatar of the default group from the users in user_ids who have that group as default.

void

remove_default_rank(mixed group_id, mixed user_ids)

Removes the group rank of the default group from the users in user_ids who have that group as default.

void

remove_newly_registered($user_id The, mixed user_id, bool user_data)

Funtion to make a user leave the NEWLY_REGISTERED system group.

void

request_var(mixed var_name, mixed default, bool multibyte, bool cookie)

request_varUsed to get passed variable

void

send_file_to_browser(mixed attachment, mixed upload_dir, mixed category)

Send file to browser

null

send_status_line(int code, string message)

Outputs correct status line header.

null

set_config(string config_name, string config_value, bool is_dynamic)

Sets a configuration option's value.

null

set_config_count(string config_name, int increment, bool is_dynamic)

Increments an integer config value directly in the database.

void

set_modified_headers(mixed stamp, mixed browser)

Check if the browser has the file already and set the appropriate headers-

void

set_user_message_limit()

Set correct users max messages in PM folder.

static void

short_ipv6(mixed ip, mixed length)

Returns the first block of the specified IPv6 address and as many additional ones as specified in the length paramater.

void

smiley_text(mixed text, bool force_option)

Smiley processing

void

smtpmail(mixed addresses, mixed subject, mixed message, mixed err_msg, bool headers)

Replacement or substitute for PHP's mail command

bool

still_on_time(int extra_time)

Determine whether we are approaching the maximum execution time.

Converts

str_split(array string, array split_length)

A wrapper for the PHP5 function str_split()

void

strip_bbcode(mixed text, str uid)

Strips all bbcode from a text and returns the plain content

mixed

stripos(string haystack, string needle)

A wrapper for the PHP5 function stripos Find position of first occurrence of a case-insensitive string

void

style_select(str default, bool all)

Pick a template/theme combo,

void

submit_pm(mixed mode, mixed subject, mixed data, bool put_in_outbox)

Submit PM

void

submit_post(mixed mode, mixed subject, mixed username, mixed topic_type, mixed poll, mixed data, bool update_message, bool update_search_index)

Submit Post

void

topic_generate_pagination(mixed replies, mixed url)

Generate topic pagination

void

topic_review(mixed topic_id, mixed forum_id, str mode, int cur_post_id, bool show_quote_button)

Topic Review

void

topic_status(mixed topic_row, mixed replies, mixed unread_topic, mixed folder_img, mixed folder_alt, mixed topic_type)

Generate topic status

void

tracking_serialize(mixed input)

Transform an array into a serialized format

void

tracking_unserialize(mixed string, int max_depth)

Transform a serialized array into an actual array

void

truncate_string(string string, int max_length, int max_store_length, bool allow_reply, string append)

Truncates string while retaining special characters if going over the max length The default max length is 60 at the moment The maximum storage length is there to fit the string within the given length.

void

tz_select(str default, bool truncate)

Pick a timezone

void

unique_id(string extra)

Return unique id

true

update_forum_tracking_info(int forum_id, int forum_last_post_time, int f_mark_time, int mark_time_forum)

Check for read forums and update topic tracking info accordingly

void

update_last_username()

Get latest registered username and update database to reflect it

void

update_pm_counts()

Update user PM count

void

update_post_information(string type, mixed ids, bool return_update_sql)

Update last post information Should be used instead of sync() if only the last post information are out of sync...

void

update_unread_status(mixed unread, mixed msg_id, mixed user_id, mixed folder_id)

Update unread message status

void

upload_attachment(mixed form_name, mixed forum_id, bool local, str local_storage, bool is_message, bool local_filedata)

Upload Attachment - filedata is generated here Uses upload class

void

user_active_flip(string mode, mixed user_id_ary, mixed reason)

Flips user_type from active to inactive and vice versa, handles group membership updates

the

user_add(mixed user_row, string cp_data)

Adds an user

boolean

user_ban(string mode, mixed ban, int ban_len, string ban_len_other, boolean ban_exclude, string ban_reason, str ban_give_reason)

Add a ban or ban exclusion to the banlist.

void

user_delete(mixed mode, mixed user_id, bool post_username)

Remove User

void

user_get_id_name(array &$user_id_ary, array &$username_ary, mixed user_type, mixed user_id_ary, mixed username_ary)

Obtain user_ids from usernames or vice versa.

string

user_ipwhois(string ip)

Internet Protocol Address Whois RFC3912: WHOIS Protocol Specification

void

user_notification(mixed mode, mixed subject, mixed topic_title, mixed forum_name, mixed forum_id, mixed topic_id, mixed post_id, str author_name)

User Notification

void

user_unban(mixed mode, mixed ban)

Unban User

void

user_update_name(string old_name, string new_name)

Updates a username across all relevant tables/fields

void

validate_data(mixed data, mixed val_ary)

Data validation ...

boolean

validate_date(String string, mixed date_string, bool optional)

Validate Date

mixed

validate_email(string email, string allowed_email)

Check to see if email address is banned or already present in the DB

void

validate_jabber(mixed jid)

Validate jabber address Taken from the jabber class within flyspray (see author notes)

bool|string

validate_language_iso_name(string lang_iso)

Validate Language Pack ISO NameTests whether a language name is valid and installed

boolean|string

validate_match(mixed string, bool optional, str match)

Validate Match

boolean|string

validate_num(mixed num, bool optional, int min, mixed max)

Validate Number

boolean|string

validate_password(mixed password)

Check to see if the password meets the complexity settings

boolean|string

validate_string(mixed string, bool optional, int min, int max)

Validate String

mixed

validate_username(string username, string allowed_username)

Check to see if the username has been taken, or if it is disallowed.

void

watch_topic_forum(mixed mode, mixed s_watching, mixed user_id, mixed forum_id, mixed topic_id, str notify_status, int start, str item_title)

Topic and forum watching common code

void

wrap_img_in_html(mixed src, mixed title)

Wraps an url into a simple html page.

void

write_pm_addresses(mixed check_ary, mixed author_id, bool plaintext)

Print out/assign recipient information

Function Detail

includes/functions.php at line 3266

_build_hidden_fields

public void _build_hidden_fields(mixed key, mixed value, mixed specialchar, mixed stripslashes)

Little helper for the build_hidden_fields function


includes/functions.php at line 578

_hash_crypt_private

public void _hash_crypt_private(mixed password, mixed setting, mixed itoa64)

The crypt function/replacement


includes/functions.php at line 534

_hash_encode64

public void _hash_encode64(mixed input, mixed count, mixed itoa64)

Encode hash


includes/functions.php at line 517

_hash_gensalt_private

public void _hash_gensalt_private(mixed input, mixed itoa64, int iteration_count_log2)

Generate salt for hash generation


memberlist.php at line 1153

_sort_last_active

public void _sort_last_active(mixed first, mixed second)

includes/functions.php at line 2801

add_form_key

public void add_form_key(string form_name)

Add a secret token to the form (requires the S_FORM_TOKEN template variable)

Parameters:
form_name - The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply

includes/functions.php at line 3371

add_log

public void add_log()

Add log event


includes/functions.php at line 2263

append_sid

public void append_sid(string url, mixed params, bool is_amp, string session_id)

Append session id to url. This function supports hooks.

Parameters:
url - The url the session id needs to be appended to (can have params)
params - String or array of additional url parameters
is_amp - Is url using & (true) or & (false)
session_id - Possibility to use a custom session id instead of the global one Examples: append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&f=2"); append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2'); append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false); append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));

includes/functions.php at line 924

array_combine

public Returns array_combine(array keys, array values)

A wrapper for the PHP5 function array_combine()

Parameters:
keys - contains keys for the resulting array
values - contains values for the resulting array
Returns:
an array by using the values from the keys array as keys and the values from the values array as the corresponding values. Returns false if the number of elements for each array isn't equal or if the arrays are empty.

includes/functions_user.php at line 1937

avatar_delete

public void avatar_delete(mixed mode, mixed row, bool clean_db)

Remove avatar


includes/functions_user.php at line 2116

avatar_gallery

public void avatar_gallery(mixed category, mixed avatar_select, mixed items_per_column, str block_var)

Avatar Gallery


includes/functions_user.php at line 2221

avatar_get_dimensions

public void avatar_get_dimensions(mixed avatar, mixed avatar_type, mixed error, int current_x, int current_y)

Tries to (re-)establish avatar dimensions


includes/functions_user.php at line 2274

avatar_process_user

public void avatar_process_user(mixed error, bool custom_userdata, mixed can_upload)

Uploading/Changing user avatar


includes/functions_user.php at line 1967

avatar_remote

public void avatar_remote(mixed data, mixed error)

Remote avatar linkage


includes/functions_user.php at line 2629

avatar_remove_db

public void avatar_remove_db(mixed avatar_name)

Remove avatar also for users not having the group as default


includes/functions_user.php at line 2045

avatar_upload

public void avatar_upload(mixed data, mixed error)

Avatar upload using the upload class


includes/functions_content.php at line 721

bbcode_nl2br

public static void bbcode_nl2br(mixed text)

custom version of nl2br which takes custom BBCodes into account


includes/functions.php at line 3300

build_hidden_fields

public string build_hidden_fields(array field_ary, bool specialchar, bool stripslashes)

Build simple hidden fields from array

Parameters:
field_ary - an array of values to build the hidden field from
specialchar - if true, keys and values get specialchared
stripslashes - if true, keys and values get stripslashed
Returns:
the hidden fields

includes/functions.php at line 2625

build_url

public void build_url(bool strip_vars)

Returns url from the session/current page with an re-appended SID with optionally stripping vars from the url


includes/functions_content.php at line 210

bump_topic_allowed

public void bump_topic_allowed(mixed forum_id, mixed topic_bumped, mixed last_post_time, mixed topic_poster, mixed last_topic_poster)

Bump Topic Check - used by posting and viewtopic


includes/functions_content.php at line 684

censor_text

public static void censor_text(mixed text)

Censoring


includes/functions.php at line 2826

check_form_key

public void check_form_key(string form_name, int timespan, string return_page, bool trigger)

Check the form key. Required for all altering actions not secured by confirm_box

Parameters:
form_name - The name of the form; has to match the name used in add_form_key, otherwise no restrictions apply
timespan - The maximum acceptable age for a submitted form in seconds. Defaults to the config setting.
return_page - The address for the return link
trigger - If true, the function will triger an error when encountering an invalid form

includes/functions.php at line 2792
public boolean check_link_hash(string token, string link_name)

checks a link hash - for GET requests

Parameters:
token - the submitted token
link_name - The name of the link
Returns:
true if all is fine

includes/functions_privmsgs.php at line 249

check_rule

public void check_rule(mixed rules, mixed rule_row, mixed message_row, mixed user_id)

Check Rule against Message Information


includes/functions_privmsgs.php at line 220

clean_sentbox

public void clean_sentbox(mixed num_sentbox_messages)

Delete Messages From Sentbox we are doing this here because this saves us a bunch of checks and queries


includes/functions.php at line 2877

confirm_box

public void confirm_box(boolean check, string title, string hidden, string html_body, string u_action)

Build Confirm box

Parameters:
check - True for checking if confirmed (without any additional parameters) and false for displaying the confirm box
title - Title/Message used for confirm box. message text is _CONFIRM appended to title. If title cannot be found in user->lang a default one is displayed If title_CONFIRM cannot be found in user->lang the text given is used.
hidden - Hidden variables
html_body - Template used for confirm box
u_action - Custom form action

includes/functions_posting.php at line 617

create_thumbnail

public void create_thumbnail(mixed source, mixed destination, mixed mimetype)

Create Thumbnail


includes/functions_content.php at line 367

decode_message

public void decode_message(mixed message, str bbcode_uid)

Decode text whereby text is coming from the db and expected to be pre-parsed content We are placing this outside of the message parser because we are often in need of it...


includes/functions_privmsgs.php at line 883

delete_pm

public void delete_pm(mixed user_id, mixed msg_ids, mixed folder_id)

Delete PM(s)


includes/functions_posting.php at line 1384

delete_post

public void delete_post(mixed forum_id, mixed topic_id, mixed post_id, mixed data)

Delete Post


includes/functions_display.php at line 888

display_custom_bbcodes

public void display_custom_bbcodes()

Assign/Build custom bbcodes for display in screens supporting using of bbcodes The custom bbcodes buttons will be placed within the template block 'custom_codes'


includes/functions_display.php at line 22

display_forums

public void display_forums(str root_data, bool display_moderators, bool return_moderators)

Display Forums


includes/functions_display.php at line 926

display_reasons

public void display_reasons(int reason_id)

Display reasons


includes/functions_display.php at line 957

display_user_activity

public void display_user_activity(mixed userdata)

Display user activity (action forum/topic)


download/file.php at line 488

download_allowed

public void download_allowed()

Check if downloading item is allowed


includes/functions.php at line 4873

exit_handler

public void exit_handler()

Handler for exit calls in phpBB. This function supports hooks.

Note: This function is called after the template has been outputted.


includes/functions_content.php at line 1089

extension_allowed

public bool extension_allowed(mixed forum_id, string extension, array &$extensions, mixed extensions)

Check if extension is allowed to be posted.

Parameters:
forum_id - The forum id to check or false if private message
extension - The extension to check, for example zip.
&$extensions - The extension array holding the information from the cache (will be obtained if empty)
Returns:
False if the extension is not allowed to be posted, else true.

feed.php at line 186

feed_format_date

public void feed_format_date(mixed time)

Generate ISO 8601 date string (RFC 3339)


feed.php at line 213

feed_generate_content

public static void feed_generate_content(mixed content, mixed uid, mixed bitfield, mixed options)

Generate text content


download/file.php at line 623

file_gc

public void file_gc()

includes/functions.php at line 4850

garbage_collection

public void garbage_collection()

Closing the cache object and the database Cool function name, eh? We might want to add operations to it later


includes/functions_display.php at line 783

gen_forum_auth_level

public void gen_forum_auth_level(string mode, int forum_id, int forum_status)

User authorisation levels output

Parameters:
mode - Can be forum or topic. Not in use at the moment.
forum_id - The current forum the user is in.
forum_status - The forums status bit.

includes/functions.php at line 225

gen_rand_string

public string gen_rand_string(int num_chars)

Generates an alphanumeric random string of given length


includes/functions.php at line 237

gen_rand_string_friendly

public string gen_rand_string_friendly(int num_chars)

Generates a user-friendly alphanumeric random string of given length We remove 0 and O so users cannot confuse those in passwords etc.


includes/functions_content.php at line 44

gen_sort_selects

public void gen_sort_selects(mixed limit_days, mixed sort_by_text, mixed sort_days, mixed sort_key, mixed sort_dir, mixed s_limit_days, mixed s_sort_key, mixed s_sort_dir, mixed u_sort_param, bool def_st, bool def_sk, bool def_sd)

Generate sort selection fields


includes/functions.php at line 2372

generate_board_url

public string generate_board_url(bool without_script_path)

Generate board url (example: http://www.example.com/phpBB)

Parameters:
without_script_path - if set to true the script path gets not appended (example: http://www.example.com)
Returns:
the generated board url

includes/functions_display.php at line 558

generate_forum_nav

public void generate_forum_nav(mixed forum_data)

Create forum navigation links for given forum, create parent list if currently null, assign basic forum info to template


includes/functions_display.php at line 533

generate_forum_rules

public void generate_forum_rules(mixed forum_data)

Create forum rules for given forum


includes/functions.php at line 2773
public string generate_link_hash(string link_name)

Add a secret hash for use in links/GET requests

Parameters:
link_name - The name of the link; has to match the name used in check_link_hash, otherwise no restrictions apply
Returns:
the hash

includes/functions.php at line 2144

generate_pagination

public void generate_pagination(mixed base_url, mixed num_items, mixed per_page, mixed start_item, bool add_prevnext_text, str tpl_prefix)

Pagination routine, generates page number sequence tpl_prefix is for using different pagination blocks at one page


includes/functions_posting.php at line 22

generate_smilies

public void generate_smilies(mixed mode, mixed forum_id)

Fill smiley templates (or just the variables) with smilies, either in a window or inline


includes/functions_content.php at line 412

generate_text_for_display

public void generate_text_for_display(mixed text, mixed uid, mixed bitfield, mixed flags)

For display of custom parsed text on user-facing pages Expects $text to be the value directly from the database (stored value)


includes/functions_content.php at line 493

generate_text_for_edit

public void generate_text_for_edit(mixed text, mixed uid, mixed flags)

For decoding custom parsed text for edits as well as extracting the flags Expects $text to be the value directly from the database (pre-parsed content)


includes/functions_content.php at line 455

generate_text_for_storage

public static void generate_text_for_storage(mixed text, mixed uid, mixed bitfield, mixed flags, bool allow_bbcode, bool allow_urls, bool allow_smilies)

For parsing custom parsed text to be stored within the database. This function additionally returns the uid and bitfield that needs to be stored. Expects $text to be the value directly from request_var() and in it's non-parsed form


includes/functions_user.php at line 2094

get_avatar_filename

public void get_avatar_filename(mixed avatar_entry)

Generates avatar filename from the database entry


includes/functions.php at line 3442

get_backtrace

public string get_backtrace()

Return a nicely formatted backtrace.

Turns the array returned by debug_backtrace() into HTML markup. Also filters out absolute paths to phpBB root.

Returns:
HTML markup

includes/functions.php at line 3552

get_censor_preg_expression

public string get_censor_preg_expression(string word, bool use_unicode)

Generate regexp for naughty words censoring Depends on whether installed PHP version supports unicode properties

Parameters:
word - word template to be replaced
use_unicode - whether or not to take advantage of PCRE supporting unicode
Returns:
$preg_expr regex to use with word censor

includes/functions.php at line 1661

get_complete_topic_tracking

public void get_complete_topic_tracking(mixed forum_id, mixed topic_ids, bool global_announce_list)

Get topic tracking info from db (for cookie based tracking only this function is used)


includes/functions_content.php at line 248

get_context

public string get_context(string text, string words, int length)

Generates a text with approx. the specified length which contains the specified words and their context

Parameters:
text - The full text from which context shall be extracted
words - An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!)
length - The desired length of the resulting text, however the result might be shorter or longer than this value
Returns:
Context of the specified words separated by "..."

includes/functions_privmsgs.php at line 1403

get_folder_status

public void get_folder_status(mixed folder_id, mixed folder)

Get folder status


includes/functions.php at line 319

get_formatted_filesize

public mixed get_formatted_filesize(mixed value, bool string_only, array allowed_units)

Return formatted string for filesizes

Parameters:
value - filesize in bytes (non-negative number; int, float or string)
string_only - true if language string should be returned
allowed_units - only allow these units (data array indexes)
Returns:
data array if $string_only is false
Author:
bantu

includes/functions_display.php at line 618

get_forum_parents

public void get_forum_parents(mixed forum_data)

Returns forum parents as an array. Get them from forum_data if available, or update the database otherwise


includes/functions_user.php at line 3319

get_group_name

public void get_group_name(mixed group_id)

Get group name


includes/functions_posting.php at line 526

get_img_size_format

public void get_img_size_format(mixed width, mixed height)

Calculate the needed size for Thumbnail


includes/functions_display.php at line 702

get_moderators

public void get_moderators(mixed forum_moderators, bool forum_id)

Obtain list of moderators of each forum


includes/functions.php at line 3483

get_preg_expression

public void get_preg_expression(mixed mode)

This function returns a regular expression pattern for commonly used expressions Use with / as delimiter for email mode and # for url modes mode can be: email|bbcode_htm|url|url_inline|www_url|www_url_inline|relative_url|relative_url_inline|ipv4|ipv6


includes/functions_privmsgs.php at line 2030

get_recipient_strings

public array get_recipient_strings(array pm_by_id)

Generates an array of coloured recipient names from a list of PMs - (groups & users)

Parameters:
pm_by_id - An array of rows from PRIVMSGS_TABLE, keys are the msg_ids.
Returns:
2D Array: array(msg_id => array('username or group string', ...), ...) Usernames are generated with {@link get_username_string get_username_string} Groups are coloured and have a link to the membership page

includes/functions_posting.php at line 552

get_supported_image_types

public void get_supported_image_types(bool type)

Return supported image types


includes/functions.php at line 1583

get_topic_tracking

public void get_topic_tracking(mixed forum_id, mixed topic_ids, mixed rowset, mixed forum_mark_time, bool global_announce_list)

Get topic tracking info by using already fetched info


includes/functions.php at line 1794

get_unread_topics

public array[int][int] get_unread_topics(int user_id, string sql_extra, string sql_sort, string sql_limit, string sql_limit_offset)

Get list of unread topics

Parameters:
user_id - User ID (or false for current user)
sql_extra - Extra WHERE SQL statement
sql_sort - ORDER BY SQL sorting statement
sql_limit - Limits the size of unread topics list, 0 for unlimited query
sql_limit_offset - Sets the offset of the first row to search, 0 to search from the start
Returns:
Topic ids as keys, mark_time of topic as value

includes/functions_display.php at line 1282

get_user_avatar

public string get_user_avatar(string avatar, int avatar_type, string avatar_width, string avatar_height, string alt, bool ignore_config)

Get user avatar

Parameters:
avatar - Users assigned avatar name
avatar_type - Type of avatar
avatar_width - Width of users avatar
avatar_height - Height of users avatar
alt - Optional language string for alt tag within image, can be a language key or text
ignore_config - Ignores the config-setting, to be still able to view the avatar in the UCP
Returns:
Avatar image

includes/functions_display.php at line 1236

get_user_rank

public void get_user_rank(int user_rank, int user_posts, string &$rank_title, string &$rank_img, string &$rank_img_src, mixed rank_title, mixed rank_img, mixed rank_img_src)

Get user rank title and image

Parameters:
user_rank - the current stored users rank id
user_posts - the users number of posts
&$rank_title - the rank title will be stored here after execution
&$rank_img - the rank image as full img tag is stored here after execution
&$rank_img_src - the rank image source is stored here after execution Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false

includes/functions_content.php at line 1178

get_username_string

public string get_username_string(string mode, int user_id, string username, string username_colour, string guest_username, string custom_profile_url)

Get username details for placing into templates. This function caches all modes on first call, except for no_profile and anonymous user - determined by $user_id.

Parameters:
mode - Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour), full (for obtaining a html string representing a coloured link to the users profile) or no_profile (the same as full but forcing no profile link)
user_id - The users id
username - The users name
username_colour - The users colour
guest_username - optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then.
custom_profile_url - optional parameter to specify a profile url. The user id get appended to this url as &u={user_id}
Returns:
A string consisting of what is wanted based on $mode.
Author:
BartVB, Acyd Burn

includes/functions_user.php at line 2606

group_correct_avatar

public void group_correct_avatar(mixed group_id, mixed old_entry)

Changes a group avatar's filename to conform to the naming scheme


includes/functions_user.php at line 2438

group_create

public void group_create(mixed group_id, mixed type, mixed name, mixed desc, mixed group_attributes, bool allow_desc_bbcode, bool allow_desc_urls, bool allow_desc_smilies)

Add or edit a group. If we're editing a group we only update user parameters such as rank, etc. if they are changed


includes/functions_user.php at line 2644

group_delete

public void group_delete(mixed group_id, bool group_name)

Group Delete


includes/functions_user.php at line 3344

group_memberships

public void group_memberships(bool group_id_ary, bool user_id_ary, bool return_bool)

Obtain either the members of a specified group, the groups the specified user is subscribed to or checking if a specified user is in a specified group. This function does not return pending memberships.

Note: Never use this more than once... first group your users/groups


includes/functions_user.php at line 3410

group_update_listings

public void group_update_listings(mixed group_id)

Re-cache moderators and foes if group has a_ or m_ permissions


includes/functions_user.php at line 2712

group_user_add

public mixed group_user_add(mixed group_id, bool user_id_ary, bool username_ary, bool group_name, bool default, int leader, int pending, bool group_attributes)

Add user(s) to group

Returns:
false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'

includes/functions_user.php at line 3016

group_user_attributes

public void group_user_attributes(mixed action, mixed group_id, bool user_id_ary, bool username_ary, bool group_name, bool group_attributes)

This is used to promote (to leader), demote or set as default a member/s


includes/functions_user.php at line 2811

group_user_del

public false group_user_del(mixed group_id, bool user_id_ary, bool username_ary, bool group_name)

Remove a user/s from a given group. When we remove users we update their default group_id. We do this by examining which "special" groups they belong to. The selection is made based on a reasonable priority system

Returns:
if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'

includes/functions_user.php at line 3162

group_validate_groupname

public void group_validate_groupname(mixed group_id, mixed group_name)

A small version of validate_username to check for a group name's existence. To be called directly.


includes/functions_privmsgs.php at line 818

handle_mark_actions

public void handle_mark_actions(mixed user_id, mixed mark_action)

Handle all actions possible with marked messages


posting.php at line 1053

handle_post_delete

public void handle_post_delete(mixed forum_id, mixed topic_id, mixed post_id, mixed post_data)

Do the various checks required for removing posts as well as removing it


download/file.php at line 470

header_filename

public void header_filename(mixed file)

Get a browser friendly UTF-8 encoded filename


includes/functions.php at line 1241

htmlspecialchars_decode

public void htmlspecialchars_decode(mixed string, mixed quote_style)

A wrapper for htmlspecialchars_decode

Ignore.

includes/functions.php at line 1006

is_absolute

public boolean is_absolute(string path)

Checks if a path ($path) is absolute or relative

Parameters:
path - Path to check absoluteness of

includes/functions.php at line 1252

language_select

public void language_select(str default)

Pick a language, any language ...


includes/functions_posting.php at line 856

load_drafts

public void load_drafts(int topic_id, int forum_id, int id, str pm_action, int msg_id)

Load Drafts


includes/functions.php at line 2980

login_box

public void login_box(str redirect, str l_explain, str l_success, bool admin, bool s_display)

Generate login box or verify password


includes/functions.php at line 3185

login_forum_box

public void login_forum_box(mixed forum_data)

Generate forum login box


includes/functions_messenger.php at line 1616

mail_encode

public void mail_encode(string eol, mixed str)

Encodes the given string for proper display in UTF-8.

This version is using base64 encoded data. The downside of this is if the mail client does not understand this encoding the user is basically doomed with an unreadable subject.

Please note that this version fully supports RFC 2045 section 6.8.

Parameters:
eol - End of line we are using (optional to be backwards compatible)

includes/functions_content.php at line 641

make_clickable

public void make_clickable(mixed text, bool server_url, str class)

make_clickable function

Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx. Cuts down displayed size of link if over 50 chars, turns absolute links into relative versions when the server/script path matches the link


includes/functions_content.php at line 512

make_clickable_callback

public void make_clickable_callback(mixed type, mixed whitespace, mixed url, mixed relative_url, mixed class)

A subroutine of make_clickable used with preg_replace It places correct HTML around an url, shortens the displayed text and makes sure no entities are inside URLs


includes/functions_content.php at line 111

make_jumpbox

public void make_jumpbox(mixed action, bool forum_id, bool select_all, bool acl_list, bool force_display)

Generate Jumpbox


includes/functions.php at line 1332

markread

public void markread(int user_id, mixed mode, bool forum_id, bool topic_id, int post_time)

Marks a topic/forum as read Marks a topic as posted to

Parameters:
user_id - can only be used with $mode == 'post'

includes/functions_privmsgs.php at line 1828

message_history

public void message_history(mixed msg_id, mixed user_id, mixed message_row, mixed folder, bool in_post_mode)

Display Message History


includes/functions.php at line 2708

meta_refresh

public void meta_refresh(int time, string url, bool disable_cd_check)

Meta refresh assignment Adds META template variable with meta http tag.

Parameters:
time - Time in seconds for meta refresh tag
url - URL to redirect to. The url will go through redirect() first before the template variable is assigned
disable_cd_check - If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.

includes/functions_privmsgs.php at line 701

move_pm

public void move_pm(mixed user_id, mixed message_limit, mixed move_msg_ids, mixed dest_folder, mixed cur_folder_id)

Move PM from one to another folder


includes/functions.php at line 3815

msg_handler

public void msg_handler(mixed errno, mixed msg_text, mixed errfile, mixed errline)

Error and message handler, call with trigger_error if reqd


includes/functions.php at line 4071

obtain_guest_count

public static int obtain_guest_count(int item_id, string item)

Queries the session table to get information about online guests

Parameters:
item_id - Limits the search to the item with this id
item - The name of the item which is stored in the session table as session_{$item}_id
Returns:
The number of active distinct guest sessions

includes/functions.php at line 4119

obtain_users_online

public array obtain_users_online(int item_id, string item)

Queries the session table to get information about online users

Parameters:
item_id - Limits the search to the item with this id
item - The name of the item which is stored in the session table as session_{$item}_id
Returns:
An array containing the ids of online, hidden and visible users, as well as statistical info

includes/functions.php at line 4183

obtain_users_online_string

public array obtain_users_online_string(mixed online_users, int item_id, string item)

Uses the result of obtain_users_online to generate a localized, readable representation.

Parameters:
online_users - result of obtain_users_online - array with user_id lists for total, hidden and visible users, and statistics
item_id - Indicate that the data is limited to one item and not global
item - The name of the item which is stored in the session table as session_{$item}_id
Returns:
An array containing the string for output to the template

includes/functions.php at line 2227

on_page

public void on_page(mixed num_items, mixed per_page, mixed start)

Return current page (pagination)


includes/functions.php at line 4737

page_footer

public void page_footer(bool run_cron)

Generate page footer


includes/functions.php at line 4430

page_header

public void page_header(str page_title, bool display_online_list, int item_id, str item)

Generate page header


includes/functions_content.php at line 756

parse_attachments

public void parse_attachments(mixed forum_id, string &$message, array &$attachments, array &$update_count, bool preview, mixed message, mixed attachments, mixed update_count)

General attachment parsing

Parameters:
forum_id - The forum id the attachments are displayed in (false if in private message)
&$message - The post/private message
&$attachments - The attachments to parse for (inline) display. The attachments array will hold templated data after parsing.
&$update_count - The attachment counts to be updated - will be filled
preview - If set to true the attachments are parsed for preview. Within preview mode the comments are fetched from the given $attachments array and not fetched from the database.

includes/functions.php at line 3318

parse_cfg_file

public void parse_cfg_file(mixed filename, bool lines)

Parse cfg file


includes/functions_posting.php at line 2620

phpbb_bump_topic

public string phpbb_bump_topic(int forum_id, int topic_id, array post_data, int bump_time)

Handle topic bumping

Parameters:
forum_id - The ID of the forum the topic is being bumped belongs to
topic_id - The ID of the topic is being bumping
post_data - Passes some topic parameters: - 'topic_title' - 'topic_last_post_id' - 'topic_last_poster_id' - 'topic_last_post_subject' - 'topic_last_poster_name' - 'topic_last_poster_colour'
bump_time - The time at which topic was bumped, usually it is a current time as obtained via time().
Returns:
An URL to the bumped topic, example: ./viewtopic.php?forum_id=1&topic_id=2&p=3#p3

includes/functions.php at line 503

phpbb_check_hash

public bool phpbb_check_hash(string password, string hash)

Check for correct password

Parameters:
password - The password in plain text
hash - The stored password hash
Returns:
Returns true if the password is correct, false if not.

includes/functions.php at line 3633

phpbb_checkdnsrr

public mixed phpbb_checkdnsrr(string host, string type)

Wrapper for php's checkdnsrr function.

Parameters:
host - Fully-Qualified Domain Name
type - Resource record type to lookup Supported types are: MX (default), A, AAAA, NS, TXT, CNAME Other types may work or may not work
Returns:
true if entry found, false if entry not found, null if this function is not supported by this environment Since null can also be returned, you probably want to compare the result with === true or === false,
Author:
bantu

includes/functions.php at line 699

phpbb_chmod

public bool phpbb_chmod(string filename, int perms)

Global function for chmodding directories and files for internal use

This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions. The function determines owner and group from common.php file and sets the same to the provided file. The function uses bit fields to build the permissions. The function sets the appropiate execute bit on directories.

Supported constants representing bit fields are:

CHMOD_ALL - all permissions (7) CHMOD_READ - read permission (4) CHMOD_WRITE - write permission (2) CHMOD_EXECUTE - execute permission (1)

NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.

Parameters:
filename - The file/directory to be chmodded
perms - Permissions to set
Returns:
true on success, otherwise false
Author:
faw, phpBB Group

includes/functions.php at line 1211

phpbb_clean_path

public string phpbb_clean_path(string path)

Eliminates useless . and .. components from specified path.

Parameters:
path - Path to clean
Returns:
Cleaned path

includes/functions_privmsgs.php at line 1030

phpbb_delete_user_pms

public boolean phpbb_delete_user_pms(int user_id)

Delete all PM(s) for a given user and delete the ones without references

Parameters:
user_id - ID of the user whose private messages we want to delete
Returns:
False if there were no pms found, true otherwise.

includes/functions.php at line 643

phpbb_email_hash

public string phpbb_email_hash(string email)

Hashes an email address to a big integer

Parameters:
email - Email address
Returns:
Unsigned Big Integer

includes/functions.php at line 4053

phpbb_filter_root_path

public string phpbb_filter_root_path(string errfile)

Removes absolute path to phpBB root directory from error messages and converts backslashes to forward slashes.

Parameters:
errfile - Absolute file path (e.g. /var/www/phpbb3/phpBB/includes/functions.php) Please note that if $errfile is outside of the phpBB root, the root path will not be found and can not be filtered.
Returns:
Relative file path (e.g. /includes/functions.php)

includes/functions_user.php at line 3553

phpbb_get_banned_user_ids

public array phpbb_get_banned_user_ids(array user_ids)

Gets user ids of currently banned registered users.

Parameters:
user_ids - Array of users' ids to check for banning, leave empty to get complete list of banned ids
Returns:
Array of banned users' ids if any, empty array otherwise

includes/functions.php at line 295

phpbb_gmgetdate

public array phpbb_gmgetdate(int time)

Wrapper for getdate() which returns the equivalent array for UTC timestamps.

Parameters:
time - Unix timestamp (optional)
Returns:
Returns an associative array of information related to the timestamp. See http://www.php.net/manual/en/function.getdate.php

includes/functions.php at line 459

phpbb_hash

public static void phpbb_hash(mixed password)

Version:
Version 0.1 / slightly modified for phpBB 3.0.x (using $H$ as hash type identifier) Portable PHP password hashing framework. Written by Solar Designer in 2004-2006 and placed in the public domain. There's absolutely no warranty. The homepage URL for this framework is: http://www.openwall.com/phpass/ Please be sure to update the Version line if you edit this file in any way. It is suggested that you leave the main version number intact, but indicate your project name (after the slash) and add your own revision information. Please do not change the "private" password hashing method implemented in here, thereby making your hashes incompatible. However, if you must, please change the hash type identifier (the "$P$") to something different. Obviously, since this code is in the public domain, the above are not requirements (there can be none), but merely suggestions. Hash the password

includes/functions.php at line 4331

phpbb_http_login

public null phpbb_http_login(array param)

Login using http authenticate.

Parameters:
param - Parameter array, see $param_defaults array.

download/file.php at line 642

phpbb_is_greater_ie_version

public bool phpbb_is_greater_ie_version(string user_agent, int version)

Check if the browser is internet explorer version 7+

Parameters:
user_agent - User agent HTTP header
version - IE version to check against
Returns:
true if internet explorer version is greater than $version

includes/functions.php at line 859

phpbb_is_writable

public static bool phpbb_is_writable(string file)

Test if a file/directory is writable

This function calls the native is_writable() when not running under Windows and it is not disabled.

Parameters:
file - Path to perform write test on
Returns:
True when the path is writable, otherwise false.

includes/functions_messenger.php at line 1661

phpbb_mail

public void phpbb_mail(mixed to, mixed subject, mixed msg, mixed headers, mixed eol, mixed err_msg)

Wrapper for sending out emails with the PHP's mail function


includes/functions.php at line 282

phpbb_mt_rand

public static int phpbb_mt_rand(int min, int max)

Wrapper for mt_rand() which allows swapping $min and $max parameters.

PHP does not allow us to swap the order of the arguments for mt_rand() anymore. (since PHP 5.3.4, see http://bugs.php.net/46587)

Parameters:
min - Lowest value to be returned
max - Highest value to be returned
Returns:
Random integer between $min and $max (or $max and $min)

includes/functions.php at line 4296

phpbb_optionget

public bool phpbb_optionget(int bit, int data)

Get option bitfield from custom data

Parameters:
bit - The bit/value to get
data - Current bitfield to check
Returns:
Returns true if value of constant is set in bitfield, else false

includes/functions.php at line 4310

phpbb_optionset

public int phpbb_optionset(int bit, bool set, int data)

Set option bitfield

Parameters:
bit - The bit/value to set/unset
set - True if option should be set, false if option should be unset.
data - Current bitfield to change
Returns:
The new bitfield

includes/functions.php at line 1017

phpbb_own_realpath

public mixed phpbb_own_realpath(string path)

Author:
Chris Smith
Copyright:
2006 Project Minerva Team
Parameters:
path - The path which we should attempt to resolve.

includes/functions.php at line 1184

phpbb_realpath

public void phpbb_realpath(mixed path)

A wrapper for realpath


includes/functions_user.php at line 1919

phpbb_style_is_active

public boolean phpbb_style_is_active(int style_id)

Verifies whether a style ID corresponds to an active style.

Parameters:
style_id - The style_id of a style which should be checked if activated or not.

includes/functions_database_helper.php at line 32

phpbb_update_rows_avoiding_duplicates

public null phpbb_update_rows_avoiding_duplicates(dbal db, string table, string column, array from_values, int to_value)

Updates rows in given table from a set of values to a new value. If this results in rows violating uniqueness constraints, the duplicate rows are eliminated.

The only supported table is bookmarks.

Parameters:
db - Database object
table - Table on which to perform the update
column - Column whose values to change
from_values - An array of values that should be changed
to_value - The new value

includes/functions_database_helper.php at line 108

phpbb_update_rows_avoiding_duplicates_notify_status

public null phpbb_update_rows_avoiding_duplicates_notify_status(dbal db, string table, string column, array from_values, int to_value)

Updates rows in given table from a set of values to a new value. If this results in rows violating uniqueness constraints, the duplicate rows are merged respecting notify_status (0 takes precedence over 1).

The only supported table is topics_watch.

Parameters:
db - Database object
table - Table on which to perform the update
column - Column whose values to change
from_values - An array of values that should be changed
to_value - The new value

includes/functions.php at line 4895

phpbb_user_session_handler

public void phpbb_user_session_handler()

Handler for init calls in phpBB. This function is called in user::setup(); This function supports hooks.


includes/functions_user.php at line 1898

phpbb_validate_hex_colour

public bool|string phpbb_validate_hex_colour(string colour, bool optional)

Validate hex colour value

Parameters:
colour - The hex colour value
optional - Whether the colour value is optional. True if an empty string will be accepted as correct input, false if not.
Returns:
Error message if colour value is incorrect, false if it fits the hex colour code

includes/functions.php at line 661

phpbb_version_compare

public mixed phpbb_version_compare(string version1, string version2, string operator)

Wrapper for version_compare() that allows using uppercase A and B for alpha and beta releases.

See http://www.php.net/manual/en/function.version-compare.php

Parameters:
version1 - First version number
version2 - Second version number
operator - Comparison operator (optional)
Returns:
Boolean (true, false) if comparison operator is specified. Integer (-1, 0, 1) otherwise.

includes/functions_privmsgs.php at line 364

place_pm_into_folder

public void place_pm_into_folder(mixed global_privmsgs_rules, bool release)

Place new messages into appropriate folder


includes/functions_privmsgs.php at line 1745

pm_notification

public void pm_notification(mixed mode, mixed author, mixed recipients, mixed subject, mixed message, mixed msg_id)

PM Notification


includes/functions_posting.php at line 803

posting_gen_attachment_entry

public void posting_gen_attachment_entry(mixed attachment_data, mixed filename_data, bool show_attach_box)

Generate inline attachment entry


includes/functions_posting.php at line 779

posting_gen_inline_attachments

public void posting_gen_inline_attachments(mixed attachment_data)

Assign Inline attachments (build option fields)


includes/functions_posting.php at line 267

posting_gen_topic_icons

public void posting_gen_topic_icons(mixed mode, mixed icon_id)

Generate Topic Icons for display


includes/functions_posting.php at line 308

posting_gen_topic_types

public void posting_gen_topic_types(mixed forum_id, mixed cur_topic_type)

Build topic types able to be selected


includes/functions.php at line 2597

reapply_sid

public void reapply_sid(mixed url)

Re-Apply session id after page reloads


includes/functions_privmsgs.php at line 1225

rebuild_header

public void rebuild_header(mixed check_ary)

Rebuild message header


includes/functions.php at line 2430

redirect

public void redirect(string url, bool return, bool disable_cd_check)

Redirects the user to another page then exits the script nicely This function is intended for urls within the board. It's not meant to redirect to cross-domains.

Parameters:
url - The url to redirect to
return - If true, do not redirect but return the sanitized URL. Default is no return.
disable_cd_check - If true, redirect() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.

includes/functions_user.php at line 2937

remove_default_avatar

public void remove_default_avatar(mixed group_id, mixed user_ids)

Removes the group avatar of the default group from the users in user_ids who have that group as default.


includes/functions_user.php at line 2978

remove_default_rank

public void remove_default_rank(mixed group_id, mixed user_ids)

Removes the group rank of the default group from the users in user_ids who have that group as default.


includes/functions_user.php at line 3480

remove_newly_registered

public void remove_newly_registered($user_id The, mixed user_id, bool user_data)

Funtion to make a user leave the NEWLY_REGISTERED system group.

Parameters:
The - id of the user to remove from the group

includes/functions.php at line 63

request_var

public void request_var(mixed var_name, mixed default, bool multibyte, bool cookie)

request_var

Used to get passed variable


download/file.php at line 340

send_file_to_browser

public void send_file_to_browser(mixed attachment, mixed upload_dir, mixed category)

Send file to browser


includes/functions.php at line 2743

send_status_line

public null send_status_line(int code, string message)

Outputs correct status line header.

Depending on php sapi one of the two following forms is used:

Status: 404 Not Found

HTTP/1.x 404 Not Found

HTTP version is taken from HTTP_VERSION environment variable, and defaults to 1.0.

Sample usage:

send_status_line(404, 'Not Found');

Parameters:
code - HTTP status code
message - Message for the status code

includes/functions.php at line 153

set_config

public null set_config(string config_name, string config_value, bool is_dynamic)

Sets a configuration option's value.

Please note that this function does not update the is_dynamic value for an already existing config option.

Parameters:
config_name - The configuration option's name
config_value - New configuration value
is_dynamic - Whether this variable should be cached (false) or if it changes too frequently (true) to be efficiently cached.

includes/functions.php at line 190

set_config_count

public null set_config_count(string config_name, int increment, bool is_dynamic)

Increments an integer config value directly in the database.

Parameters:
config_name - The configuration option's name
increment - Amount to increment by
is_dynamic - Whether this variable should be cached (false) or if it changes too frequently (true) to be efficiently cached.

download/file.php at line 600

set_modified_headers

public void set_modified_headers(mixed stamp, mixed browser)

Check if the browser has the file already and set the appropriate headers-

Returns:
false if a resend is in order.

includes/functions_privmsgs.php at line 2004

set_user_message_limit

public void set_user_message_limit()

Set correct users max messages in PM folder. If several group memberships define different amount of messages, the highest will be chosen.


includes/functions.php at line 3591

short_ipv6

public static void short_ipv6(mixed ip, mixed length)

Returns the first block of the specified IPv6 address and as many additional ones as specified in the length paramater. If length is zero, then an empty string is returned. If length is greater than 3 the complete IP will be returned


includes/functions_content.php at line 732

smiley_text

public void smiley_text(mixed text, bool force_option)

Smiley processing


includes/functions_messenger.php at line 941

smtpmail

public void smtpmail(mixed addresses, mixed subject, mixed message, mixed err_msg, bool headers)

Replacement or substitute for PHP's mail command


includes/functions.php at line 401

still_on_time

public bool still_on_time(int extra_time)

Determine whether we are approaching the maximum execution time. Should be called once at the beginning of the script in which it's used.

Returns:
Either true if the maximum execution time is nearly reached, or false if some time is still left.

includes/functions.php at line 958

str_split

public Converts str_split(array string, array split_length)

A wrapper for the PHP5 function str_split()

Parameters:
string - contains the string to be converted
split_length - contains the length of each chunk
Returns:
a string to an array. If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string, the entire string is returned as the first (and only) array element.

includes/functions_content.php at line 393

strip_bbcode

public void strip_bbcode(mixed text, str uid)

Strips all bbcode from a text and returns the plain content


includes/functions.php at line 989

stripos

public mixed stripos(string haystack, string needle)

A wrapper for the PHP5 function stripos Find position of first occurrence of a case-insensitive string

Parameters:
haystack - is the string to search in
needle - is the string to search for
Returns:
Returns the numeric position of the first occurrence of needle in the haystack string. Unlike strpos(), stripos() is case-insensitive. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return boolean FALSE.

includes/functions.php at line 1275

style_select

public void style_select(str default, bool all)

Pick a template/theme combo,


includes/functions_privmsgs.php at line 1436

submit_pm

public void submit_pm(mixed mode, mixed subject, mixed data, bool put_in_outbox)

Submit PM


includes/functions_posting.php at line 1617

submit_post

public void submit_post(mixed mode, mixed subject, mixed username, mixed topic_type, mixed poll, mixed data, bool update_message, bool update_search_index)

Submit Post

Todo:
Split up and create lightweight, simple API for this.

includes/functions_display.php at line 660

topic_generate_pagination

public void topic_generate_pagination(mixed replies, mixed url)

Generate topic pagination


includes/functions_posting.php at line 969

topic_review

public void topic_review(mixed topic_id, mixed forum_id, str mode, int cur_post_id, bool show_quote_button)

Topic Review


includes/functions_display.php at line 812

topic_status

public void topic_status(mixed topic_row, mixed replies, mixed unread_topic, mixed folder_img, mixed folder_alt, mixed topic_type)

Generate topic status


includes/functions.php at line 2020

tracking_serialize

public void tracking_serialize(mixed input)

Transform an array into a serialized format


includes/functions.php at line 2040

tracking_unserialize

public void tracking_unserialize(mixed string, int max_depth)

Transform a serialized array into an actual array


includes/functions_content.php at line 1113

truncate_string

public void truncate_string(string string, int max_length, int max_store_length, bool allow_reply, string append)

Truncates string while retaining special characters if going over the max length The default max length is 60 at the moment The maximum storage length is there to fit the string within the given length. The string may be further truncated due to html entities. For example: string given is 'a "quote"' (length: 9), would be a stored as 'a "quote"' (length: 19)

Parameters:
string - The text to truncate to the given length. String is specialchared.
max_length - Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
max_store_length - Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
allow_reply - Allow Re: in front of string NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated.
append - String to be appended

includes/functions.php at line 1298

tz_select

public void tz_select(str default, bool truncate)

Pick a timezone


includes/functions.php at line 252

unique_id

public void unique_id(string extra)

Return unique id

Parameters:
extra - additional entropy

includes/functions.php at line 1911

update_forum_tracking_info

public true update_forum_tracking_info(int forum_id, int forum_last_post_time, int f_mark_time, int mark_time_forum)

Check for read forums and update topic tracking info accordingly

Parameters:
forum_id - the forum id to check
forum_last_post_time - the forums last post time
f_mark_time - the forums last mark time if user is registered and load_db_lastread enabled
mark_time_forum - false if the mark time needs to be obtained, else the last users forum mark time
Returns:
if complete forum got marked read, else false.

includes/functions_user.php at line 87

update_last_username

public void update_last_username()

Get latest registered username and update database to reflect it


includes/functions_privmsgs.php at line 320

update_pm_counts

public void update_pm_counts()

Update user PM count


includes/functions_posting.php at line 151

update_post_information

public void update_post_information(string type, mixed ids, bool return_update_sql)

Update last post information Should be used instead of sync() if only the last post information are out of sync... faster

Parameters:
type - Can be forum|topic
ids - topic/forum ids
return_update_sql - true: SQL query shall be returned, false: execute SQL

includes/functions_privmsgs.php at line 785

update_unread_status

public void update_unread_status(mixed unread, mixed msg_id, mixed user_id, mixed folder_id)

Update unread message status


includes/functions_posting.php at line 371

upload_attachment

public void upload_attachment(mixed form_name, mixed forum_id, bool local, str local_storage, bool is_message, bool local_filedata)

Upload Attachment - filedata is generated here Uses upload class


includes/functions_user.php at line 551

user_active_flip

public void user_active_flip(string mode, mixed user_id_ary, mixed reason)

Flips user_type from active to inactive and vice versa, handles group membership updates

Parameters:
mode - can be flip for flipping from active/inactive, activate or deactivate

includes/functions_user.php at line 150

user_add

public the user_add(mixed user_row, string cp_data)

Adds an user

Parameters:
user_row - An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
cp_data - custom profile fields, see custom_profile::build_insert_sql_array
Returns:
new user's ID.

includes/functions_user.php at line 644

user_ban

public boolean user_ban(string mode, mixed ban, int ban_len, string ban_len_other, boolean ban_exclude, string ban_reason, str ban_give_reason)

Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address

Parameters:
mode - Type of ban. One of the following: user, ip, email
ban - Banned entity. Either string or array with usernames, ips or email addresses
ban_len - Ban length in minutes
ban_len_other - Ban length as a date (YYYY-MM-DD)
ban_exclude - Exclude these entities from banning?
ban_reason - String describing the reason for this ban

includes/functions_user.php at line 332

user_delete

public void user_delete(mixed mode, mixed user_id, bool post_username)

Remove User


includes/functions_user.php at line 27

user_get_id_name

public void user_get_id_name(array &$user_id_ary, array &$username_ary, mixed user_type, mixed user_id_ary, mixed username_ary)

Obtain user_ids from usernames or vice versa. Returns false on success else the error string

Parameters:
&$user_id_ary - The user ids to check or empty if usernames used
&$username_ary - The usernames to check or empty if user ids used
user_type - Array of user types to check, false if not restricting by user type

includes/functions_user.php at line 1140

user_ipwhois

public string user_ipwhois(string ip)

Internet Protocol Address Whois RFC3912: WHOIS Protocol Specification

Parameters:
ip - Ip address, either IPv4 or IPv6.
Returns:
Empty string if not a valid ip address. Otherwise make_clickable()'ed whois result.

includes/functions_posting.php at line 1158

user_notification

public void user_notification(mixed mode, mixed subject, mixed topic_title, mixed forum_name, mixed forum_id, mixed topic_id, mixed post_id, str author_name)

User Notification


includes/functions_user.php at line 1055

user_unban

public void user_unban(mixed mode, mixed ban)

Unban User


includes/functions_user.php at line 114

user_update_name

public void user_update_name(string old_name, string new_name)

Updates a username across all relevant tables/fields

Parameters:
old_name - the old/current username
new_name - the new username

includes/functions_user.php at line 1220

validate_data

public void validate_data(mixed data, mixed val_ary)

Data validation ... used primarily but not exclusively by ucp modules

"Master" function for validating a range of data types


includes/functions_user.php at line 1303

validate_date

public boolean validate_date(String string, mixed date_string, bool optional)

Validate Date

Parameters:
string - a date in the dd-mm-yyyy format

includes/functions_user.php at line 1635

validate_email

public mixed validate_email(string email, string allowed_email)

Check to see if email address is banned or already present in the DB

Parameters:
email - The email to check
allowed_email - An allowed email, default being $user->data['user_email']
Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_user.php at line 1693

validate_jabber

public void validate_jabber(mixed jid)

Validate jabber address Taken from the jabber class within flyspray (see author notes)

Author:
flyspray.org

includes/functions_user.php at line 1373

validate_language_iso_name

public bool|string validate_language_iso_name(string lang_iso)

Validate Language Pack ISO Name

Tests whether a language name is valid and installed

Parameters:
lang_iso - The language string to test
Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_user.php at line 1342

validate_match

public boolean|string validate_match(mixed string, bool optional, str match)

Validate Match

Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_user.php at line 1279

validate_num

public boolean|string validate_num(mixed num, bool optional, int min, mixed max)

Validate Number

Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_user.php at line 1542

validate_password

public boolean|string validate_password(mixed password)

Check to see if the password meets the complexity settings

Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_user.php at line 1255

validate_string

public boolean|string validate_string(mixed string, bool optional, int min, int max)

Validate String

Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_user.php at line 1397

validate_username

public mixed validate_username(string username, string allowed_username)

Check to see if the username has been taken, or if it is disallowed. Also checks if it includes the " character, which we don't allow in usernames. Used for registering, changing names, and posting anonymously with a username

Parameters:
username - The username to check
allowed_username - An allowed username, default being $user->data['username']
Returns:
Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

includes/functions_display.php at line 1066

watch_topic_forum

public void watch_topic_forum(mixed mode, mixed s_watching, mixed user_id, mixed forum_id, mixed topic_id, str notify_status, int start, str item_title)

Topic and forum watching common code


download/file.php at line 321

wrap_img_in_html

public void wrap_img_in_html(mixed src, mixed title)

Wraps an url into a simple html page. Used to display attachments in IE. this is a workaround for now; might be moved to template system later direct any complaints to 1 Microsoft Way, Redmond


includes/functions_privmsgs.php at line 1261

write_pm_addresses

public void write_pm_addresses(mixed check_ary, mixed author_id, bool plaintext)

Print out/assign recipient information


phpBB3