/includes/post.functions.php

Description

Post functions that

  • author: Abdul Al-Hasany
  • version: 2010
  • copyright: Abdul Al-hasany (c) 2010
  • access: public
Functions
add_to_url (line 358)

Add http:// to url if it does not exist

  • return: URL with http:// attached
mixed add_to_url (mixed $str)
  • mixed $str: URL to be evaluated
check_edit_time (line 222)

This function checks the maximum time allowed to edit a post

  • return: True if user still able to edit, or false if otherwise
booalen check_edit_time (integer $post_time, integer $max_edit_time)
  • integer $post_time: Post publishing time
  • integer $max_edit_time: Maximum edit time
escape_string (line 86)

Santize data agains mysql injection

  • return: Santized post
mixed escape_string (mixed $post)
  • mixed $post: Post to be santized
format_data (line 116)

Proccess data before sending it to the database

void format_data (mixed $string)
  • mixed $string
format_data_out (line 139)

Proccess data before viewing it in the browser

  • return: String
mixed format_data_out (mixed $string)
  • mixed $string: String to be proccessed
format_post (line 102)

Clean post from mailicous code

  • return: Cleaned post
mixed format_post (mixed $string)
  • mixed $string: Post to be cleaned
highlight_words (line 398)

This function highlights a word when a search is done

  • return: Highlighted text
mixed highlight_words (mixed $string)
  • mixed $string: String to be evaluated
limit_text_view (line 376)

Limit the view text characters, used in post headers

  • return: New limited text
mixed limit_text_view (mixed $text, [integer $char_num = '50'])
  • mixed $text: Text to be evaluated
  • integer $char_num: Maximum number of characters to be viewed
maximum_allowed (line 341)

Check the maximum amount allowed of text

  • return: True if characters are less than the maxium, false otherwise
booalen maximum_allowed (mixed $txt, mixed $mxs)
  • mixed $txt: Text to be evaluated
  • mixed $mxs: Maximum allowed characters
post_output (line 168)

Formate post: replace bbcode, stripslaes and convert lines

  • return: Fomratted post
mixed post_output (mixed $string, [string $editor = 'bbcode'], [integer $wrap = '100000'])
  • mixed $string: String to be evaluated
  • string $editor: Editor used bbcode or html
  • integer $wrap: Number of characters to wrap
replace_censored_words (line 199)

Replace censored words

  • return: Post with censored words removed
mixed replace_censored_words (mixed $string)
  • mixed $string: String in which the function will look for censored words
replace_smile_images (line 414)

Replace smiles images in a post

  • return: Text with smiles images replaced
mixed replace_smile_images (mixed $post)
  • mixed $post: Text to be evaluated
required_entries (line 313)

Check for required post entries

  • return: True if all values pass, or false if any one of them is empty
booalen required_entries (mixed $form)
  • mixed $form: values to be checked
santize_post_data (line 46)

Remove all malicious code in post data

  • return: Cleaned post
mixed santize_post_data (mixed $Str)
  • mixed $Str: String to be cleaned
upload_image (line 248)

This function handles image upload

  • return: Function will move image to the upload folder
null upload_image (string $inputname, [integer $width = '200'], [integer $height = '200'], string $new_name, [integer $size_limit = '30'], [array $types = array()], [array $extensions = array()], [mixed $module = ''])
  • string $inputname: Image Input name
  • integer $width: Width if the image
  • integer $height: Height of the image
  • string $new_name: New image name
  • integer $size_limit: Size limit
  • array $types: Array of image types that are allowed to be uploaed
  • array $extensions: Array of image extensions that are allowed to be uploaed
  • mixed $module: Module of which the image belongs to

Documentation generated on Fri, 16 Apr 2010 12:54:46 +1000 by phpDocumentor 1.4.1