Roster:FunctionsOverview

From WoWRosterWiKi
(Difference between revisions)
Jump to: navigation, search
(New page: __NOEDITSECTION__ {{Disclaimer}} {{MainMenu|Roster}} '''Function Overview'''<br/> Overview over all functions in the Roster that can be used by Addon Developers.<br/> ---- Latest changes ...)
 
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOEDITSECTION__
 
__NOEDITSECTION__
{{Disclaimer}}
+
{{Disclaimer|NoLang}}
 
{{MainMenu|Roster}}
 
{{MainMenu|Roster}}
  
'''Function Overview'''<br/>
+
'''Functions Overview'''<br>
Overview over all functions in the Roster that can be used by Addon Developers.<br/>
+
Overview over all functions in the Roster that can be used by Addon Developers.<br>
----
+
 
Latest changes
+
See also the new [[Roster:API|Roster API]] for additional information.
*Nefuh | 05.02.2008 03:07 | Created document
+
----
+
 
<br />
 
<br />
 
__TOC__
 
__TOC__
Line 16: Line 14:
  
 
==border==
 
==border==
Parameters: $style, $mode, $header_txt, $width<br/>
+
Parameters: $style, $mode, $header_txt, $width<br>
Starts or ends fancy bodering containers<br/>
+
Starts or ends fancy bodering containers<br>
 
*@param string $style What bordering style to use
 
*@param string $style What bordering style to use
 
*@param string $mode ( start | end )
 
*@param string $mode ( start | end )
Line 23: Line 21:
 
*@param string $width Set a fixed width for the box
 
*@param string $width Set a fixed width for the box
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==setTooltip==
 
==setTooltip==
Parameters: $var, $content<br/>
+
Parameters: $var, $content<br>
Makes a tootip and places it into the tooltip array<br/>
+
Makes a tootip and places it into the tooltip array<br>
 
*@param string $var
 
*@param string $var
 
*@param string $content
 
*@param string $content
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==getAllTooltips==
 
==getAllTooltips==
Parameters: none<br/>
+
Parameters: none<br>
Gathers all tootips and places them into javascript variables<br/>
+
Gathers all tootips and places them into javascript variables<br>
 
*@param array $tooltipArray
 
*@param array $tooltipArray
 
*@return string Tooltips placed in javascript variables
 
*@return string Tooltips placed in javascript variables
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==sql_highlight==
 
==sql_highlight==
Parameters: $sql<br/>
+
Parameters: $sql<br>
Highlight certain keywords in a SQL query<br/>
+
Highlight certain keywords in a SQL query<br>
 
*@param string $sql Query string
 
*@param string $sql Query string
 
*@return string Highlighted string
 
*@return string Highlighted string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==die_quietly==
 
==die_quietly==
Parameters: $text, $title, $file, $line, $sql<br/>
+
Parameters: $text, $title, $file, $line, $sql<br>
Clean replacement for die(), outputs a message with debugging info if needed and ends output<br/>
+
Clean replacement for die(), outputs a message with debugging info if needed and ends output<br>
 
*@param string $text Text to display on error page
 
*@param string $text Text to display on error page
 
*@param string $title Title to place on web page (default Message)
 
*@param string $title Title to place on web page (default Message)
Line 54: Line 52:
 
*@param string $line Line in file to display
 
*@param string $line Line in file to display
 
*@param string $sql Any SQL text to display
 
*@param string $sql Any SQL text to display
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==roster_die==
 
==roster_die==
Parameters: $message, $title, $style<br/>
+
Parameters: $message, $title, $style<br>
Draw a message box with the specified border color, then die cleanly<br/>
+
Draw a message box with the specified border color, then die cleanly<br>
 
*@param string $message | The message to display inside the box
 
*@param string $message | The message to display inside the box
 
*@param string $title | The box title (default Message )
 
*@param string $title | The box title (default Message )
 
*@param string $style | The border style (default sred)
 
*@param string $style | The border style (default sred)
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==ajax_die==
 
