b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Procedural File: _functions.php

Source Location: /blogs/b2evocore/_functions.php

Page Details

General purpose functions

b2evolution - http://b2evolution.net/ Released under GNU GPL License - http://b2evolution.net/about/license.html

Author:  This file built upon code from original b2 - http://cafelog.com/
Author:  vegarg
Copyright:  (c)2003-2005 by Francois PLANQUE - http://fplanque.net/
Filesource:  Source Code for this file
Includes
require_once (dirname(__FILE__).'/_functions_cats.php') [line 18]

Includes:

[ Top ]

require_once (dirname(__FILE__).'/_functions_pings.php') [line 24]
[ Top ]

require_once (dirname(__FILE__).'/_functions_errors.php') [line 26]
[ Top ]

require_once (dirname(__FILE__).'/_functions_skins.php') [line 25]
[ Top ]

require_once (dirname(__FILE__).'/_functions_blogs.php') [line 19]
[ Top ]

require_once (dirname(__FILE__).'/_functions_pingback.php') [line 23]
[ Top ]

require_once (dirname(__FILE__).'/_functions_users.php') [line 21]
[ Top ]

require_once (dirname(__FILE__).'/_class_htmlchecker.php') [line 29]
[ Top ]

require_once (dirname(__FILE__).'/_functions_antispam.php') [line 27]
[ Top ]

require_once (dirname(__FILE__).'/_functions_trackback.php') [line 22]
[ Top ]

require_once (dirname(__FILE__).'/_functions_bposts.php') [line 20]
[ Top ]


Functions
alert_confirm  [line 498]

void alert_confirm( $msg  )
Parameters:
   $msg: 


[ Top ]
alert_error  [line 475]

void alert_error( $msg  )
Parameters:
   $msg: 


[ Top ]
antispambot  [line 441]

void antispambot( $emailaddy, [ $mailto = 0]  )
Parameters:
   $emailaddy: 
   $mailto: 


[ Top ]
autobrize  [line 230]

void autobrize( $content  )
Parameters:
   $content: 


[ Top ]
autoquote  [line 1042]

void autoquote( &$string  )
Parameters:
   &$string: 


[ Top ]
balanceTags  [line 685]

void balanceTags( $text  )
Parameters:
   $text: 


[ Top ]
convert_chars  [line 271]

void convert_chars( $content, [ $flag = 'html']  )
Parameters:
   $content: 
   $flag: 


[ Top ]
date_i18n  [line 359]

void date_i18n( $dateformatstring, $unixtimestamp, [ $useGM = false]  )
Parameters:
   $dateformatstring: 
   $unixtimestamp: 
   $useGM: 


[ Top ]
debug_fclose  [line 656]

void debug_fclose( $fp  )
Parameters:
   $fp: 


[ Top ]
debug_fopen  [line 636]

void debug_fopen( $filename, $mode  )
Parameters:
   $filename: 
   $mode: 


[ Top ]
debug_fwrite  [line 647]

void debug_fwrite( $fp, $string  )
Parameters:
   $fp: 
   $string: 


[ Top ]
debug_info  [line 1141]

void debug_info( [boolean $force = false]  )

Outputs debug info. (Typically at the end of the page)

Parameters:
boolean   $force:  true to force output


[ Top ]
debug_log  [line 1127]

void debug_log( boolean $message  )

Log a debug string to be displayed later. (Typically at the end of the page)

Parameters:
boolean   $message:  true to force output


[ Top ]
format_to_edit  [line 145]

void format_to_edit( $content, [ $autobr = false]  )
Parameters:
   $content: 
   $autobr: 


[ Top ]
format_to_output  [line 76]

string format_to_output( string $content, [string $format = 'htmlbody']  )

Format a string/content for being output

Parameters:
string   $content:  raw text
string   $format:  format, can be one of the following
  • raw: do nothing
  • htmlbody: display in HTML page body: allow full HTML
  • entityencoded: Special mode for RSS 0.92: allow full HTML but escape it
  • htmlhead: strips out HTML (mainly for use in Title)
  • htmlattr: use as an attribute: strips tags and escapes quotes
  • formvalue: use as a form value: escapes quotes and < > but leaves code alone
  • xml: use in an XML file: strip HTML tags
  • xmlattr: use as an attribute: strips tags and escapes quotes

API Tags:
Return:  formatted text

Information Tags:
Author:  fplanque

[ Top ]
format_to_post  [line 161]

void format_to_post( $content, [ $autobr = 0], [ $is_comment = 0], [ $encoding = '']  )
Parameters:
   $content: 
   $autobr: 
   $is_comment: 
   $encoding: 


[ Top ]
get_path  [line 1025]

void get_path( [ $which = '']  )

get_path(-)

Parameters:
   $which: 


[ Top ]
get_weekstartend  [line 421]

void get_weekstartend( $mysqlstring, $start_of_week  )

Get start and end day of a week, based on week number and start-of-week

Used by Calendar

Parameters:
   $mysqlstring: 
   $start_of_week: 


[ Top ]
is_email  [line 464]

void is_email( $user_email  )
Parameters:
   $user_email: 


[ Top ]
make_clickable  [line 316]

void make_clickable( $text, [ $moredelim = '&amp;amp;']  )

Make links clickable in a given text.

Parameters:
   $text: 
   $moredelim: 

Information Tags:
Todo:  

IMHO it would be better to use "\b" (word boundary) to match the beginning of links..

