class vB_PaidSubscription

Class to handle Paid Subscriptions

Properties

vB_Registry $registry The vBulletin registry object
_CURRENCYSYMBOLS $_CURRENCYSYMBOLS The HTML currency symbols
_SUBSCRIPTIONS $_SUBSCRIPTIONOPTIONS The extra paypal option bitfields
subscriptioncache $subscriptioncache The subscription cache array, indexed by subscriptionid

Methods

__construct()

Constructor

int
fetch_proper_expirydate(int $regdate, int $length, string $units)

Adds a unix timestamp and an english date together

build_user_subscription(int $subscriptionid, int $subid, int $userid, int $regdate = 0, int $expirydate = 0, boolean $checkperms = true)

Creates user subscription

delete_user_subscription(int $subscriptionid, int $userid, int $subid = -1, bool $adminoption = false)

Removes user subscription

cache_user_subscriptions()

Caches the subscriptions from the database into an array

array|bool
construct_payment(string $hash, array $methodinfo, array $timeinfo, string $currency, array $subinfo, array $userinfo)

Constructs the payment form

array
construct_payment_settings(string $serialized_settings)

Prepares the API settings array

Details

at line 201
__construct()

Constructor

at line 219
int fetch_proper_expirydate(int $regdate, int $length, string $units)

Adds a unix timestamp and an english date together

Parameters

int $regdate Unix timestamp
int $length Number of units to add to timestamp
string $units The units of the number parameter

Return Value

int Unix timestamp

at line 272
build_user_subscription(int $subscriptionid, int $subid, int $userid, int $regdate = 0, int $expirydate = 0, boolean $checkperms = true)

Creates user subscription

Parameters

int $subscriptionid The id of the subscription
int $subid The subid of the subscription, this indicates the length
int $userid The userid the subscription is to be applied to
int $regdate The start timestamp of the subscription
int $expirydate The expiry timestamp of the subscription
boolean $checkperms Whether to perform permission checks to determin if this user can have this subscription

at line 410
delete_user_subscription(int $subscriptionid, int $userid, int $subid = -1, bool $adminoption = false)

Removes user subscription

Parameters

int $subscriptionid The id of the subscription
int $userid The userid the subscription is to be removed from
int $subid The id of the sub-subscriptionid
bool $adminoption Update user.adminoptions from subscription.adminoption (keep avatars)

at line 594
cache_user_subscriptions()

Caches the subscriptions from the database into an array

at line 632
array|bool construct_payment(string $hash, array $methodinfo, array $timeinfo, string $currency, array $subinfo, array $userinfo)

Constructs the payment form

Parameters

string $hash A 32 character hash corresponding to the entry in the paymentinfo table
array $methodinfo Array containing the API information for the form to be constructed for
array $timeinfo Array containing specific data about the cost and time for the specific subscription period
string $currency The currency of the cost
array $subinfo Array containing the entry from the subscription table
array $userinfo Array containing the userinfo of the user purchasing the subscription

Return Value

array|bool The array containing the form data or false on error

at line 656
array construct_payment_settings(string $serialized_settings)

Prepares the API settings array

Parameters

string $serialized_settings Serialized string

Return Value

array Array containing the settings after being converted to the correct index format