==ajax_die==
Parameters: $text, $title, $file, $line, $sql<br/>
+
Parameters: $text, $title, $file, $line, $sql<br>
Print a roster-ajax XML error message<br/>
+
Print a roster-ajax XML error message<br>
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==backtrace==
 
==backtrace==
Parameters: none<br/>
+
Parameters: none<br>
Print a debug backtrace. This works in PHP4.3.x+, there is an integrated function for this starting PHP5 but I prefer always having the same layout.<br/>
+
Print a debug backtrace. This works in PHP4.3.x+, there is an integrated function for this starting PHP5 but I prefer always having the same layout.<br>
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==stripAllHtml==
 
==stripAllHtml==
Parameters: $string<br/>
+
Parameters: $string<br>
This will remove HTML tags, javascript sections and white space. It will also convert some common HTML entities to their text equivalent<br/>
+
This will remove HTML tags, javascript sections and white space. It will also convert some common HTML entities to their text equivalent<br>
 
*@param string $file
 
*@param string $file
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==check_if_image==
 
==check_if_image==
Parameters: $filename<br/>
+
Parameters: $filename<br>
This will check if the given Filename is an image<br/>
+
This will check if the given Filename is an image<br>
 
*@param imagefile $file
 
*@param imagefile $file
 
*@return mixed The extentsion if the filetype is an image, false if it is not
 
*@return mixed The extentsion if the filetype is an image, false if it is not
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==colorTooltip==
 
