Resource:Woltlab-Connector: Difference between revisions
Xthepr0mise (talk | contribs) m (moved Woltlab-Connector to Resource:Woltlab-Connector) |
Xthepr0mise (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Resource page}} | {{Resource page}} | ||
'''Current Version: 1.1. | '''Current Version: 1.1.2''' | ||
This is a library, created by xthepr0mise, which allows you to connect to your forum software easily. | This is a library, created by xthepr0mise, which allows you to connect to your forum software easily. | ||
Line 176: | Line 176: | ||
==Returns== | ==Returns== | ||
Returns '''true''' if the user got created or '''false''' | Returns '''true''' if the user got created or '''false''' | ||
<syntaxhighlight lang="lua"> | |||
-- TODO | |||
</syntaxhighlight> | |||
</section> | |||
===woltlab_groupExists=== | |||
<section name="Server" class="server" show="true"> | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool woltlab_groupExists ( ID ) | |||
</syntaxhighlight> | |||
==Required Arguments== | |||
*'''ID''': The ID of the group | |||
==Returns== | |||
Returns '''true''' if the group exists or '''false''' | |||
<syntaxhighlight lang="lua"> | |||
-- TODO | |||
</syntaxhighlight> | |||
</section> | |||
===woltlab_isUserInGroup=== | |||
<section name="Server" class="server" show="true"> | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool woltlab_isUserInGroup ( username, ID ) | |||
</syntaxhighlight> | |||
==Required Arguments== | |||
*'''username''': The username of the player you want to check | |||
*'''ID''': The ID of the group | |||
==Returns== | |||
Returns '''true''' if he is in the group or '''false''' | |||
<syntaxhighlight lang="lua"> | |||
-- TODO | |||
</syntaxhighlight> | |||
</section> | |||
===woltlab_getGroupID=== | |||
<section name="Server" class="server" show="true"> | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool woltlab_getGroupID ( title ) | |||
</syntaxhighlight> | |||
==Required Arguments== | |||
*'''title''': The title of the group | |||
==Returns== | |||
Returns '''int ID''' of the group or '''false''' | |||
<syntaxhighlight lang="lua"> | |||
-- TODO | |||
</syntaxhighlight> | |||
</section> | |||
===woltlab_getGroupTitle=== | |||
<section name="Server" class="server" show="true"> | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool woltlab_getGroupTitle ( ID ) | |||
</syntaxhighlight> | |||
==Required Arguments== | |||
*'''ID''': The ID of the group | |||
==Returns== | |||
Returns '''string title''' of the group or '''false''' | |||
<syntaxhighlight lang="lua"> | |||
-- TODO | |||
</syntaxhighlight> | |||
</section> | |||
===woltlab_addUserToGroup=== | |||
<section name="Server" class="server" show="true"> | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool woltlab_addUserToGroup ( username, groupID ) | |||
</syntaxhighlight> | |||
==Required Arguments== | |||
*'''username''': The username of the player | |||
*'''groupID''': The ID of the group | |||
==Returns== | |||
Returns '''true''' if he got added or '''false''' | |||
<syntaxhighlight lang="lua"> | |||
-- TODO | |||
</syntaxhighlight> | |||
</section> | |||
===woltlab_removeUserFromGroup=== | |||
<section name="Server" class="server" show="true"> | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool woltlab_removeUserFromGroup ( username, groupID ) | |||
</syntaxhighlight> | |||
==Required Arguments== | |||
*'''username''': The username of the player | |||
*'''groupID''': The ID of the group | |||
==Returns== | |||
Returns '''true''' if he got removed or '''false''' | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- TODO | -- TODO |
Revision as of 19:12, 4 October 2012
Current Version: 1.1.2
This is a library, created by xthepr0mise, which allows you to connect to your forum software easily. It uses the MySQL-Plugin to connect to the database and includes a full log which documents nearly every (woltlab_)function called by the user.
Functions
woltlab_connect
Syntax
bool woltlab_connect ( dbHost, dbUsername, dbPasswort, dbName )
Required Arguments
- dbHost: The IP-Address of the database
- dbUsername: The username of the database
- dbPasswort: The password of the database
- dbName: The name of the database
Returns
Returns true if it connected successfully else false
-- TODO
woltlab_disconnect
Syntax
bool woltlab_disconnect ( )
Required Arguments
- None
Returns
Returns true if it disconnected successfully else false
-- TODO
woltlab_checkPassword
Syntax
bool woltlab_checkPassword ( username, password )
Required Arguments
- username: The username of the player you want to check
- password: The password he entered (encrypted)
Returns
Returns true if the password is right else false
-- TODO
woltlab_getUserID
Syntax
int woltlab_getUserID ( username )
Required Arguments
- username: The username of the player whose ID you want to get
Returns
Returns int ID or false if the user does not exist
-- TODO
woltlab_getBoardID
Syntax
int woltlab_getBoardID ( title )
Required Arguments
- title: The title of the board whose ID you want to get
Returns
Returns int ID or false if the board does not exist
-- TODO
woltlab_getBoardTitle
Syntax
string woltlab_getBoardTitle ( id )
Required Arguments
- id: The ID of the board whose title you want to get
Returns
Returns string title or false if the board does not exist
-- TODO
woltlab_addThread
Syntax
bool woltlab_addThread ( username, boardID, prefix, head, description, [registered] )
Required Arguments
- username: The username of the player which creates the thread
- boardID: The ID of the board in which the thread should be created
- prefix: The prefix of the thread
- head: The title of the thread
- description: The content of the thread
Optional Arguments
- registered: A bool whether the user is registered in the forum or not
Returns
Returns true if the thread got created or false
-- TODO
woltlab_userExists
Syntax
bool woltlab_userExists ( username )
Required Arguments
- username: The username of the player you want to check
Returns
Returns true or false
-- TODO
woltlab_addUser
Syntax
bool woltlab_addUser ( username, email, password )
Required Arguments
- username: The username of the player you want to add
- email: His e-mail address
- password: His password (encrypted)
Returns
Returns true if the user got created or false
-- TODO
woltlab_groupExists
Syntax
bool woltlab_groupExists ( ID )
Required Arguments
- ID: The ID of the group
Returns
Returns true if the group exists or false
-- TODO
woltlab_isUserInGroup
Syntax
bool woltlab_isUserInGroup ( username, ID )
Required Arguments
- username: The username of the player you want to check
- ID: The ID of the group
Returns
Returns true if he is in the group or false
-- TODO
woltlab_getGroupID
Syntax
bool woltlab_getGroupID ( title )
Required Arguments
- title: The title of the group
Returns
Returns int ID of the group or false
-- TODO
woltlab_getGroupTitle
Syntax
bool woltlab_getGroupTitle ( ID )
Required Arguments
- ID: The ID of the group
Returns
Returns string title of the group or false
-- TODO
woltlab_addUserToGroup
Syntax
bool woltlab_addUserToGroup ( username, groupID )
Required Arguments
- username: The username of the player
- groupID: The ID of the group
Returns
Returns true if he got added or false
-- TODO
woltlab_removeUserFromGroup
Syntax
bool woltlab_removeUserFromGroup ( username, groupID )
Required Arguments
- username: The username of the player
- groupID: The ID of the group
Returns
Returns true if he got removed or false
-- TODO
Usage
Option 1
exports.woltlab:FUNCTION ( PARAMETERS )
Option 2
exports:['woltlab']:FUNCTION ( PARAMETERS )
Examples
Simple password-checking
exports.woltlab:woltlab_connect ( "127.0.0.1", "root", "", "wcf" ) local login = exports.woltlab:woltlab_checkPassword ( "xthepr0mise", "test" ) if login == true then outputChatBox("Your password is right!") else outputChatBox("Your password is wrong!") end exports.woltlab:woltlab_disconnect()
Known Bugs
- none