emrag Posted June 14, 2010 Share Posted June 14, 2010 i'm trying to add hook. i'm using resellerclub api. it works fine if my hook file look like that: $SERVICE_USERNAME = 'username'; $SERVICE_PASSWORD = 'password'; $SERVICE_ROLE = 'reseller'; $SERVICE_LANGPREF = 'en'; $SERVICE_PARENTID = '1'; $LIB_DIR ="pathhere"; // Absolute or relative Path to your Lib folder // resellerclub api include($LIB_DIR."apiutil.php"); include($LIB_DIR."DomOrder.class.php"); include($LIB_DIR."response.class.php"); $serviceObj = new DomOrder($LIB_DIR . "wsdl/DomOrder.wsdl"); $domainName = 'example.com'; $option = array('All'); $domdata = $serviceObj->getDetailsByDomain($SERVICE_USERNAME, $SERVICE_PASSWORD, $SERVICE_ROLE, $SERVICE_LANGPREF, $SERVICE_PARENTID, $domainName, $option); print_r($domdata); but if i create a function and add these codes to in it there's no output. that doesn't work: function test_domain() { $SERVICE_USERNAME = 'username'; $SERVICE_PASSWORD = 'password'; $SERVICE_ROLE = 'reseller'; $SERVICE_LANGPREF = 'en'; $SERVICE_PARENTID = '1'; $LIB_DIR ="pathhere"; // Absolute or relative Path to your Lib folder // resellerclub api include($LIB_DIR."apiutil.php"); include($LIB_DIR."DomOrder.class.php"); include($LIB_DIR."response.class.php"); $serviceObj = new DomOrder($LIB_DIR . "wsdl/DomOrder.wsdl"); $domainName = 'example.com'; $option = array('All'); $domdata = $serviceObj->getDetailsByDomain($SERVICE_USERNAME, $SERVICE_PASSWORD, $SERVICE_ROLE, $SERVICE_LANGPREF, $SERVICE_PARENTID, $domainName, $option); print_r($domdata); } test_domain(); ps: i know how to use hooks. like add_hook("InvoicePaid",1,"test_domain"); ...ect. 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted June 15, 2010 Share Posted June 15, 2010 please give us the hole context of your "hook add task". hint: the hook ClientAreaPage is always called except of cron. so you can try first on this. are the path correct? give some debug output on method "getDetailsByDomain". does it work? 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.