==colorTooltip==
Parameters: $tooltip, $caption_color, $locale, $inline_caption<br/>
+
Parameters: $tooltip, $caption_color, $locale, $inline_caption<br>
Tooltip colorizer function with string cleaning. Use only with [[#makeOverlib]]<br/>
+
Tooltip colorizer function with string cleaning. Use only with [[#makeOverlib]]<br>
 
*@param string $tooltip | Tooltip as a string (delimited by "\n" character)
 
*@param string $tooltip | Tooltip as a string (delimited by "\n" character)
 
*@param string $caption_color | (optional) Color for the caption
 
*@param string $caption_color | (optional) Color for the caption
Line 98: Line 96:
 
*Default is true
 
*Default is true
 
*@return string | Formatted tooltip
 
*@return string | Formatted tooltip
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==cleanTooltip==
 
==cleanTooltip==
Parameters: $tooltip, $caption_color, $inline_caption<br/>
+
Parameters: $tooltip, $caption_color, $inline_caption<br>
Cleans up the tooltip and parses an inline_caption if needed. Use only with [[#makeOverlib]]<br/>
+
Cleans up the tooltip and parses an inline_caption if needed. Use only with [[#makeOverlib]]<br>
 
*@param string $tooltip | Tooltip as a string (delimited by "\n" character)
 
*@param string $tooltip | Tooltip as a string (delimited by "\n" character)
 
*@param string $caption_color | (optional) Color for the caption
 
*@param string $caption_color | (optional) Color for the caption
Line 109: Line 107:
 
*Default is true
 
*Default is true
 
*@return string | Formatted tooltip
 
*@return string | Formatted tooltip
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==makeOverlib==
 
==makeOverlib==
Parameters: $tooltip, $caption, $caption_color, $mode, $locale, $extra_parameters<br/>
+
Parameters: $tooltip, $caption, $caption_color, $mode, $locale, $extra_parameters<br>
Easy all in one function to make overlib tooltips. Creates a string for insertion into any html tag that has "onmouseover" and "onmouseout" events<br/>
+
Easy all in one function to make overlib tooltips. Creates a string for insertion into any html tag that has "onmouseover" and "onmouseout" events<br>
 
*@param string $tooltip | Tooltip as a string (delimited by "\n" character)
 
*@param string $tooltip | Tooltip as a string (delimited by "\n" character)
 
*@param string $caption | (optional) Text to set as a true OverLib caption
 
*@param string $caption | (optional) Text to set as a true OverLib caption
Line 126: Line 124:
 
*@param string $item_id
 
*@param string $item_id
 
*@return unknown
 
*@return unknown
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==messagebox==
 
==messagebox==
Parameters: $message, $title, $style, $width<br/>
+
Parameters: $message, $title, $style, $width<br>
Draw a message box with the specified border color.<br/>
+
Draw a message box with the specified border color.<br>
 
*@param string $message | The message to display inside the box
 
*@param string $message | The message to display inside the box
 
*@param string $title | The box title (default message)
 
*@param string $title | The box title (default message)
Line 136: Line 134:
 
*@param string $width | Set a fixed width
 
*@param string $width | Set a fixed width
 
*@return string $html | The HTML for the messagebox
 
*@return string $html | The HTML for the messagebox
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==scrollbox==
 
==scrollbox==
Parameters: $message, $title, $style, $width, $height<br/>
+
Parameters: $message, $title, $style, $width, $height<br>
Draw a 300x550px scrolling messagebox with the specified border color.<br/>
+
Draw a 300x550px scrolling messagebox with the specified border color.<br>
 
*@param string $message | The message to display inside the box
 
*@param string $message | The message to display inside the box
 
*@param string $title | The box title (default message)
 
*@param string $title | The box title (default message)
Line 147: Line 145:
 
*@param string $height | Initial height with unit (default 300px)
 
*@param string $height | Initial height with unit (default 300px)
 
*@return string $html | The HTML for the messagebox
 
*@return string $html | The HTML for the messagebox
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==messageboxtoggle==
 
==messageboxtoggle==
Parameters: $message, $title, $style, $open, $width<br/>
+
Parameters: $message, $title, $style, $open, $width<br>
Draw a message box with the specified border color.<br/>
+
Draw a message box with the specified border color.<br>
 
*@param string $message | The message to display inside the box
 
*@param string $message | The message to display inside the box
 
*@param string $title | The box title
 
*@param string $title | The box title
Line 158: Line 156:
 
*@param string $width | Initial width with unit (default 550px)
 
*@param string $width | Initial width with unit (default 550px)
 
*@return string $html | The HTML for the messagebox
 
*@return string $html | The HTML for the messagebox
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==scrollboxtoggle==
 
==scrollboxtoggle==
Parameters: $message, $title, $style, $open, $width, $height<br/>
+
Parameters: $message, $title, $style, $open, $width, $height<br>
Draw a 300x550px scrolling messagebox with the specified border color.<br/>
+
Draw a 300x550px scrolling messagebox with the specified border color.<br>
 
*@param string $messages | The message to display inside the box
 
*@param string $messages | The message to display inside the box
 
*@param string $title | The box title (default message)
 
*@param string $title | The box title (default message)
Line 169: Line 167:
 
*@param string $height | Initial height with unit (default 300px)
 
*@param string $height | Initial height with unit (default 300px)
 
*@return string $html | The HTML for the messagebox
 
*@return string $html | The HTML for the messagebox
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==escape_array==
 
==escape_array==
Parameters: $array<br/>
+
Parameters: $array<br>
Recursively escape $array<br/>
+
Recursively escape $array<br>
 
*@param array $array | The array to escape
 
*@param array $array | The array to escape
 
*@return array | The same array, escaped
 
*@return array | The same array, escaped
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==stripslash_array==
 
==stripslash_array==
Parameters: $array<br/>
+
Parameters: $array<br>
Recursively stripslash $array<br/>
+
Recursively stripslash $array<br>
 
*@param array $array | The array to escape
 
*@param array $array | The array to escape
 
*@return array | The same array, escaped
 
*@return array | The same array, escaped
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==readbleDate==
 
==readbleDate==
Parameters: $datetime, $offset<br/>
+
Parameters: $datetime, $offset<br>
Converts a datetime field into a readable date<br/>
+
Converts a datetime field into a readable date<br>
 
*@param string $datetime | datetime field data in DB
 
*@param string $datetime | datetime field data in DB
 
*@param string $offset | Offset in hours to calcuate time returned
 
*@param string $offset | Offset in hours to calcuate time returned
 
*@return string | formatted date string
 
*@return string | formatted date string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==get_file_ext==
 
==get_file_ext==
Parameters: $filename<br/>
+
Parameters: $filename<br>
Gets a file's extention passed as a string<br/>
+
Gets a file's extention passed as a string<br>
 
*@param string $filename
 
*@param string $filename
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==seconds_to_time==
 
==seconds_to_time==
Parameters: $seconds<br/>
+
Parameters: $seconds<br>
Converts seconds to a string delimited by time values. Will show w,d,h,m,s<br/>
+
Converts seconds to a string delimited by time values. Will show w,d,h,m,s<br>
 
*@param string $seconds
 
*@param string $seconds
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==getaddon==
 
==getaddon==
Parameters: $addonname<br/>
+
Parameters: $addonname<br>
Sets up addon data for use in the addon framework<br/>
+
Sets up addon data for use in the addon framework<br>
 
*@param string $addonname | The name of the addon
 
*@param string $addonname | The name of the addon
 
*@return array $addon  | The addon's database record
 
*@return array $addon  | The addon's database record
 
*@global array $addon_conf | The addon's config data is added to this global array.
 
*@global array $addon_conf | The addon's config data is added to this global array.
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==active_addon==
 
==active_addon==
Parameters: $name<br/>
+
Parameters: $name<br>
Check to see if an addon is active or not<br/>
+
Check to see if an addon is active or not<br>
 
*@param string $name | Addon basename
 
*@param string $name | Addon basename
 
*@return bool
 
*@return bool
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==urlgrabber==
 
==urlgrabber==
Parameters: $url, $timeout, $user_agent, $loopcount<br/>
+
Parameters: $url, $timeout, $user_agent, $loopcount<br>
Handles retrieving the contents of a URL trying multiple methods. Current methods are curl, file_get_contents, fsockopen and will try each in that order<br/>
+
Handles retrieving the contents of a URL trying multiple methods. Current methods are curl, file_get_contents, fsockopen and will try each in that order<br>
 
*@param string $url | URL to retrieve
 
*@param string $url | URL to retrieve
 
*@param int $timeout | Timeout for curl, socket connection timeout for fsock (default 5)
 
*@param int $timeout | Timeout for curl, socket connection timeout for fsock (default 5)
Line 230: Line 228:
 
*@param int $loopcount | (default 0)
 
*@param int $loopcount | (default 0)
 
*@return mixed | False on error, contents on success  
 
*@return mixed | False on error, contents on success  
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==request_uri==
 
==request_uri==
Parameters: none<br/>
+
Parameters: none<br>
Stupid function to create an REQUEST_URI for IIS 5 servers<br/>
+
Stupid function to create an REQUEST_URI for IIS 5 servers<br>
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==file_writer==
 
==file_writer==
Parameters: $filename, &$content, $mode<br/>
+
Parameters: $filename, &$content, $mode<br>
Attempts to write a file to the file system<br/>
+
Attempts to write a file to the file system<br>
 
*@param string $filename | Name of the file
 
*@param string $filename | Name of the file
 
*@param string $content | Content of the file
 
*@param string $content | Content of the file
 
*@param string $mode | (default wb)
 
*@param string $mode | (default wb)
 
*@return bool
 
*@return bool
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==php_as_nobody==
 
==php_as_nobody==
Parameters: $file<br/>
+
Parameters: $file<br>
No Description<br/>
+
No Description<br>
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==_aprint==
 
==_aprint==
Parameters: $arr, $tab<br/>
+
Parameters: $arr, $tab<br>
Debugging function dumps arrays/object formatted. Do Not call this, call [[#aprint|aprint()]]<br/>
+
Debugging function dumps arrays/object formatted. Do Not call this, call [[#aprint|aprint()]]<br>
 
*@param array $arr
 
*@param array $arr
 
*@param int $tab | (default 1)
 
*@param int $tab | (default 1)
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==aprint==
 
==aprint==
Parameters: $arr, $prefix, $return<br/>
+
Parameters: $arr, $prefix, $return<br>
Debugging function dumps arrays/object formatted<br/>
+
Debugging function dumps arrays/object formatted<br>
 
*@param array $arr
 
*@param array $arr
 
*@param string $prefix  
 
*@param string $prefix  
 
*@return string | (default false)
 
*@return string | (default false)
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==socketColorEn==
 
==socketColorEn==
Parameters: $socket_color, $locale<br/>
+
Parameters: $socket_color, $locale<br>
Helper function that returns the localized gem color in english<br/>
+
Helper function that returns the localized gem color in english<br>
 
*@param string $socket_color
 
*@param string $socket_color
 
*@return string $color
 
*@return string $color
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==format_microtime==
 
==format_microtime==
Parameters: none<br/>
+
Parameters: none<br>
No Description<br/>
+
No Description<br>
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==array_overlay==
 
==array_overlay==
Parameters: $skel, $arr<br/>
+
Parameters: $skel, $arr<br>
A better array_merge()<br/>
+
A better array_merge()<br>
 
*@param array $skel
 
*@param array $skel
 
*@param array $arr
 
*@param array $arr
 
*@return array
 
*@return array
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==updateCheck==
 
==updateCheck==
Parameters: $addon<br/>
+
Parameters: $addon<br>
Checks an addon download id on the wowroster.net rss feed. And informs if there is an update.<br/>
+
Checks an addon download id on the wowroster.net rss feed. And informs if there is an update.<br>
 
*@param string $name | name of the download
 
*@param string $name | name of the download
 
*@param string $url | url
 
*@param string $url | url
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==dummy==
 
==dummy==
Parameters: none<br/>
+
Parameters: none<br>
Dummy function. For when you need a callback that doesn't do anything.<br/>
+
Dummy function. For when you need a callback that doesn't do anything.<br>
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==makelink==
 
==makelink==
Parameters: $url, $full<br/>
+
Parameters: $url, $full<br>
Function to create links in Roster. ALL LINKS SHOULD PASS THROUGH THIS FUNCTION. Hopefully this function will be the magic that makes porting Roster easier (Ninja looted from DragonFly, thanks you guys!).<br/>
+
Function to create links in Roster. ALL LINKS SHOULD PASS THROUGH THIS FUNCTION. Hopefully this function will be the magic that makes porting Roster easier (Ninja looted from DragonFly, thanks you guys!).<br>
 
*@param string $url | (Example: <nowiki>'</nowiki>util-news-comment&amp;id=<nowiki>'</nowiki>.$news_id)
 
*@param string $url | (Example: <nowiki>'</nowiki>util-news-comment&amp;id=<nowiki>'</nowiki>.$news_id)
 
*@param bool $full | (default false)
 
*@param bool $full | (default false)
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
=$roster->db=
 
=$roster->db=
Line 312: Line 310:
  
 
==error==
 
==error==
Parameters: none<br/>
+
Parameters: none<br>
Get last SQL error<br/>
+
Get last SQL error<br>
 
*@return string last SQL error
 
*@return string last SQL error
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==errno==
 
==errno==
Parameters:none<br/>
+
Parameters:none<br>
Get last SQL errno<br/>
+
Get last SQL errno<br>
 
*@return string last SQL errno
 
*@return string last SQL errno
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==query==
 
==query==
Parameters: $query<br/>
+
Parameters: $query<br>
Basic query function<br/>
+
Basic query function<br>
 
*@param $query Query string
 
*@param $query Query string
 
*@return mixed Query ID / Error string / Bool
 
*@return mixed Query ID / Error string / Bool
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==query_first==
 
==query_first==
 
Parameters: $query<br />
 
Parameters: $query<br />
Return the first record (single column) in a query result<br/>
+
Return the first record (single column) in a query result<br>
 
*@param $query Query string
 
*@param $query Query string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==build_query==
 
==build_query==
Parameters: $query, $array<br/>
+
Parameters: $query, $array<br>
Build query<br/>
+
Build query<br>
 
*@param $query
 
*@param $query
 
*@param $array Array of field => value pairs (default false)
 
*@param $array Array of field => value pairs (default false)
 
*@return $query | Returns the builded query
 
*@return $query | Returns the builded query
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==fetch==
 
==fetch==
Parameters: $query_id, $result_type<br/>
+
Parameters: $query_id, $result_type<br>
Fetch one record<br/>
+
Fetch one record<br>
 
*@param $query_id | Query ID (default 0)
 
*@param $query_id | Query ID (default 0)
 
*@param $result_type | SQL_ASSOC, SQL_NUM, or SQL_BOTH (default SQL_BOTH)
 
*@param $result_type | SQL_ASSOC, SQL_NUM, or SQL_BOTH (default SQL_BOTH)
 
*@return mixed Record / false
 
*@return mixed Record / false
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==fetch_all==
 
==fetch_all==
Parameters: $query_id, $result_type<br/>
+
Parameters: $query_id, $result_type<br>
Fetch all records<br/>
+
Fetch all records<br>
 
*@param $query_id | Query ID (default 0)
 
*@param $query_id | Query ID (default 0)
 
*@param $result_type | SQL_ASSOC, SQL_NUM, or SQL_BOTH
 
*@param $result_type | SQL_ASSOC, SQL_NUM, or SQL_BOTH
 
*@return mixed Record Set / false
 
*@return mixed Record Set / false
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==result==
 
==result==
Parameters: $query_id, $row, $field<br/>
+
Parameters: $query_id, $row, $field<br>
Get result data<br/>
+
Get result data<br>
 
*@param $query_id | Query ID (default 0)
 
*@param $query_id | Query ID (default 0)
 
*@param $row | The row number from the result that's being retrieved. Row numbers start at 0
 
*@param $row | The row number from the result that's being retrieved. Row numbers start at 0
 
*@param $field | The name or offset of the field being retrieved
 
*@param $field | The name or offset of the field being retrieved
 
*@return mixed Record / false
 
*@return mixed Record / false
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==num_rows==
 
==num_rows==
Parameters: $query_id<br/>
+
Parameters: $query_id<br>
Find the number of returned rows<br/>
+
Find the number of returned rows<br>
 
*@param $query_id | Query ID (default 0)
 
*@param $query_id | Query ID (default 0)
 
*@return mixed Number of rows / false
 
*@return mixed Number of rows / false
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==affected_rows==
 
==affected_rows==
Parameters: $query_id<br/>
+
Parameters: $query_id<br>
Finds out the number of rows affected by a query<br/>
+
Finds out the number of rows affected by a query<br>
 
*@param $query_id | Query ID (default 0)
 
*@param $query_id | Query ID (default 0)
 
*@return mixed Affected Rows / false
 
*@return mixed Affected Rows / false
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==insert_id==
 
==insert_id==
Parameters: none<br/>
+
Parameters: none<br>
Find the ID of the row that was just inserted<br/>
+
Find the ID of the row that was just inserted<br>
 
*@return mixed Last ID / false
 
*@return mixed Last ID / false
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==free_result==
 
==free_result==
Parameters: $query_id<br/>
+
Parameters: $query_id<br>
Free result data<br/>
+
Free result data<br>
 
*@param $query_id | Query ID (default 0)
 
*@param $query_id | Query ID (default 0)
 
*@return bool
 
*@return bool
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==escape==
 
==escape==
Parameters: $string<br/>
+
Parameters: $string<br>
Remove quote escape<br/>
+
Remove quote escape<br>
 
*@param $string
 
*@param $string
 
*@return string
 
*@return string
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==error_die==
 
==error_die==
Parameters: $setting<br/>
+
Parameters: $setting<br>
Set the error_die var<br/>
+
Set the error_die var<br>
@param $setting<br/>
+
@param $setting<br>
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
  
 
==table==
 
==table==
Parameters: $table, $addon<br/>
+
Parameters: $table, $addon<br>
Expand base table name to a full table name<br/>
+
Expand base table name to a full table name<br>
 
*@param string $table | the base table name
 
*@param string $table | the base table name
 
*@param string $addon | the name of the addon, empty for a base roster table
 
*@param string $addon | the name of the addon, empty for a base roster table
 
*@return string | tablename as fit for MySQL queries
 
*@return string | tablename as fit for MySQL queries
<br/>[[#Global functions|Top]]
+
<br>[[#Global functions|Top]]
 +
 
 +
==close_db==
 +
<br>[[#Global functions|Top]]
 +
 
 +
 
 +
=$roster->auth=
 +
Login and authorization<br>
 +
<br>[[#Global functions|Top]]
 +
 
 +
==getAuthorized==
 +
Parameters: $access<br>
 +
Check if $access is allowed<br>
 +
*@$access | guild / office / admin
 +
*@return
 +
<br>[[#Global functions|Top]]
 +
 
 +
==getMessage==
 +
Parameters: none<br>
 +
Return the latest message from class<br>
 +
<br>[[#Global functions|Top]]
 +
 
 +
==getLoginForm==
 +
Parameters: $level<br>
 +
Check if login is allowed and return login form, else return message<br>
 +
*@$level | The RosterLogin level (1 = guild, 2 = office, 3 = admin)
 +
*@return | If login allowed login form else message
 +
<br>[[#Global functions|Top]]
 +
 
 +
==getMenuLoginForm==
 +
Parameters: none<br>
 +
Check if login allowed return login form, else message<br>
 +
<br>[[#Global functions|Top]]

Latest revision as of 04:09, 23 May 2012

WR.net

Important note: When you edit this page, you agree to release your contribution into the public domain.
If you do not want this or can not do this because of license restrictions, please do not edit.

Contents


Functions Overview
Overview over all functions in the Roster that can be used by Addon Developers.

See also the new Roster API for additional information.


Global functions

These function are located in functions.lib.php

border

Parameters: $style, $mode, $header_txt, $width
Starts or ends fancy bodering containers


Top

setTooltip

Parameters: $var, $content
Makes a tootip and places it into the tooltip array


Top

getAllTooltips

Parameters: none
Gathers all tootips and places them into javascript variables


Top

sql_highlight

Parameters: $sql
Highlight certain keywords in a SQL query


Top

die_quietly

Parameters: $text, $title, $file, $line, $sql
Clean replacement for die(), outputs a message with debugging info if needed and ends output


Top

roster_die

Parameters: $message, $title, $style
Draw a message box with the specified border color, then die cleanly


Top

ajax_die

Parameters: $text, $title, $file, $line, $sql
Print a roster-ajax XML error message

Top

backtrace

Parameters: none
Print a debug backtrace. This works in PHP4.3.x+, there is an integrated function for this starting PHP5 but I prefer always having the same layout.

Top

stripAllHtml

Parameters: $string
This will remove HTML tags, javascript sections and white space. It will also convert some common HTML entities to their text equivalent


Top

check_if_image

Parameters: $filename
This will check if the given Filename is an image


Top

colorTooltip

Parameters: $tooltip, $caption_color, $locale, $inline_caption
Tooltip colorizer function with string cleaning. Use only with #makeOverlib


Top

cleanTooltip

Parameters: $tooltip, $caption_color, $inline_caption
Cleans up the tooltip and parses an inline_caption if needed. Use only with #makeOverlib


Top

makeOverlib

Parameters: $tooltip, $caption, $caption_color, $mode, $locale, $extra_parameters
Easy all in one function to make overlib tooltips. Creates a string for insertion into any html tag that has "onmouseover" and "onmouseout" events


Top

messagebox

Parameters: $message, $title, $style, $width
Draw a message box with the specified border color.


Top

scrollbox

Parameters: $message, $title, $style, $width, $height
Draw a 300x550px scrolling messagebox with the specified border color.


Top

messageboxtoggle

Parameters: $message, $title, $style, $open, $width
Draw a message box with the specified border color.


Top

scrollboxtoggle

Parameters: $message, $title, $style, $open, $width, $height
Draw a 300x550px scrolling messagebox with the specified border color.


Top

escape_array

Parameters: $array
Recursively escape $array


Top

stripslash_array

Parameters: $array
Recursively stripslash $array


Top

readbleDate

Parameters: $datetime, $offset
Converts a datetime field into a readable date


Top

get_file_ext

Parameters: $filename
Gets a file's extention passed as a string


Top

seconds_to_time

Parameters: $seconds
Converts seconds to a string delimited by time values. Will show w,d,h,m,s


Top

getaddon

Parameters: $addonname
Sets up addon data for use in the addon framework


Top

active_addon

Parameters: $name
Check to see if an addon is active or not


Top

urlgrabber

Parameters: $url, $timeout, $user_agent, $loopcount
Handles retrieving the contents of a URL trying multiple methods. Current methods are curl, file_get_contents, fsockopen and will try each in that order


Top

request_uri

Parameters: none
Stupid function to create an REQUEST_URI for IIS 5 servers


Top

file_writer

Parameters: $filename, &$content, $mode
Attempts to write a file to the file system


Top

php_as_nobody

Parameters: $file
No Description

Top

_aprint

Parameters: $arr, $tab
Debugging function dumps arrays/object formatted. Do Not call this, call aprint()


Top

aprint

Parameters: $arr, $prefix, $return
Debugging function dumps arrays/object formatted


Top

socketColorEn

Parameters: $socket_color, $locale
Helper function that returns the localized gem color in english


Top

format_microtime

Parameters: none
No Description

Top

array_overlay

Parameters: $skel, $arr
A better array_merge()


Top

updateCheck

Parameters: $addon
Checks an addon download id on the wowroster.net rss feed. And informs if there is an update.


Top

dummy

Parameters: none
Dummy function. For when you need a callback that doesn't do anything.

Top

makelink

Parameters: $url, $full
Function to create links in Roster. ALL LINKS SHOULD PASS THROUGH THIS FUNCTION. Hopefully this function will be the magic that makes porting Roster easier (Ninja looted from DragonFly, thanks you guys!).


Top

$roster->db

The following functions can be used to operate on database

error

Parameters: none
Get last SQL error


Top

errno

Parameters:none
Get last SQL errno


Top

query

Parameters: $query
Basic query function


Top

query_first

Parameters: $query
Return the first record (single column) in a query result


Top

build_query

Parameters: $query, $array
Build query


Top

fetch

Parameters: $query_id, $result_type
Fetch one record


Top

fetch_all

Parameters: $query_id, $result_type
Fetch all records


Top

result

Parameters: $query_id, $row, $field
Get result data


Top

num_rows

Parameters: $query_id
Find the number of returned rows


Top

affected_rows

Parameters: $query_id
Finds out the number of rows affected by a query


Top

insert_id

Parameters: none
Find the ID of the row that was just inserted


Top

free_result

Parameters: $query_id
Free result data


Top

escape

Parameters: $string
Remove quote escape


Top

error_die

Parameters: $setting
Set the error_die var
@param $setting

Top

table

Parameters: $table, $addon
Expand base table name to a full table name


Top

close_db


Top


$roster->auth

Login and authorization

Top

getAuthorized

Parameters: $access
Check if $access is allowed


Top

getMessage

Parameters: none
Return the latest message from class

Top

getLoginForm

Parameters: $level
Check if login is allowed and return login form, else return message


Top

getMenuLoginForm

Parameters: none
Check if login allowed return login form, else message

Top

Personal tools
Namespaces
Variants
Actions
WoWRoster
Preview Roster
Navigation
Toolbox