/includes/general.functions.php

Description

general functions to manage different aspects of DiY-CMS

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

Add slahes to URLs

  • return: Slahsed URL
mixed add_url_slash (mixed $url)
  • mixed $url: URL to be slashed
checkcookie (line 253)

Check if a cookie exist for the current user

  • return: an error message will be displayed if no cookie is found
null checkcookie ()
check_email_validity (line 80)

Check whether email is a valid email or not

  • return: False if email is invalid, true of it is valid
boolean check_email_validity (mixed $email)
  • mixed $email: Email to be validated
check_referer (line 464)

This function check the website the user came from

null check_referer ()
display_nav_bar (line 45)

Display navigation bar for control panel

  • return: Navigation bar templates
mixed display_nav_bar ([string $extra = ''])
  • string $extra: Add any extra element to the navigation bar
error_message (line 380)

Display error message

  • return: Reutrn Error message template and exit the rest of the script
null error_message (string $msg)
  • string $msg: Error message to be displayed
format_date (line 513)

Format data

  • return: Formatted date
mixed format_date (mixed $get_date)
  • mixed $get_date: Timesatmp to be formated
format_Size (line 225)

Convert size to the appropriate unit

  • return: Formatted size
integer format_Size (mixed $fileSize)
  • mixed $fileSize: Size to be formatted
format_time (line 537)

Get time out of timestamp

  • return: Formatted Timestamp
mixed format_time (mixed $timedate)
  • mixed $timedate: Timestamp to be formatted
get_file_path (line 824)

Get path for uploaded images or files

void get_file_path (mixed $upload_name, [string $module = ''], [mixed $dir_path = ''])
  • mixed $upload_name: Name of the file
  • string $module: Module of which the file belongs to
  • mixed $dir_path: Folder at which the file resides, if left empty the default path will be used
get_global_setting (line 774)

Get a single global setting retrived from the settings_array function

void get_global_setting (mixed $setting)
  • mixed $setting
get_group_setting (line 792)

Get a setting for a spcified group

  • return: The value of the setting
mixed get_group_setting (mixed $setting)
  • mixed $setting: Setting to be retrived
get_hooked_functions (line 844)
void get_hooked_functions ( $core_function)
  • $core_function
get_host_name (line 488)

Get the host name

  • return: host name
String get_host_name (mixed $str)
  • mixed $str
get_message (line 639)

Get message from the html/messag folder

  • return: Message to be sent
mixed get_message (mixed $message, [string $htm = '1'], [mixed $replace = array()])
  • mixed $message: Message title (has to be the same one in html/message folder
  • string $htm:
    1. for html mssage and 0 for text message
  • mixed $replace: Array to replace the values in the message
get_user_group (line 605)

This function returens the group title of a particular user

void get_user_group (mixed $array, integer $usergid)
  • mixed $array: Groups array
  • integer $usergid: User groupid
get_user_info (line 622)

Get user infomration and put them in an object

  • return: User information
mixed get_user_info (integer $userid)
  • integer $userid: Userid
get_user_ip (line 810)

Get user IP

  • return: User IP
mixed get_user_ip ()
get_user_rank (line 577)

Get the user rank

  • return: Title of user and his rank
mixed get_user_rank (mixed $rank_array, integer $posts)
  • mixed $rank_array: Rank Array
  • integer $posts: Number of users posts
hook_a_function (line 837)
void hook_a_function ( $function_name,  $paramters,  $core_function)
  • $function_name
  • $paramters
  • $core_function
implode_data (line 446)

Implode data

  • return: Imploded Data
mixed implode_data (mixed $array)
  • mixed $array: array to be imploded
includeFile (line 683)

Include a function when the replace_callback is called

  • return: Included file
mixed includeFile (mixed $matches)
  • mixed $matches: Matches from the replace_callback function
info_message (line 351)

Display an information message and redirect the user to the link set by $url

  • return: Return the information message template and exit the script
null info_message (mixed $msg, [string $url = ''], [string $time = '3'])
  • mixed $msg: Message to be displayed
  • string $url: The URL the user will be redircted to
  • string $time: Seconds before the user is transfered
Login (line 276)

Display login form for restricted area

  • return: Function will return login template
mixed Login ()
page_footer (line 406)

Display page footer

  • return: Footer
Page page_footer ([ $r = ''])
  • $r
page_header (line 294)

Display page header

  • return: Will return page header
null page_header (mixed $title, [integer $Cache = 0], [string $pagekey = ''], [string $pagedesc = ''])
  • mixed $title: Title of the page
  • integer $Cache: If set to 0 it will override default cache control
  • string $pagekey: Page Keyword
  • string $pagedesc: Page Description
pagination (line 96)

Pagination function, allows for the pagination of huge data

  • return: pagination template
mixed pagination (integer $numrows, integer $perpage, [string $link = ''])
  • integer $numrows: Number of total rows
  • integer $perpage: Number of rows per page
  • string $link: Link to be used when a page is clicked
pagination_list (line 167)

Displays pagination next to a topic title

  • return: Topic pagination list
mixed pagination_list (integer $numrows, integer $perpage, mixed $link)
  • integer $numrows: Number of total rows to be paginatied
  • integer $perpage: Number of row per page
  • mixed $link: Link to be viewed when a page is clicked
popup_window (line 394)

Display a popup message

  • return: Pop Message Template
mixed popup_window (mixed $msg)
  • mixed $msg: Content to be displayed in the popup window
ReadFromFile (line 709)

Read from a file or a link

void ReadFromFile (mixed $matches)
  • mixed $matches
replace_callback (line 669)

Replce callback functions

  • return: String with the callback functions called
mixed replace_callback (mixed $string)
  • mixed $string: String in which pattern exist
settings_array (line 753)

Put all website settings into an array

  • return: Settings array
array settings_array ()
set_id_int (line 208)

Check whether a certian value is an integer or not (useful for $_GET['ID'] value evaluation) It also make the value a required entry (so if it does not exist an error message will be displayed

  • return: Evaluated integer
integer set_id_int (integer $value)
  • integer $value: value toi be evaluated

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