phpDocumentor ninko
functions
[ class tree: ninko ] [ index: ninko ] [ all elements ]

Procedural File: common.php

Source Location: /include/functions/common.php

Page Details

common.php

Includes functions commonly used througout the entire script

Author:  Nijiko Yonskai <me@nijikokun.com>
Version:  1.2
Copyright:  (c) 2010 ANIGAIKU
Functions
br2nl  [line 250]

string br2nl( string $string  )

Creates newlines that will be parsed by text areas.

Parameters:
string   $string:  data to be replaced


[ Top ]
character_limiter  [line 169]

string character_limiter( string $str, [integer $n = 500], [mixed $end_char = '&amp;#8230;']  )

Limits a string by character amount, and adds an ending such as &hellip;

Parameters:
string   $str:  string to be limited
integer   $n:  characters $str is limited to
mixed   $end_char:  data to be appended to $str upon limiting


[ Top ]
clickable  [line 35]

string clickable( string $text  )

Parses urls that start with http(s) into clickable links

Parameters:
string   $text:  data to be scanned for links and replaced


[ Top ]
closetags  [line 272]

string closetags( string $text  )

Closes bbcode tags

Parameters:
string   $text:  data to be replaced


[ Top ]
equals  [line 136]

mixed equals( mixed $variable, [mixed $equals = &quot;&quot;], [mixed $true = &quot;&quot;], [mixed $false = &quot;&quot;]  )

Checks $variable against $equals, Outputs $true / $false

Parameters:
mixed   $variable:  the data we are checking $equal against
mixed   $equals:  the data we check against $variable
mixed   $true:  data output on true
mixed   $false:  data output on false


[ Top ]
generate_pagination  [line 362]

string generate_pagination( string $base_url, integer $num_items, integer $per_page, integer $start_item, [ $add_prevnext_text = false], boolean $add_prev_next_text  )

Creates the pagination for the topics / posts

Parameters:
string   $base_url:  the root path
integer   $num_items:  the total number of items we have
integer   $per_page:  how many items per page to show
integer   $start_item:  the current item we are on
boolean   $add_prev_next_text:  do we add the text prev / next?
   $add_prevnext_text: 


[ Top ]
gethostname  [line 81]

string gethostname( )

Retrieves the host name of a vistor / user



[ Top ]
nice_date  [line 199]

string nice_date( integer $_date  )

Returns a string representation of the date, of differing format depending on how recent the date is.

Parameters:
integer   $_date:  unix timestamp created with time(), mktime(), strtotime()


[ Top ]
nl2nl  [line 261]

string nl2nl( string $string  )

Creates newlines that will be parsed by text areas.

Parameters:
string   $string:  data to be replaced


[ Top ]
print_out  [line 49]

string print_out( mixed $title, mixed $body, [boolean|string $redirect = true]  )

Prints out a redirection / error template.

Parameters:
mixed   $title:  subject of printing out
mixed   $body:  the main details
boolean|string   $redirect:  do we redirect or not? if so where to?

API Tags:
Global:  array $config:


[ Top ]
read_files  [line 18]

array read_files( string $path  )

Reads all files and prints data into an array

Parameters:
string   $path:  directory where files are located


[ Top ]
riot_mail  [line 98]

mixed riot_mail( string $email, string $subject, string $message  )

Our constantly rioting mailing function

Parameters:
string   $email:  address email is to be sent to
string   $subject:  subject of email being sent
string   $message:  contents of email being sent

API Tags:
Global:  array $config:


[ Top ]
split_text  [line 227]

array split_text( string $text, mixed $start, mixed $end  )

Splits text based on $start and $end giving you an array of text outside and text inside

Parameters:
string   $text:  text to be split
mixed   $start:  opening data
mixed   $end:  ending data


[ Top ]
stripslashes_deep  [line 305]

mixed stripslashes_deep( mixed $value  )

Strips slashes recursively

Parameters:
mixed   $value:  data to be stripped of slashes


[ Top ]
switchs  [line 116]

mixed switchs( mixed $variable, [mixed $default = &quot;&quot;]  )

Switches return value based on input data

Parameters:
mixed   $variable:  variable we are checking
mixed   $default:  variable to be set incase $variable was false


[ Top ]
tab2space  [line 329]

string tab2space( string $text, [int $spaces = 4]  )

Converts tabs to the appropriate amount of spaces while preserving formatting

Parameters:
string   $text:  The text to convert
int   $spaces:  Number of spaces per tab column

API Tags:
Return:  The text with tabs replaced


[ Top ]


Documentation generated on Sat, 06 Feb 2010 10:46:02 -0500 by phpDocumentor 1.4.3