nici Posted November 10, 2009 Share Posted November 10, 2009 hello, In many actions hooks; the parameters available are not mentioned like as below AfterModuleCreate - params AfterModuleSuspend - params AfterModuleUnsuspend - params AfterModuleTerminate - params AfterModuleChangePassword - params AfterModuleChangePackage - params What exactly is available as variable? I can not do var_dump as it is a live site. I need to know the list of variables available.. can someone help me? Thanks, Nici S 0 Quote Link to comment Share on other sites More sharing options...
Damo Posted November 10, 2009 Share Posted November 10, 2009 Why not do a var_dump into html comments if this is a live system? Not that developing, even with the params known, is a good idea on a live system. 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted November 10, 2009 Share Posted November 10, 2009 just code a hook an fopen/fwrite the output anyway here is an example with printr : whmcs/includes/hooks/wuharhar.php function mypleskstuffforexample($params) { $vars = func_get_args(); echo "<pre>";print_r($vars);echo"</pre>"; } add_hook("AfterModuleUnsuspend",1,"mypleskstuffforexample",""); Output: params Array ( [accountid] => [serviceid] => [domain] => [username] => [password] => [packageid] => [pid] => [serverid] => [customfields] => Array ( [Cusom Field] => ) [configoptions] => Array ( ) [type] => [producttype] => [moduletype] => [configoption1] => [configoption2] => [configoption3] => [configoption4] => [configoption5] => [configoption6] => [configoption7] => [configoption8] => [configoption9] => [configoption10] => [configoption11] => [configoption12] => [configoption13] => [configoption14] => [configoption15] => [configoption16] => [configoption17] => [configoption18] => [configoption19] => [configoption20] => [configoption21] => [configoption22] => [configoption23] => [configoption24] => [clientsdetails] => Array ( [userid] => [id] => [firstname] => [lastname] => [companyname] => [email] => [address1] => [address2] => [city] => [state] => [postcode] => [country] => [countryname] => [phonenumber] => [notes] => [password] => [currency] => [cctype] => [cclastfour] => [securityqid] => [securityqans] => [groupid] => [status] => [credit] => [taxexempt] => [latefeeoveride] => [overideduenotices] => [language] => [lastlogin] => [customfields1] => [customfields2] => [customfields3] => [customfields4] => [customfields5] => [customfields6] => [billingcid] => ) [server] => [serverip] => [serverhostname] => [serverusername] => [serverpassword] => [serveraccesshash] => [serversecure] => ) printr values deleted ... 0 Quote Link to comment Share on other sites More sharing options...
nici Posted November 10, 2009 Author Share Posted November 10, 2009 Thanks HerrZ , that should be of lot of help 0 Quote Link to comment Share on other sites More sharing options...
mcpacific Posted November 30, 2009 Share Posted November 30, 2009 For some reason "print_r" isn't working for me. I created a file called "newactionhook.php" and uploaded it into my hooks folder. Inside, it has the following coding: <?php function new_action_hook($params) { $vars = func_get_args(); echo "<pre>";print_r($vars);echo"</pre>"; } add_hook("PreShoppingCartCheckout",1,"new_action_hook",""); ?> When I go through the purchase process, nothing is echoed to the screen. Anyone have any ideas on why? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 30, 2009 Share Posted November 30, 2009 Of corse it won't... if you look you should be doing print_r($params) or change $params to $vars 0 Quote Link to comment Share on other sites More sharing options...
mcpacific Posted November 30, 2009 Share Posted November 30, 2009 Oh lol, of course. Thanks ;-) 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted November 30, 2009 Share Posted November 30, 2009 (edited) oh sorry, example was wrong should be: function mypleskstuffforexample($params) { echo "<pre>";print_r($params);echo"</pre>"; } add_hook("AfterModuleUnsuspend",1,"mypleskstuffforexample",""); [ Edited November 30, 2009 by HerrZ 0 Quote Link to comment Share on other sites More sharing options...
louisliu Posted January 5, 2010 Share Posted January 5, 2010 Thank you very much 0 Quote Link to comment Share on other sites More sharing options...
nikizwan Posted August 6, 2011 Share Posted August 6, 2011 how do i access the email value? can i use the following? $cpanel_email = $vars['params']['email']; 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted August 7, 2011 Share Posted August 7, 2011 I would guess you'd want to access $params['email']. Assuming $params is what is being passed to the function. 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.