dungtq Posted July 2, 2012 Share Posted July 2, 2012 Hello, I'm writing a hook that should be running every Addon Product Active, but seem "AddonActivation" doesn't work. This is the simple code <?php function append_file($filename,$newdata) { $f=fopen($filename,"a"); fwrite($f,$newdata); fclose($f); } function hook_addons_action_ative($vars){ $addonHID = $vars['id']; $usersID = $vars['userid ']; $serviceID = $vars['serviceid']; $addonID = $vars['addonid']; $files = dirname(__FILE__)."/abc.txt"; $data = "Addon Actived == $addonHID -- $usersID -- $serviceID --- $addonID\n"; append_file($files,$data); } add_hook('AddonActivation',1,'hook_addons_action_ative'); ?> The abc.txt file alway empty with "AddonActivation" so I think that hook never called, but another hook "AddonEdit", "AddonSuspended", "AddonTerminated", "AddonCancelled", "AddonFraud" are fine. Additional, the $var['id'] and $var['userid'] alway return null whatever hook called, doesn't like WHMCS documents said it must return values. I using WHMCS v5.0.1 PHP 5.2.x MySQL 5.0.x Is this a bug ? Best regards, 0 Quote Link to comment Share on other sites More sharing options...
dungtq Posted July 4, 2012 Author Share Posted July 4, 2012 Hello, I can have answer from WHMCS support in here or I need login to client and submit a ticket ? 2 days pass and nobody reply. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted July 4, 2012 Share Posted July 4, 2012 Although WHMCS staff do post, primarily the forum is for community support - no need to bump threads, if someone can help they'll post For direct support, you can raise a ticket through your whmcs install 0 Quote Link to comment Share on other sites More sharing options...
PhatPT Posted October 5, 2013 Share Posted October 5, 2013 Check your function: append_file, i think chmod or server security 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.