original function: phpBB, extended here for AIM & ICQ fplanque restricted :// to http:// and mailto://


[ Top ]
mysql2date  [line 342]

void mysql2date( $dateformatstring, $mysqlstring, [ $useGM = false]  )

*** // Formatting functions ****

Parameters:
   $dateformatstring: 
   $mysqlstring: 
   $useGM: 


[ Top ]
mysql_oops  [line 46]

boolean mysql_oops( string $sql_query  )

Report MySQL errors in detail.

Parameters:
string   $sql_query:  The query which led to the error

API Tags:
Return:  success?
Deprecated:  use class DB instead


[ Top ]
obhandler  [line 1196]

void obhandler( string $output  )

Output Buffer handler.

It will be set in /blogs/evocore/_main.php and handle the output. It strips every line and generates a md5-ETag, which is checked against the one eventually being sent by the browser.

Parameters:
string   $output:  output given by PHP

Information Tags:
Author:  blueyed

[ Top ]
param  [line 839]

mixed param( string $var, [string $type = ''], [mixed $default = ''], [boolean $memorize = false], [boolean $override = false], [boolean $forceset = true]  )

Sets a parameter with values from the request or to provided default, except if param is already set!

Also removes magic quotes if they are set automatically by PHP. Also forces type. Priority order: POST, GET, COOKIE, DEFAULT.

Parameters:
string   $var:  Variable to set
string   $type:  Force value type to one of:
  • boolean
  • integer
  • float
  • string
  • array
  • object
  • null
  • html (does nothing)
mixed   $default:  Default value or TRUE if user input required
boolean   $memorize:  Do we need to memorize this to regenerate the URL for this page?
boolean   $override:  Override if variable already set
boolean   $forceset:  Force setting of variable to default?

API Tags:
Return:  Final value of Variable, or false if we don't force setting and and did not set

Information Tags:
Author:  fplanque
Todo:  add option to override what's already set. DONE.

[ Top ]
pre_dump  [line 1107]

void pre_dump( mixed $dump, [string $title = '']  )

wrap pre around var_dump(), better debuggin'

Parameters:
mixed   $dump:  variable to dump
string   $title:  title to display

Information Tags:
Author:  blueyed

[ Top ]
redirect_js  [line 512]

void redirect_js( $url, [ $title = &quot;...&quot;]  )
Parameters:
   $url: 
   $title: 


[ Top ]
regenerate_url  [line 937]

void regenerate_url( [ $ignore = ''], [ $set = ''], [ $pagefileurl = '']  )
Parameters:
   $ignore: 
   $set: 
   $pagefileurl: 


[ Top ]
remove_magic_quotes  [line 789]

void remove_magic_quotes( mixed $mixed  )

Clean up the mess PHP has created with its funky quoting everything!

Parameters:
mixed   $mixed:  string or array (function is recursive)


[ Top ]
send_mail  [line 1324]

void send_mail( string $to, string $subject, string $message, [string $from = ''], [array $headers = array()]  )

sends a mail, wraps PHP's mail() function.

$current_locale will be used to set the charset

send_mail(-)

Parameters:
string   $to:  recipient
string   $subject:  subject of the mail
string   $message:  the message
string   $from:  From address, being added to headers
array   $headers:  additional headers


[ Top ]
timer_start  [line 533]

void timer_start( )


[ Top ]
timer_stop  [line 542]

void timer_stop( [ $display = 0], [ $precision = 3]  )
Parameters:
   $display: 
   $precision: 


[ Top ]
unautobrize  [line 240]

void unautobrize( $content  )
Parameters:
   $content: 


[ Top ]
url_add_param  [line 1274]

void url_add_param( string $url, string $param, [string $moredelim = '&amp;amp;']  )

Add param(s) at the end of an URL, using either ? or &amp; depending on exiting url

url_add_param(-)

Parameters:
string   $url:  existing url
string   $param:  params to add
string   $moredelim:  delimiter to use for more params


[ Top ]
url_add_tail  [line 1299]

void url_add_tail( string $url, string $tail  )

Add a tail (starting with /) at the end of an URL before any params (starting with ?)

url_add_tail(-)

Parameters:
string   $url:  existing url
string   $tail:  tail to add


[ Top ]
validate_url  [line 1061]

mixed validate_url( string $url, array &$allowed_uri_scheme  )

Check the validity of a given URL

Checks allowed URI schemes and URL ban list URL can be empty

Parameters:
string   $url:  Url to validate
array   &$allowed_uri_scheme:  Allowed URI schemes (see /conf/_formatting.php)

API Tags:
Return:  false or error message


[ Top ]
xmlrpc_displayresult  [line 599]

void xmlrpc_displayresult( $result, [ $log = ''], [ $display = true]  )
Parameters:
   $result: 
   $log: 
   $display: 


[ Top ]
xmlrpc_getpostcategory  [line 572]

void xmlrpc_getpostcategory( $content  )

Also used by post by mail

Parameters:
   $content: 


[ Top ]
xmlrpc_getposttitle  [line 555]

void xmlrpc_getposttitle( $content  )
Parameters:
   $content: 


[ Top ]
xmlrpc_removepostdata  [line 585]

void xmlrpc_removepostdata( $content  )
Parameters:
   $content: 


[ Top ]
zeroise  [line 250]

void zeroise( $number, $threshold  )
Parameters:
   $number: 
   $threshold: 


[ Top ]


Documentation generated on Tue, 20 May 2008 01:54:20 +0200 by phpDocumentor 1.4.2