Roster:FunctionsOverview

From WoWRosterWiKi
(Difference between revisions)
Jump to: navigation, search
(Added section $roster->auth)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOEDITSECTION__
 
__NOEDITSECTION__
{{Disclaimer}}
+
{{Disclaimer|NoLang}}
 
{{MainMenu|Roster}}
 
{{MainMenu|Roster}}
  
 
'''Functions 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
+
*Nefuh | 07.02.2008 23:52 | Added section [[#$roster->auth|$roster->auth]]
+
----
+
 
<br />
 
<br />
 
__TOC__
 
__TOC__
Line 418: Line 415:
 
<br>[[#Global functions|Top]]
 
<br>[[#Global functions|Top]]
  
=$roster->auth=
+
==close_db==
Login and authorization<br>
+
 
<br>[[#Global functions|Top]]
 
<br>[[#Global functions|Top]]
  
==RosterLogin==
 
Parameters: $script_filename<br>
 
Constructor for Roster Login class<br>
 
Accepts an action for the form<br>
 
And an array of additional fields<br>
 
*@param $script_filename
 
*@return RosterLogin
 
<br>[[#Global functions|Top]]
 
  
==checkPass==
+
=$roster->auth=
Parameters: $pass<br>
+
Login and authorization<br>
Check $pass if password match and could be verified.<br>
+
*@$pass | Password to verify
+
*@return | Nothing
+
 
<br>[[#Global functions|Top]]
 
<br>[[#Global functions|Top]]
  
Line 460: Line 445:
 
Parameters: none<br>
 
Parameters: none<br>
 
Check if login allowed return login form, else message<br>
 
Check if login allowed return login form, else message<br>
<br>[[#Global functions|Top]]
 
 
==setAction==
 
Parameters: $action<br>
 
Generate action value for forms<br>
 
*@$action | Action value for forms (without URL)
 
*@return | Action value processed by makelink (with URL)
 
<br>[[#Global functions|Top]]
 
 
==rosterAccess==
 
Parameters: $values<br>
 
Generate input field for settings access level<br>
 
*@$values['name'] | Name of the config_value
 
*@return | Returns a <select name=“config_$value['name']“></select> Field with all possible access levels
 
 
<br>[[#Global functions|Top]]
 
<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
Navigation
Toolbox