Class subscription

Description

Subscription class to perform the majority of subscription functionality in ILance.

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.subscription.inc.php (line 23)


	
			
Direct descendents
Class Description
subscription_expiry Subscription expiry class to perform the majority of subscription expiration functionality in ILance.
Method Summary
string alerts ([integer $userid = 0])
bool check_access ([integer $userid = 0], [string $accessname = ''])
string construct_subscription_exemption ([integer $userid = 0], [string $accessname = ''], [string $accessvalue = ''], [integer $cost = 0], [integer $days = 0], [string $logic = ''], [string $comments = ''], [boolean $doemail = ''])
void expire_saved_search_subscriptions ([integer $days = 30])
string fetch_subscription_plan ([integer $userid = 0])
integer fetch_subscription_roleid ([integer $subscriptionid = 0])
bool has_active_subscription ([integer $userid = 0])
mixed payment ([inetger $userid = 0], [integer $invoiceid = 0], [string $method = 'account'], [string $gateway = ''], [string $gatewaytxn = ''], [boolean $silentmode = false])
string plans_pulldown ()
string print_subscription_icon ([integer $userid = 0])
string print_subscription_title ([integer $userid = 0])
string pulldown ()
string send_saved_search_subscriptions ([integer $limit = 50])
string send_subscription_expiry_reminders ([integer $reminddays = 7])
string subscription_countdown_timeleft (integer $countdown)
string subscription_length (string $units, integer $length)
string subscription_upgrade_process ([integer $userid = 0], [integer $subscriptionid = 0], [boolean $agreecheck = 0], [boolean $instantpay = 0], [boolean $nocost = 0], [boolean $recurring = 0], [string $paymethod = ''], [boolean $ismodify = 0], [boolean $removepending = false], [string $returnurl = ''])
void subscription_upgrade_process_admincp ([integer $userid = 0], [integer $subscriptionid = 0], [string $txndescription = 'No description'], [string $action = ''])
Methods
alerts (line 459)

Function to display any subscription alerts from their my account area

  • return: Returns HTML formatted text
string alerts ([integer $userid = 0])
  • integer $userid: user id
cancel_scheduled_subscription_invoices (line 2228)

Function to cancel any scheduled subscription invoices based on a timer which the admin defines in max days of invoice cancellation

  • return: Return string with information for cron log
string cancel_scheduled_subscription_invoices ()
check_access (line 391)

Function used to check a user's access when trying to access a certain marketplace resource or area.

  • return: Returns true or false if boolean setting or will return the actual "value" if other (ie: bid limit per day might return 10)..
bool check_access ([integer $userid = 0], [string $accessname = ''])
  • integer $userid: user id
  • string $accessname: access name
construct_subscription_exemption (line 627)

Function to handle the subscription exemption upgrade process for end users.

  • return: Returns the subscription exemptions as requested
string construct_subscription_exemption ([integer $userid = 0], [string $accessname = ''], [string $accessvalue = ''], [integer $cost = 0], [integer $days = 0], [string $logic = ''], [string $comments = ''], [boolean $doemail = ''])
  • integer $userid: user id
  • string $accessname: access permission name
  • string $accessvalue: access permission value
  • integer $cost: cost for this exemption
  • integer $days: days this exemption shall last for
  • string $logic: logic to use for determining what to do
  • string $comments: end user comments
  • boolean $doemail: defines if this function should dispatch email once it's finished
exemptions_pulldown (line 590)

Function to display any subscription plan exemptions within a pulldown menu element.

  • return: Returns the subscription exemptions as requested
string exemptions_pulldown ()
expire_saved_search_subscriptions (line 2730)

Function to expire the saved search subscriptions after x days defined in the argument

void expire_saved_search_subscriptions ([integer $days = 30])
  • integer $days: days (default 30)
fetch_subscription_plan (line 557)

Function to display any subscription alerts from their my account area

  • return: Returns the subscription plan as requested
string fetch_subscription_plan ([integer $userid = 0])
  • integer $userid: user id
fetch_subscription_roleid (line 2753)

Function to fetch the roleid of a particular subscription plan id

  • return: Returns the role id
integer fetch_subscription_roleid ([integer $subscriptionid = 0])
  • integer $subscriptionid: subscription id
has_active_subscription (line 1711)

Function to internally check if a user has an active subscription plan (paid or free).

  • return: Returns true or false
bool has_active_subscription ([integer $userid = 0])
  • integer $userid: user id
payment (line 37)

Function for processing a subscription plan payment from a previously generated unpaid subscription transaction.

  • return: for ipn processing, boolean is used, others will use a print_notice() function to end user.
mixed payment ([inetger $userid = 0], [integer $invoiceid = 0], [string $method = 'account'], [string $gateway = ''], [string $gatewaytxn = ''], [boolean $silentmode = false])
  • inetger $userid: user id
  • integer $invoiceid: invoice id
  • string $method: method of payment (ipn or account)
  • string $gateway: name of gateway which will be processing this payment (optional)
  • string $gatewaytxn: gateway transaction id (from gateway provider) (optional)
  • boolean $silentmode: silent mode (return only true or false; default false)
plans_pulldown (line 500)

Function to display subscription plans within a pulldown menu element

  • return: Returns HTML pulldown menu element
string plans_pulldown ()
print_subscription_icon (line 1773)

Function to print a user's subscription icon

  • return: Returns the subscription icon
string print_subscription_icon ([integer $userid = 0])
  • integer $userid: user id
print_subscription_title (line 1739)

Function to print a user's subscription title

  • return: Returns the subscription title
string print_subscription_title ([integer $userid = 0])
  • integer $userid: user id
pulldown (line 526)

Function to display for users any subscription plans within a pulldown menu element

  • return: Returns HTML pulldown menu element
string pulldown ()
send_category_notification_subscriptions (line 1902)

Function to dispatch newsletter subscription notifications for latest listings posted that users have opted in This function is run via iLance automation script (cron.dailyrfp.php)

  • return: Return string with information for cron log
string send_category_notification_subscriptions ()
send_saved_search_subscriptions (line 2415)

Function to dispatch emails based on users saved searches where they choose to opt-in This function is run via iLance automation script (cron.dailyrfp.php)

  • return: Return string with information for cron log
string send_saved_search_subscriptions ([integer $limit = 50])
  • integer $limit: limit (default 50)
send_subscription_expiry_reminders (line 1811)

Function to dispatch subscription notifications to users "x" days before a subscription is expired This function is run via iLance automation script (cron.dailyrfp.php)

  • return: Returns the cron log bit information to append to the cron job log for actions taken within this function
string send_subscription_expiry_reminders ([integer $reminddays = 7])
  • integer $reminddays: days to remind user before expiry (default 7)
send_user_subscription_frequency_reminders (line 2272)

Function designed to send out subscription reminder notices based on an admin defined email dispatch frequency This function is called from cron.reminders.php

  • return: Return string with information for cron log
string send_user_subscription_frequency_reminders ()
subscription_countdown_timeleft (line 300)

Function used to obtain the time left of a subscription.

  • return: Returns time left
string subscription_countdown_timeleft (integer $countdown)
  • integer $countdown: countdown
subscription_length (line 357)

Function used to obtain the subscription length (in days) from a supplied unit (D/M/Y) and length (in days)

  • return: Returns time left
string subscription_length (string $units, integer $length)
  • string $units: unit (D or M or Y)
  • integer $length: length in days
subscription_upgrade_process (line 824)

Function to handle the subscription upgrade process for end users.

  • return: Returns the subscription exemptions as requested
string subscription_upgrade_process ([integer $userid = 0], [integer $subscriptionid = 0], [boolean $agreecheck = 0], [boolean $instantpay = 0], [boolean $nocost = 0], [boolean $recurring = 0], [string $paymethod = ''], [boolean $ismodify = 0], [boolean $removepending = false], [string $returnurl = ''])
  • integer $userid: user id
  • integer $subscriptionid: subscription id
  • boolean $agreecheck: end user agreement of terms value (true / false)
  • boolean $instantpay: end user instant payment value (true / false)
  • boolean $nocost: defines if the subscription cost is zero or not
  • boolean $recurring: defines if the transaction will be using the recurring subscription logic
  • string $paymethod: payment method chosen by the end user
  • boolean $ismodify: defines if this transaction is a recurring subscription modification or not
  • boolean $removepending: defines if this function should automatically delete any previous free or paid subscription transactions to reduce the amount of pending invoices in the admincp
  • string $returnurl: return url (optional)
subscription_upgrade_process_admincp (line 1468)

Function to update a users subscription plan within the AdminCP

void subscription_upgrade_process_admincp ([integer $userid = 0], [integer $subscriptionid = 0], [string $txndescription = 'No description'], [string $action = ''])
  • integer $userid: user id
  • integer $subscriptionid: subscription id
  • string $txndescription: transaction description
  • string $action: subscription action

Documentation generated on Mon, 08 Aug 2011 17:40:56 +0200 by phpDocumentor 1.4.1