vB_Library_Facebook
extends vB_Library
in package
vB_Library_Facebook
Tags
Table of Contents
Constants
- FBVERSION = 'v15.0'
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- clearCache() : mixed
- clearSession() : void
- Clear all stored information for the current user from vB This will not log the user out of either vB or Facebook (but is is expected that this will be called as part of logging the user out of the vBulletin)
- connectCurrentUser() : void
- Connects the currently logged in user to the currently logged in Facebook user
- createSessionForLogin() : mixed
- Associate a vb account with a facebook sesssion
- disconnectUser() : void
- Disconnect the user's account from facebook
- getContentInstance() : mixed
- getFbProfilePicUrl() : string|false
- Get the logged in user's profile picture url.
- getFbProfileUrl() : string|false
- Get the logged in user's profile url.
- getFbUserInfo() : array<string|int, mixed>
- Grabs logged in user info from faceboook if user is logged in
- getInitializeFailureMessage() : string
- Get the reason why facebook failed to initialize
- getLoggedInFbUserId() : mixed
- Checks for a currrently logged in user through facebook api
- getVbUseridFromFbUserid() : mixed
- Checks if current facebook user is associated with a vb user, and returns vb userid if so
- instance() : static
- Returns singleton instance of self.
- isFacebookEnabled() : bool
- Is facebook enabled on this site.
- isValidAuthToken() : bool
- Verifies that the current session auth token is still valid with facebook - performs a Facebook roundtrip
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
- reinitialize() : bool
- Reintialize the facebook application
- userIsLoggedIn() : bool
- Checks if the current user is logged into facebook
Constants
FBVERSION
public
mixed
FBVERSION
= 'v15.0'
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
clearCache()
public
static clearCache() : mixed
clearSession()
Clear all stored information for the current user from vB This will not log the user out of either vB or Facebook (but is is expected that this will be called as part of logging the user out of the vBulletin)
public
clearSession() : void
Will do nothing if facebook is not initialized.
connectCurrentUser()
Connects the currently logged in user to the currently logged in Facebook user
public
connectCurrentUser([mixed $accessToken = null ]) : void
Note that we don't allow connection of a non logged in account because we need to validate the FB login. Connecting somebody else's account to a FB just doesn't make sense as an action.
Parameters
- $accessToken : mixed = null
createSessionForLogin()
Associate a vb account with a facebook sesssion
public
createSessionForLogin(mixed $info) : mixed
Parameters
- $info : mixed
disconnectUser()
Disconnect the user's account from facebook
public
disconnectUser(int $userid) : void
Unlike previous behavior do not require that the user be logged in to facebook This causes a situation where if the user mucks with the association on the FB end they can screw it up to the point where it doesn't work. And they can't just reassociate the account because they can't log in to disconnect.
Parameters
- $userid : int
-
the userid to be disconnected.
getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
getFbProfilePicUrl()
Get the logged in user's profile picture url.
public
getFbProfilePicUrl() : string|false
Return values
string|false —facebook profile picture url or false on failure (forex, there is no logged in FB user)
getFbProfileUrl()
Get the logged in user's profile url.
public
getFbProfileUrl() : string|false
Return values
string|false —facebook profile url or false on failure (forex, there is no logged in FB user)
getFbUserInfo()
Grabs logged in user info from faceboook if user is logged in
public
getFbUserInfo([mixed $force_reload = false ]) : array<string|int, mixed>
Parameters
- $force_reload : mixed = false
Return values
array<string|int, mixed> —fb userinfo array if logged in, false otherwise, see the facebook '/me' docs for details
getInitializeFailureMessage()
Get the reason why facebook failed to initialize
public
getInitializeFailureMessage() : string
Return values
string —Reason why initialization failed
getLoggedInFbUserId()
Checks for a currrently logged in user through facebook api
public
getLoggedInFbUserId() : mixed
Return values
mixed —fb userid if logged in, false otherwise
getVbUseridFromFbUserid()
Checks if current facebook user is associated with a vb user, and returns vb userid if so
public
getVbUseridFromFbUserid([mixed $fb_userid = false ]) : mixed
Parameters
- $fb_userid : mixed = false
Return values
mixed —vb userid if one is associated, false if not
instance()
Returns singleton instance of self.
public
static instance(mixed $class) : static
Parameters
- $class : mixed
Return values
static —- Reference to singleton instance of the requested library class
isFacebookEnabled()
Is facebook enabled on this site.
public
isFacebookEnabled() : bool
Return values
bool —true if the facebook system initialized properly, false otherwise note that if we get an error this may be false even if facebook is configured in the admincp.
isValidAuthToken()
Verifies that the current session auth token is still valid with facebook - performs a Facebook roundtrip
public
isValidAuthToken() : bool
Return values
bool —true if auth token is still valid
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ][, mixed $currentuserid = 0 ]) : mixed
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed = 0
Tags
reinitialize()
Reintialize the facebook application
public
reinitialize() : bool
If for some reason the FB status changes during a script run (for example you enable it in the vb option) this will force an attempt to recheck its status. Otherwise we will store the status based on the first attempt.
If the intiailization fails, the reason can be determeined via vB_Library_Facebook::getInitializeFailureMessage();
Return values
bool —false if it failed, true if not
userIsLoggedIn()
Checks if the current user is logged into facebook
public
userIsLoggedIn([bool $ping = false ]) : bool
Parameters
- $ping : bool = false
-
Whether to ping Facebook (unused)