[ Index ]

PHP Cross Reference of phpBB 3.0 Beta 3

title

Body

[close]

/includes/ -> functions.php (summary)

(no description)

Copyright: (c) 2005 phpBB Group
License: http://opensource.org/licenses/gpl-license.php GNU Public License
Version: $Id: functions.php,v 1.487 2006/11/12 19:45:36 davidmj Exp $
File Size: 3518 lines (100 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

bitfield:: (9 methods):
  bitfield()
  get()
  set()
  clear()
  get_blob()
  get_base64()
  get_bin()
  get_all_set()
  merge()

Defines 9 functions

  set_var()
  request_var()
  set_config()
  gen_rand_string()
  unique_id()
  gen_sort_selects()
  make_jumpbox()
  array_combine()
  str_split()
  stripos()
  phpbb_realpath()
  is_absolute()
  phpbb_realpath()
  phpbb_realpath()
  htmlspecialchars_decode()
  language_select()
  style_select()
  tz_select()
  markread()
  get_topic_tracking()
  get_complete_topic_tracking()
  update_forum_tracking_info()
  generate_pagination()
  on_page()
  append_sid()
  generate_board_url()
  redirect()
  reapply_sid()
  build_url()
  meta_refresh()
  confirm_box()
  login_box()
  login_forum_box()
  bump_topic_allowed()
  get_context()
  decode_message()
  strip_bbcode()
  generate_text_for_display()
  generate_text_for_storage()
  generate_text_for_edit()
  make_clickable()
  censor_text()
  smiley_text()
  parse_inline_attachments()
  extension_allowed()
  _build_hidden_fields()
  build_hidden_fields()
  parse_cfg_file()
  add_log()
  get_backtrace()
  get_preg_expression()
  truncate_string()
  phpbb_checkdnsrr()
  msg_handler()
  page_header()
  page_footer()
  garbage_collection()

Class: bitfield  - X-Ref


bitfield($bitfield = '')   X-Ref
No description

get($n)   X-Ref
No description

set($n)   X-Ref
No description

clear($n)   X-Ref
No description

get_blob()   X-Ref
No description

get_base64()   X-Ref
No description

get_bin()   X-Ref
No description

get_all_set()   X-Ref
No description

merge($bitfield)   X-Ref
No description

Functions
Functions that are not part of a class:

set_var(&$result, $var, $type, $multibyte = false)   X-Ref
set_var

Set variable, used by {@link request_var the request_var function}


request_var($var_name, $default, $multibyte = false, $cookie = false)   X-Ref
request_var

Used to get passed variable

set_config($config_name, $config_value, $is_dynamic = false)   X-Ref
Set config value. Creates missing config entry.


gen_rand_string($num_chars = 8)   X-Ref
Generates an alphanumeric random string of given length


unique_id($extra = 'c')   X-Ref
Return unique id

param: $extra additional entropy

gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param)   X-Ref
Generate sort selection fields


make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false)   X-Ref
Generate Jumpbox


array_combine($keys, $values)   X-Ref
A wrapper for the PHP5 function array_combine()

param: array $keys contains keys for the resulting array
param: array $values contains values for the resulting array
return: Returns an array by using the values from the keys array as keys and the

str_split($string, $split_length = 1)   X-Ref
A wrapper for the PHP5 function str_split()

param: array $string contains the string to be converted
param: array $split_length contains the length of each chunk
return: Converts a string to an array. If the optional split_length parameter is specified,

stripos($haystack, $needle)   X-Ref
A wrapper for the PHP5 function stripos
Find position of first occurrence of a case-insensitive string

param: string $haystack is the string to search in
param: string needle is the string to search for
return: Returns the numeric position of the first occurrence of needle in the haystack  string. Unlike strpos(), stripos() is case-insensitive.

phpbb_realpath($path)   X-Ref

author: Chris Smith <chris@project-minerva.org>
param: string $path The path which we should attempt to resolve.
return: mixed

is_absolute($path)   X-Ref
Checks if a path ($path) is absolute or relative

param: string $path Path to check absoluteness of
return: boolean

phpbb_realpath($path)   X-Ref

author: Chris Smith <chris@project-minerva.org>
param: string $path The path which we should attempt to resolve.
return: mixed

phpbb_realpath($path)   X-Ref
A wrapper for realpath


htmlspecialchars_decode($string, $quote_style = ENT_COMPAT)   X-Ref
No description

language_select($default = '')   X-Ref
Pick a language, any language ...


style_select($default = '', $all = false)   X-Ref
Pick a template/theme combo,


tz_select($default = '', $truncate = false)   X-Ref
Pick a timezone


markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0)   X-Ref
Marks a topic/forum as read
Marks a topic as posted to

