| 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 | 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 | Check if downloading item is allowed |
| void | 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 | 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 |
| void | Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com) |
| 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(int 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 |
| 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_email_hash(string email) Hashes an email address to a big integer |
| static void | phpbb_hash(mixed password) |
| void | phpbb_http_login(array param) Login using http authenticate. |
| 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 |
| void | Handler for init calls in phpBB. |
| 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) 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 |
| void | send_status_line(int code, string message) Outputs correct status line header. |
| void | set_config(mixed config_name, mixed config_value, bool is_dynamic) Set config value. |
| void | set_config_count(mixed config_name, mixed increment, bool is_dynamic) Set dynamic config value with arithmetic operation. |
| void | set_modified_headers(mixed stamp, mixed browser) Check if the browser has the file already and set the appropriate headers- |
| void | 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 | Get latest registered username and update database to reflect it |
| void | 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) 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) 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 |
public void _build_hidden_fields(mixed key, mixed value, mixed specialchar, mixed stripslashes)
Little helper for the build_hidden_fields function
public void _hash_crypt_private(mixed password, mixed setting, mixed itoa64)
The crypt function/replacement
public void _hash_encode64(mixed input, mixed count, mixed itoa64)
Encode hash
public void _hash_gensalt_private(mixed input, mixed itoa64, int iteration_count_log2)
Generate salt for hash generation
public void _sort_last_active(mixed first, mixed second)
public void add_form_key(string form_name)
Add a secret token to the form (requires the S_FORM_TOKEN template variable)
public void add_log()
Add log event
public void append_sid(string url, mixed params, bool is_amp, string session_id)
Append session id to url. This function supports hooks.
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)); public Returns array_combine(array keys, array values)
A wrapper for the PHP5 function array_combine()
public void avatar_delete(mixed mode, mixed row, bool clean_db)
Remove avatar
public void avatar_gallery(mixed category, mixed avatar_select, mixed items_per_column, str block_var)
Avatar Gallery
public void avatar_get_dimensions(mixed avatar, mixed avatar_type, mixed error, int current_x, int current_y)
Tries to (re-)establish avatar dimensions
public void avatar_process_user(mixed error, bool custom_userdata, mixed can_upload)
Uploading/Changing user avatar
public void avatar_remote(mixed data, mixed error)
Remote avatar linkage
public void avatar_remove_db(mixed avatar_name)
Remove avatar also for users not having the group as default
public void avatar_upload(mixed data, mixed error)
Avatar upload using the upload class
public static void bbcode_nl2br(mixed text)
custom version of nl2br which takes custom BBCodes into account
public string build_hidden_fields(array field_ary, bool specialchar, bool stripslashes)
Build simple hidden fields from array
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
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
public static void censor_text(mixed text)
Censoring
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
public boolean check_link_hash(string token, string link_name)
checks a link hash - for GET requests
public void check_rule(mixed rules, mixed rule_row, mixed message_row, mixed user_id)
Check Rule against Message Information
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
public void confirm_box(boolean check, string title, string hidden, string html_body, string u_action)
Build Confirm box
public void create_thumbnail(mixed source, mixed destination, mixed mimetype)
Create Thumbnail
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...
public void delete_pm(mixed user_id, mixed msg_ids, mixed folder_id)
Delete PM(s)
public void delete_post(mixed forum_id, mixed topic_id, mixed post_id, mixed data)
Delete Post
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'
public void display_forums(str root_data, bool display_moderators, bool return_moderators)
Display Forums
public void display_reasons(int reason_id)
Display reasons
public void display_user_activity(mixed userdata)
Display user activity (action forum/topic)
public void download_allowed()
Check if downloading item is allowed
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.
public bool extension_allowed(mixed forum_id, string extension, array &$extensions, mixed extensions)
Check if extension is allowed to be posted.
public void feed_format_date(mixed time)
Generate ISO 8601 date string (RFC 3339)
public static void feed_generate_content(mixed content, mixed uid, mixed bitfield, mixed options)
Generate text content
public void file_gc()
public void garbage_collection()
Closing the cache object and the database Cool function name, eh? We might want to add operations to it later
public void gen_forum_auth_level(string mode, int forum_id, int forum_status)
User authorisation levels output
public string gen_rand_string(int num_chars)
Generates an alphanumeric random string of given length
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.
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
public string generate_board_url(bool without_script_path)
Generate board url (example: http://www.example.com/phpBB)
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
public void generate_forum_rules(mixed forum_data)
Create forum rules for given forum
public string generate_link_hash(string link_name)
Add a secret hash for use in links/GET requests
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
public void generate_smilies(mixed mode, mixed forum_id)
Fill smiley templates (or just the variables) with smilies, either in a window or inline
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)
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)
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
public void get_avatar_filename(mixed avatar_entry)
Generates avatar filename from the database entry
public void get_backtrace()
Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com)
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
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)
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
public void get_folder_status(mixed folder_id, mixed folder)
Get folder status
public mixed get_formatted_filesize(int value, bool string_only, array allowed_units)
Return formatted string for filesizes
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
public void get_group_name(mixed group_id)
Get group name
public void get_img_size_format(mixed width, mixed height)
Calculate the needed size for Thumbnail
public void get_moderators(mixed forum_moderators, bool forum_id)
Obtain list of moderators of each forum
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
public array get_recipient_strings(array pm_by_id)
Generates an array of coloured recipient names from a list of PMs - (groups & users)
public void get_supported_image_types(bool type)
Return supported image types
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
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
public string get_user_avatar(string avatar, int avatar_type, string avatar_width, string avatar_height, string alt, bool ignore_config)
Get user avatar
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
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.
public void group_correct_avatar(mixed group_id, mixed old_entry)
Changes a group avatar's filename to conform to the naming scheme
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
public void group_delete(mixed group_id, bool group_name)
Group Delete
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
public void group_update_listings(mixed group_id)
Re-cache moderators and foes if group has a_ or m_ permissions
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
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
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
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.
public void handle_mark_actions(mixed user_id, mixed mark_action)
Handle all actions possible with marked messages
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
public void header_filename(mixed file)
Get a browser friendly UTF-8 encoded filename
public void htmlspecialchars_decode(mixed string, mixed quote_style)
A wrapper for htmlspecialchars_decode
public boolean is_absolute(string path)
Checks if a path ($path) is absolute or relative
public void language_select(str default)
Pick a language, any language ...
public void load_drafts(int topic_id, int forum_id, int id, str pm_action, int msg_id)
Load Drafts
public void login_box(str redirect, str l_explain, str l_success, bool admin, bool s_display)
Generate login box or verify password
public void login_forum_box(mixed forum_data)
Generate forum login box
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.
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
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
public void make_jumpbox(mixed action, bool forum_id, bool select_all, bool acl_list, bool force_display)
Generate Jumpbox
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
public void message_history(mixed msg_id, mixed user_id, mixed message_row, mixed folder, bool in_post_mode)
Display Message History
public void meta_refresh(int time, string url, bool disable_cd_check)
Meta refresh assignment Adds META template variable with meta http tag.
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
public void msg_handler(mixed errno, mixed msg_text, mixed errfile, mixed errline)
Error and message handler, call with trigger_error if reqd
public int obtain_guest_count(int item_id, string item)
Queries the session table to get information about online guests
public array obtain_users_online(int item_id, string item)
Queries the session table to get information about online users
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.
public void on_page(mixed num_items, mixed per_page, mixed start)
Return current page (pagination)
public void page_footer(bool run_cron)
Generate page footer
public void page_header(str page_title, bool display_online_list, int item_id, str item)
Generate page header
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
public void parse_cfg_file(mixed filename, bool lines)
Parse cfg file
public string phpbb_bump_topic(int forum_id, int topic_id, array post_data, int bump_time)
Handle topic bumping
public bool phpbb_check_hash(string password, string hash)
Check for correct password
public mixed phpbb_checkdnsrr(string host, string type)
Wrapper for php's checkdnsrr function.
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.
public string phpbb_email_hash(string email)
Hashes an email address to a big integer
public static void phpbb_hash(mixed password)
public void phpbb_http_login(array param)
Login using http authenticate.
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.
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
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)
public bool phpbb_optionget(int bit, int data)
Get option bitfield from custom data
public int phpbb_optionset(int bit, bool set, int data)
Set option bitfield
public mixed phpbb_own_realpath(string path)
public void phpbb_realpath(mixed path)
A wrapper for realpath
public void phpbb_user_session_handler()
Handler for init calls in phpBB. This function is called in user::setup(); This function supports hooks.
public void place_pm_into_folder(mixed global_privmsgs_rules, bool release)
Place new messages into appropriate folder
public void pm_notification(mixed mode, mixed author, mixed recipients, mixed subject, mixed message)
PM Notification
public void posting_gen_attachment_entry(mixed attachment_data, mixed filename_data, bool show_attach_box)
Generate inline attachment entry
public void posting_gen_inline_attachments(mixed attachment_data)
Assign Inline attachments (build option fields)
public void posting_gen_topic_icons(mixed mode, mixed icon_id)
Generate Topic Icons for display
public void posting_gen_topic_types(mixed forum_id, mixed cur_topic_type)
Build topic types able to be selected
public void reapply_sid(mixed url)
Re-Apply session id after page reloads
public void rebuild_header(mixed check_ary)
Rebuild message header
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.
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.
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.
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.
public void request_var(mixed var_name, mixed default, bool multibyte, bool cookie)
request_var
Used to get passed variable
public void send_file_to_browser(mixed attachment, mixed upload_dir, mixed category)
Send file to browser
public void 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');
public void set_config(mixed config_name, mixed config_value, bool is_dynamic)
Set config value. Creates missing config entry.
public void set_config_count(mixed config_name, mixed increment, bool is_dynamic)
Set dynamic config value with arithmetic operation.
public void set_modified_headers(mixed stamp, mixed browser)
Check if the browser has the file already and set the appropriate headers-
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.
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
public void smiley_text(mixed text, bool force_option)
Smiley processing
public void smtpmail(mixed addresses, mixed subject, mixed message, mixed err_msg, bool headers)
Replacement or substitute for PHP's mail command
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.
public Converts str_split(array string, array split_length)
A wrapper for the PHP5 function str_split()
public void strip_bbcode(mixed text, str uid)
Strips all bbcode from a text and returns the plain content
public mixed stripos(string haystack, string needle)
A wrapper for the PHP5 function stripos Find position of first occurrence of a case-insensitive string
public void style_select(str default, bool all)
Pick a template/theme combo,
public void submit_pm(mixed mode, mixed subject, mixed data, bool put_in_outbox)
Submit PM
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
public void topic_generate_pagination(mixed replies, mixed url)
Generate topic pagination
public void topic_review(mixed topic_id, mixed forum_id, str mode, int cur_post_id, bool show_quote_button)
Topic Review
public void topic_status(mixed topic_row, mixed replies, mixed unread_topic, mixed folder_img, mixed folder_alt, mixed topic_type)
Generate topic status
public void tracking_serialize(mixed input)
Transform an array into a serialized format
public void tracking_unserialize(mixed string, int max_depth)
Transform a serialized array into an actual array
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)
public void tz_select(str default, bool truncate)
Pick a timezone
public void unique_id(string extra)
Return unique id
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
public void update_last_username()
Get latest registered username and update database to reflect it
public void update_pm_counts()
Update user PM count
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
public void update_unread_status(mixed unread, mixed msg_id, mixed user_id, mixed folder_id)
Update unread message status
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
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
public the user_add(mixed user_row, string cp_data)
Adds an user
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
public void user_delete(mixed mode, mixed user_id, bool post_username)
Remove User
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
public string user_ipwhois(string ip)
Internet Protocol Address Whois RFC3912: WHOIS Protocol Specification
public void user_notification(mixed mode, mixed subject, mixed topic_title, mixed forum_name, mixed forum_id, mixed topic_id, mixed post_id)
User Notification
public void user_unban(mixed mode, mixed ban)
Unban User
public void user_update_name(string old_name, string new_name)
Updates a username across all relevant tables/fields
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
public boolean validate_date(String string, mixed date_string, bool optional)
Validate Date
public mixed validate_email(string email, string allowed_email)
Check to see if email address is banned or already present in the DB
public void validate_jabber(mixed jid)
Validate jabber address Taken from the jabber class within flyspray (see author notes)
public bool|string validate_language_iso_name(string lang_iso)
Validate Language Pack ISO Name
Tests whether a language name is valid and installed
public boolean|string validate_match(mixed string, bool optional, str match)
Validate Match
public boolean|string validate_num(mixed num, bool optional, int min, mixed max)
Validate Number
public boolean|string validate_password(mixed password)
Check to see if the password meets the complexity settings
public boolean|string validate_string(mixed string, bool optional, int min, int max)
Validate String
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
public void watch_topic_forum(mixed mode, mixed s_watching, mixed user_id, mixed forum_id, mixed topic_id, str notify_status, int start)
Topic and forum watching common code
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
public void write_pm_addresses(mixed check_ary, mixed author_id, bool plaintext)
Print out/assign recipient information