Roster:FunctionsOverview

From WoWRosterWiKi
(Difference between revisions)
Jump to: navigation, search
m (added link to new roster api and removed last changes text on the site.)
Line 6: Line 6:
 
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>
  
See also the new [[Roster:API|Roster API]] for additional informations.
+
See also the new [[Roster:API|Roster API]] for additional information.
 
<br />
 
<br />
 
__TOC__
 
__TOC__

Revision as of 04:06, 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