Jump to content

adding hook problem


emrag

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated