Hi there...
I promised you an example... Better late then never.
If you attach an add-on to the licensed product then you can read it from the returned $results array that comes back from the licensing validator.
It will be in there like this:
PHP Code:
[addons] => name=CustomAddonName1;nextduedate=2013-07-08;status=Active|name=CustomAddonName2;nextduedate=2012-07-08;status=Pending
As you can see the multiple addons will be seperated by a pipe ( | ).
You can put anything you want in the custom addon name.
I myself like to rewrite this result a bit so I can check for certain values more easy.
I use the following code to do so:
PHP Code:
if ($results['addons']) {
$aAddons = explode('|',$results['addons']);
$aAddonRawData = array();
$aAddonCleanData = array();
foreach($aAddons as $aAddon) {
$aAddonRawData = explode(';',$aAddon);
$aAddonData = array();
foreach ($aAddonRawData as $k=>$v) {
list ($sAddonKey, $sAddonValue) = explode('=', $v);
$aAddonData[$sAddonKey] = $sAddonValue;
}
$aAddonCleanData[] = $aAddonData;
}
}
You then get the addons array from before as:
PHP Code:
Array
(
[0] => Array
(
[name] => CustomAddonName1
[nextduedate] => 2013-07-08
[status] => Active
)
[1] => Array
(
[name] => CustomAddonName2
[nextduedate] => 2012-07-08
[status] => Pending
)
)
That way you can check like this:
PHP Code:
foreach ($aAddonCleanData as $aCleanAddon) {
if ($aCleanAddon['name'] == 'CustomAddonName2' && $aCleanAddon['status'] == 'Active') {
return true;
}
}
If you need more info just pm me of if you think it will be usefull for others just reply here.