Class XFParser

Description

XFParser takes care of text processing, tag management and some more

Located in /lb_private/class.parser.php (line 26)


	
			
Class Constant Summary
 PARSER_ALLOW_SCHEME_EMBED = 'avi,mp3,mpg,swf,svg,xxx,other'
 PARSER_ALLOW_SCHEME_URI = 'http,https,ftp,ftps'
Variable Summary
static array $bbcode_stack
Method Summary
static mixed calculate_age (integer $a, [boolean $astext = true])
static array calendar (integer $min, integer $max)
static mixed fetch_read_tracker_timestamp ( &$topicid, int $topicid)
static integer get_reply_count (array $a, string $b)
static boolean is_posting_read (integer $topicid, integer $last)
static integer lastpost ( &$a, [boolean $b = false], array $a)
static integer lastunread ( &$a, array $a)
static integer limit_rating (string $a)
static string message (string $a)
static string parser_code (string $a, [string $b = ''])
static string parser_embedded_object (string $a, string $b)
static true parser_emoticon ( &$a, string $a)
static string parser_enhanced_format (string $a)
static string parser_references (string $input)
static string parser_simple_format (string $a)
static true parser_tidy ( &$a, string $a)
static mixed resolve_tags (array $a)
static boolean tag_management (string $postid, string $tags, [string $flags = ''])
static true tag_query ([array $a = ''])
static boolean user_calculations ([integer $a = 0])
Variables
static array $bbcode_stack = array() (line 58)
  • var: amount of open tags in message to close them later during parsing
  • access: protected
Methods
static method calculate_age (line 581)

calculate the age of a timestamp

  • since: 1.0.0
  • access: public
static mixed calculate_age (integer $a, [boolean $astext = true])
  • integer $a: input timestamp
  • boolean $astext: return it as text or array?
static method calendar (line 677)

create a calendar

  • since: 1.0.0
  • access: public
static array calendar (integer $min, integer $max)
  • integer $min: beginning timestamp
  • integer $max: ending timestamp
static method fetch_read_tracker_timestamp (line 731)

get the latest timestamp of topic from read tracker

  • since: 1.0.0
  • access: protected
static mixed fetch_read_tracker_timestamp ( &$topicid, int $topicid)
  • int $topicid: topic id
  • &$topicid
static method get_reply_count (line 550)

calculate reply count

  • since: 1.0.0
  • access: public
static integer get_reply_count (array $a, string $b)
  • array $a: 'tree' from XFCache::topic()
  • string $b: fetch unapproved '-' or approved '+' posts
static method is_posting_read (line 663)

check whether a posting has been read before during session

  • since: 1.0.0
  • access: public
static boolean is_posting_read (integer $topicid, integer $last)
  • integer $topicid: topic id
  • integer $last: timestamp of last posting in topic
static method lastpost (line 625)

fetch last postid from topic

  • since: 1.0.0
  • access: public
static integer lastpost ( &$a, [boolean $b = false], array $a)
  • array $a: resource array from XFCache::topic()
  • boolean $b: if false, skip unapproved postings
  • &$a
static method lastunread (line 643)

fetch last postid from topic which is unread

  • since: 1.0.0
  • access: public
static integer lastunread ( &$a, array $a)
  • array $a: resource array from XFCache::topic()
  • &$a
static method limit_rating (line 565)

limit any rating values to multiples of ten

  • since: 1.0.0
  • access: public
static integer limit_rating (string $a)
  • string $a: rating value
static method message (line 66)

parse a text by several routines for output (usually used on posting text)

  • since: 1.0.0
  • access: public
static string message (string $a)
  • string $a: input stream
static method parser_code (line 268)

parse code blocks

  • since: 1.0.0
  • access: protected
static string parser_code (string $a, [string $b = ''])
  • string $a: input stream
  • string $b: additional parameters
static method parser_embedded_object (line 358)

parse embedded objects

  • since: 1.0.0
  • access: protected
static string parser_embedded_object (string $a, string $b)
  • string $a: type (can be empty)
  • string $b: uri
static method parser_emoticon (line 342)

parse emoticon strings to images

  • since: 1.0.0
  • access: protected
static true parser_emoticon ( &$a, string $a)
  • string $a: input stream
  • &$a
static method parser_enhanced_format (line 142)

parse special formatting, e.g. '[format=b,i,bgcolor:#ff0000]'

  • since: 1.0.0
  • access: protected
static string parser_enhanced_format (string $a)
  • string $a: input stream
static method parser_references (line 179)

parse references like images and links

  • since: 1.0.0
  • access: protected
static string parser_references (string $input)
  • string $input: input stream
static method parser_simple_format (line 102)

parse simple tags like bold, italic etc.

  • since: 1.0.0
  • access: protected
static string parser_simple_format (string $a)
  • string $a: input stream
static method parser_tidy (line 316)

clean up message by closing open tags

  • since: 1.0.0
  • access: protected
static true parser_tidy ( &$a, string $a)
  • string $a: input stream
  • &$a
static method resolve_tags (line 453)

resolve any tags to their id and return them

  • since: 1.0.0
  • access: protected
static mixed resolve_tags (array $a)
  • array $a: tag name, multiple allowed
static method tag_management (line 484)

manage the tags of a posting

  • since: 1.0.0
  • access: public
static boolean tag_management (string $postid, string $tags, [string $flags = ''])
  • string $postid: post id
  • string $tags: tags (names separated by comma)
  • string $flags: 'skip_check' does not check for posting existence
static method tag_query (line 401)

query tags and put them to local cache for further operations

  • since: 1.0.0
  • access: public
static true tag_query ([array $a = ''])
  • array $a: tag id or a name, multiple allowed
static method user_calculations (line 697)

do some calulations on an user account. currently it computes 'rating_bonus'.

  • since: 1.0.0
  • access: public
static boolean user_calculations ([integer $a = 0])
  • integer $a: user id
Class Constants
MAX_RATE_BONUS = 10 (line 30)
  • var: what is the maximum bonus for rating a posting
PARSER_ALLOW_EMBED = true (line 42)
  • var: should the text parser for forum postings allow external objects?
PARSER_ALLOW_IMG = true (line 38)
  • var: should the text parser for forum postings allow external images?
PARSER_ALLOW_MAIL = true (line 46)
  • var: should the text parser for forum postings allow e-mail addresses?
PARSER_ALLOW_SCHEME_EMBED = 'avi,mp3,mpg,swf,svg,xxx,other' (line 54)
  • var: which media types can be linked to in embed tags?
PARSER_ALLOW_SCHEME_URI = 'http,https,ftp,ftps' (line 50)
  • var: which protocols should be allowed to link to in forum postings?
PARSER_ALLOW_URI = true (line 34)
  • var: should the text parser for forum postings allow external uri?

Documentation generated on Sat, 20 Jun 2009 12:43:26 +0200 by phpDocumentor 1.4.1