param: int $user_id can only be used with $mode == 'post'

get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $global_announce_list = false)   X-Ref
Get topic tracking info by using already fetched info


get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_list = false)   X-Ref
Get topic tracking info from db (for cookie based tracking only this function is used)


update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)   X-Ref
Check for read forums and update topic tracking info accordingly

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

generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')   X-Ref
Pagination routine, generates page number sequence
tpl_prefix is for using different pagination blocks at one page


on_page($num_items, $per_page, $start)   X-Ref
Return current page (pagination)


append_sid($url, $params = false, $is_amp = true, $session_id = false)   X-Ref
Append session id to url

param: string $url The url the session id needs to be appended to (can have params)
param: mixed $params String or array of additional url parameters
param: bool $is_amp Is url using &amp; (true) or & (false)
param: string $session_id Possibility to use a custom session id instead of the global one

generate_board_url($without_script_path = false)   X-Ref
Generate board url (example: http://www.foo.bar/phpBB)

param: bool $without_script_path if set to true the script path gets not appended (example: http://www.foo.bar)

redirect($url, $return = false)   X-Ref
Redirects the user to another page then exits the script nicely


reapply_sid($url)   X-Ref
Re-Apply session id after page reloads


build_url($strip_vars = false)   X-Ref
Returns url from the session/current page with an re-appended SID with optionally stripping vars from the url


meta_refresh($time, $url)   X-Ref
Meta refresh assignment


confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')   X-Ref
Build Confirm box

param: boolean $check True for checking if confirmed (without any additional parameters) and false for displaying the confirm box
param: string $title Title/Message used for confirm box.
param: string $hidden Hidden variables
param: string $html_body Template used for confirm box
param: string $u_action Custom form action

login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)   X-Ref
Generate login box or verify password


login_forum_box($forum_data)   X-Ref
Generate forum login box


bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_poster, $last_topic_poster)   X-Ref
Bump Topic Check - used by posting and viewtopic


get_context($text, $words, $length = 400)   X-Ref
Generates a text with approx. the specified length which contains the specified words and their context

param: string    $text    The full text from which context shall be extracted
param: string    $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!)
param: int        $length    The desired length of the resulting text, however the result might be shorter or longer than this value
return: string            Context of the specified words seperated by "..."

decode_message(&$message, $bbcode_uid = '')   X-Ref
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...


strip_bbcode(&$text, $uid = '')   X-Ref
Strips all bbcode from a text and returns the plain content


generate_text_for_display($text, $uid, $bitfield, $flags)   X-Ref
For display of custom parsed text on user-facing pages
Expects $text to be the value directly from the database (stored value)


generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)   X-Ref
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


generate_text_for_edit($text, $uid, $flags)   X-Ref
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)


make_clickable($text, $server_url = false)   X-Ref
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

censor_text($text)   X-Ref
Censoring


smiley_text($text, $force_option = false)   X-Ref
Smiley processing


parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_id = 0, $preview = false)   X-Ref
Inline Attachment processing


extension_allowed($forum_id, $extension, &$extensions)   X-Ref
Check if extension is allowed to be posted within forum X (forum_id 0 == private messaging)


_build_hidden_fields($key, $value, $specialchar)   X-Ref
Little helper for the build_hidden_fields function


build_hidden_fields($field_ary, $specialchar = false)   X-Ref
Build simple hidden fields from array


parse_cfg_file($filename, $lines = false)   X-Ref
Parse cfg file


add_log()   X-Ref
Add log event


get_backtrace()   X-Ref
Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com)


get_preg_expression($mode)   X-Ref
This function returns a regular expression pattern for commonly used expressions
Use with / as delimiter for email mode
mode can be: email|bbcode_htm


truncate_string($string, $max_length = 60, $allow_reply = true)   X-Ref
Truncates string while retaining special characters if going over the max length
The default max length is 60 at the moment


phpbb_checkdnsrr($host, $type = '')   X-Ref
Wrapper for php's checkdnsrr function.

The windows failover is from the php manual
Please make sure to check the return value for === true and === false, since NULL could
be returned too.

return: true if entry found, false if not, NULL if this function is not supported by this environment

msg_handler($errno, $msg_text, $errfile, $errline)   X-Ref
Error and message handler, call with trigger_error if reqd


page_header($page_title = '', $display_online_list = true)   X-Ref
Generate page header


page_footer($run_cron = true)   X-Ref
Generate page footer


garbage_collection()   X-Ref
Closing the cache object and the database
Cool function name, eh? We might want to add operations to it later




Generated: Wed Nov 22 00:35:05 2006 Cross-referenced by PHPXref 0.6