Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // WBB Connect 1.4.1 include by Hauke Marquardt alias |-|auke - 08.05.2012
- /*
- License:
- This code is free: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This code is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- You´re not allowed to copy any code from this, into your code without
- naming authors name in credits!
- */
- #if !defined _h_library_norm_included
- #define PAWN_TYPE_INT 1
- #define PAWN_TYPE_FLOAT 2
- #define PAWN_TYPE_ARRAY 3
- #define _h_library_norm_included
- #endif
- #define WBB_USER_POSTS 0x0008
- #define WBB_USER_LAST_VISIT 0x0016
- #define WBB_USER_ACTIVATIO_CODE 0x0032
- #define WBB_USER_ACTIVITY_POINTS 0x0064
- #define WBB_USER_PROFILE_HITS 0x0128
- #define WBB_USER_UNREAD_PM 0x0256
- /* Initializes connection. Must be called first!
- * param: string MySQL Server IP
- * string MySQL User
- * string MySQL Password
- * string MySQL Database
- * [optional] int Installation count of WCF.
- *
- * return: bool true if connected successfully
- * bool false if connection failed
- */
- stock WBB_SetMySQLData ( Server[ ] , User[ ] , Password[ ] , Database[ ] , InstallationCount = 1 )
- return CallRemoteFunction ( "_WBB_SetMySQLData" , "ssssd" , Server , User , Password , Database , InstallationCount );
- /* Checks if username exists
- * param: string Username
- *
- * return: bool true if user exists
- * bool false if don´t exists
- */
- stock WBB_IsValidUser ( wbbUsername[ ] )
- return CallRemoteFunction ( "_WBB_IsValidUser" , "s" , wbbUsername );
- /* Checks if password is equal to account password
- * param: string Username
- * string Password
- *
- * return: bool true if password is correct
- * bool false if password is incorrect
- */
- stock WBB_CheckPassword ( wbbUsername[ ] , Password[ ] )
- return CallRemoteFunction ( "_WBB_CheckPassword" , "ss" , wbbUsername , Password );
- /* Creates a new user
- * param: string Username
- * string Password
- * string Email-Adress
- * [optional] int Activation state. 1 = Activated
- *
- * return: int -1 if mail-adress exists already
- * int 0 if username already exists
- * int 1 if user was created successfully
- */
- stock WBB_AddNewUser ( Username[ ] , Password[ ] , Email[ ] , ActivationState = 1 )
- return CallRemoteFunction ( "_WBB_AddNewUser" , "sssi" , Username , Password , Email , ActivationState );
- /* Sets user to activated
- * param: string Username
- *
- * return: int -1 if user is already activated
- * int 0 if user don´t exists
- * int 1 if user was activated
- */
- stock WBB_ActivateUser ( Username[ ] )
- return CallRemoteFunction ( "_WBB_ActivateUser" , "s" , Username );
- /* Sets user to banned
- * param: string Username
- * string Reason
- *
- * return: bool true if user was banned successfully
- * bool false if user don´t exists
- */
- stock WBB_BanUser ( Username[ ] , Reason[ ] )
- return CallRemoteFunction ( "_WBB_BanUser" , "ss" , Username , Reason );
- /* Reset ban of user
- * param: string Username
- *
- * return: bool true if user was unbanned successfully
- * bool false if user don´t exists
- */
- stock WBB_UnBanUser ( Username[ ] )
- return CallRemoteFunction ( "_WBB_UnBanUser" , "s" , Username );
- /* Send private message from user to user
- * param: string Username
- * string Recipient name
- * string Message subject
- * string Message
- *
- * return: int -1 if user don´t exists
- * int 0 is resipient do not exists
- * int 1 if message was sendet
- */
- stock WBB_NewPrivateMessage ( Username[ ] , RecipientName[ ] , Subject[ ] , Message[ ] )
- return CallRemoteFunction ( "_WBB_NewPrivateMessage" , "ssss" , Username , RecipientName , Subject , Message );
- /* Checks user activation state
- * param: string Username
- *
- * return: bool true if user is activated
- * bool false isn´t activated
- */
- stock WBB_GetUserActivationState ( Username[ ] )
- return CallRemoteFunction ( "_WBB_GetUserActivationState" , "s" , Username );
- /* Sets new password for user
- * param: string Username
- * string Password
- *
- * return: bool true if password changed
- * bool false if user don´t exists
- */
- stock WBB_SetUserPassword ( Username[ ] , Password[ ] )
- return CallRemoteFunction ( "_WBB_SetUserPassword" , "ss" , Username , Password );
- /* Sets a new profile field value like birthday or location
- * param: string Username
- * string Fieldname (e.g.hobbies)
- * string New value of field
- * int type of Value
- *
- * return: int 1 if option changed
- * int 0 if field dont exists
- * int -1 if user dont exists
- */
- stock WBB_SetProfileField ( Username[ ] , Field[ ] , Value[ ] , Type = PAWN_TYPE_INT )
- return CallRemoteFunction ( "_WBB_SetProfileField" , "sssd" , Username , Field , Value , Type );
- /* Gets profile info field of user
- * param: string Username
- * string Fieldname
- *
- * return: int value of field
- * int 0 if field dont exists
- * int -1 if user dont exists
- */
- stock WBB_GetProfileField ( Username[ ] , Field[ ] )
- return CallRemoteFunction ( "_WBB_GetProfileField" , "ss" , Username , Field );
- /* Sends a mail with activationcode to user
- * param: string Username
- * string Name of sender. E.g. XYZ Reallife
- * string Name of domain. E.g. xyz-reallife.net. Without www!!
- * string WBB forum index.php link. E.g. www.xyz-reallife.net/forum/index.php. Witout http and _GET variables!
- *
- * return: bool true if mail was sended successfully
- * bool false if user dont exists
- */
- stock WBB_SendUserActivationMail ( Username[ ] , Sendername[ ] , Servername[ ] , ForumIndexURL[ ] )
- return CallRemoteFunction ( "_WBB_SendUserActivationMail" , "ssss" , Username , Sendername , Servername , ForumIndexURL );
- /* Adds a new post to thread
- * param: int Thread ID where the post should be added
- * string Subject of post
- * string Message
- * string Username
- * int 1 if html should be enabled
- * int 1 if bb codes should be enabled
- *
- * return: bool true if post was saved successfully
- * bool false if user dont exists
- */
- stock WBB_AddPost ( Thread , Subject[ ] , Message[ ] , Username[ ] , BBCodes = 0 , HTML = 0 )
- return CallRemoteFunction ( "_WBB_AddPost" , "dsssdd" , Thread , Subject , Message , Username , BBCodes , HTML );
- /* Checks if user is in a specific group
- * param: string Username
- * int ID of Group
- *
- * return: int 1 if is in group
- * int 0 if user is not in group
- * int -1 if user dont exists
- */
- stock WBB_IsUserInGroup ( Username[ ] , GroupID )
- return CallRemoteFunction ( "WBB_IsUserInGroup" , "sd" , Username , GroupID );
- /* Adds a user to a group
- * param: string Username
- * int ID of Group
- *
- * return: bool true if user was settet to group successfully
- * bool false if user dont exists
- */
- stock WBB_SetUserToGroup ( Username[ ] , GroupID )
- return CallRemoteFunction ( "_WBB_SetUserToGroup" , "sd" , Username , GroupID );
- /* Removes a user from a group
- * param: string Username
- * int ID of Group
- *
- * return: int 1 if user was removed from group
- * int 0 if user was not removed
- * int -1 if user dont exists
- * int -2 if user is not in group
- */
- stock WBB_RemoveUserFromGroup ( Username[ ] , GroupID )
- return CallRemoteFunction ( "_WBB_RemoveUserFromGroup" , "sd" , Username , GroupID );
- /* Changes users email adress
- * param: string Username
- * string New email adress
- *
- * return: bool true if mail adress changed
- * bool 0 if user is invalid
- */
- stock WBB_UpdateUserMail ( Username[ ] , Mail[ ] )
- return CallRemoteFunction ( "_WBB_UpdateUserMail" , "ss" , Username , Mail );
- /* Reads out user statistics
- * param: string Username
- * int Data
- *
- * return: int value
- * bool false if data or user is invalid
- */
- stock WBB_GetUserStats ( Username[ ] , Data )
- return CallRemoteFunction ( "_WBB_GetUserStats" , "sd" , Username , Data );
- /* Creates a new thread with first post in specific board Unstable! Not testet much!
- * param: int Board ID where thread should be stored in
- * string Topic (Thread headline)
- * string Username of writer
- * int 1 to disable thread. 0 to enable thread
- * int 1 to close thread. 0 to open thread
- * string Post subject (Headline)
- * string Post message
- * int 1 to enable bb codes. 0 to disable
- * int 1 to enable html. 0 to disable
- *
- * return: bool true if thread was successfull created
- * bool false if data or user is invalid
- */
- stock WBB_CreateThread ( Board , Topic[ ] , Username[ ] , Disabled , Closed , Subject[ ] , Message[ ] , BBCodes , HTML )
- return CallRemoteFunction ( "_WBB_CreateThread" , "dssddssdd" , Board , Topic , Username , Disabled , Closed , Subject , Message , BBCodes , HTML );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement