vBulletin v6.1.0

vB_Library_Site extends vB_Library
in package

vB_Library_Site

Table of Contents

Methods

__construct()  : mixed
Initializes an Api Site object
__serialize()  : array<string|int, mixed>
__sleep()  : array<string|int, mixed>
__unserialize()  : void
__wakeup()  : void
associateChannelsWithNavbarItems()  : array<string, int>
Go through the provided $navbar array, and returns a map of the $navbar array-keys for elements that correspond to certain default channels. This is meant to check if the default items defined in getDefaultHeaderNavbarItems() are present in the provided $navbar array, but may not be exactly accurate as it only checks for the routeid when present, or a matching title & URL when routeid is not present.
clearCache()  : mixed
getContentInstance()  : mixed
getDefaultHeaderNavbarItems()  : array<string|int, mixed>
Get default navbar data for 'blog', 'articles', and 'groups' header tabs
getSiteStatistics()  : array<string|int, mixed>
Returns an array of general statistics for the site
instance()  : static
Returns singleton instance of self.
loadFooterNavbar()  : mixed
Gets the footer navbar data
loadHeaderNavbar()  : mixed
Gets the header navbar data
monitorWords()  : mixed
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
onRouteUpdate()  : void
Called by vB5_Route::updateRoute() to automatically update any header navbar items that are linked to routes/pages.
processNavbar()  : mixed
saveFooterNavbar()  : bool
Stores the footer navbar data.
saveHeaderNavbar()  : bool
Stores the header navbar data.
updateUrlFromRoute()  : bool

Methods

__construct()

Initializes an Api Site object

public __construct() : mixed

__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>

associateChannelsWithNavbarItems()

Go through the provided $navbar array, and returns a map of the $navbar array-keys for elements that correspond to certain default channels. This is meant to check if the default items defined in getDefaultHeaderNavbarItems() are present in the provided $navbar array, but may not be exactly accurate as it only checks for the routeid when present, or a matching title & URL when routeid is not present.

public associateChannelsWithNavbarItems(array<string|int, mixed> $navbar) : array<string, int>

If a channel is present multiple times, it is undefined which key will be returned.

Parameters
$navbar : array<string|int, mixed>

array from loadHeaderNavbar()

Return values
array<string, int>

channelname => $navbar key

clearCache()

public static clearCache() : mixed

getContentInstance()

public static getContentInstance(mixed $contenttypeid) : mixed
Parameters
$contenttypeid : mixed

getDefaultHeaderNavbarItems()

Get default navbar data for 'blog', 'articles', and 'groups' header tabs

public getDefaultHeaderNavbarItems([bool $queryUsergroups = false ]) : array<string|int, mixed>
Parameters
$queryUsergroups : bool = false

Optional, default false. If true, will query the usergroup table to get the usergroups that can create blogs and groups for the "create a new blog" and "create a new group" subnav items.

Return values
array<string|int, mixed>

['blog' => [..], 'articles' => [..], 'groups' => [..]]

getSiteStatistics()

Returns an array of general statistics for the site

public getSiteStatistics() : array<string|int, mixed>
Return values
array<string|int, mixed>

Statistics.

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

loadFooterNavbar()

Gets the footer navbar data

public loadFooterNavbar(mixed $siteId[, mixed $url = false ][, mixed $edit = false ]) : mixed
Parameters
$siteId : mixed
$url : mixed = false
$edit : mixed = false
Return values
mixed

Array of footer navbar data (Described in save method).

loadHeaderNavbar()

Gets the header navbar data

public loadHeaderNavbar(mixed $siteId[, mixed $url = false ][, mixed $edit = false ][, mixed $channelId = 0 ]) : mixed
Parameters
$siteId : mixed
$url : mixed = false
$edit : mixed = false
$channelId : mixed = 0
Return values
mixed

Array of header navbar data (Described in save method).

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

use the functions from the notification library directly.

Parameters
$text : mixed
$type : mixed
$nodeid : mixed
$userid : mixed = null
$insertNotifications : mixed = true
$currentuserid : mixed = 0

onRouteUpdate()

Called by vB5_Route::updateRoute() to automatically update any header navbar items that are linked to routes/pages.

public onRouteUpdate(int $oldrouteid, int $newrouteid[, array<string|int, mixed> $oldHomeRouteids = [] ][, array<string|int, mixed> $deletedRouteids = [] ]) : void
Parameters
$oldrouteid : int
$newrouteid : int
$oldHomeRouteids : array<string|int, mixed> = []
$deletedRouteids : array<string|int, mixed> = []

processNavbar()

public processNavbar(mixed &$navbar, mixed &$phrases[, mixed $titlesArePhraseTitles = false ]) : mixed
Parameters
$navbar : mixed
$phrases : mixed
$titlesArePhraseTitles : mixed = false

saveFooterNavbar()

Stores the footer navbar data.

public saveFooterNavbar(mixed $siteId, mixed $data[, mixed $titlesArePhraseTitles = false ]) : bool
Parameters
$siteId : mixed
$data : mixed
$titlesArePhraseTitles : mixed = false
Return values
bool

To indicate if save was succesfully done.

saveHeaderNavbar()

Stores the header navbar data.

public saveHeaderNavbar(int $siteId, mixed $data[, bool $titlesArePhraseTitles = false ]) : bool
Parameters
$siteId : int

The storing data siteid (currently ignored).

$data : mixed

Array of elements containing data to be stored for header navbar. Elements might contain: title -- string Site title. *required url -- string Site url. *required usergroups -- array Array of ints. newWindow -- boolean Flag used to display site in new window. *required subnav -- mixed Array of subnav sites (containing same site data structure). id -- int Id of subnav site. title -- string Title of subnav site. url -- string Url of subnav site. usergroups -- array Array of ints. newWindow -- boolean Flag used to display subnav site in new window. subnav -- mixed Array of subnav sites (containing same site data structure).

$titlesArePhraseTitles : bool = false

If true, skip the phrase processing to push "title" into a phrase value, and replace "title" with the phrase key that it's stored under. Long version: When data is coming from sitebuilder, each navitem has 'title' and (optionally) 'phrase' keys, where 'title' is the display-title and 'phrase' (if set) is the phrase-key that the display-title value should be stored under. However, in the serialized data stored in the database, 'title' is the phrase-title. This makes fetching and storing data a bit difficult especially if you're handling the raw data that's not going through the various presentation steps... This flag exists to skip all that if you're not modifying the display-titles/ phrase-values at all. This flag is currently used in the installer & upgrader. Note, if you do use this flag, you are responsible for ensuring that the phrases for navitem titles are actually added/updated. In other words, only use this flag if you're not modifying the title data at all.

Return values
bool

To indicate if save was succesfully done.

updateUrlFromRoute()

public updateUrlFromRoute(array<string|int, mixed> &$element) : bool
Parameters
$element : array<string|int, mixed>
Return values
bool

        
On this page

Search results