Jump to content

Do add_hook parameters differ between versions?


martyn1

Recommended Posts

In the Wiki at http://wiki.whmcs.com/Action_Hooks it shows three parameters to add_hook but in the latest release http://wiki.whmcs.com/Version_4.0_Release_Notes#Action_Hooks it shows 4:-

 

Original

 

attachment.php?attachmentid=1221&stc=1&d=1260361939

 

Updated

 

attachment.php?attachmentid=1222&stc=1&d=1260361939

 

I have been trying both methods without much success at the moment and this is one curve ball I would like dismissed so I can move on to the next!

 

Thanks,

Martyn

version1.jpg

version2.jpg

Link to comment
Share on other sites

Thanks Simon, I am using the 4.12, I had the additional parameter as shown in the changes for 4.12, I'll try it without:-

 

function client_signup($vars) {
 //Create ventrino client account	
 $syspwd = 'xxxxx';
 $url = 'http://www.ventrino.com/dev/client.php';
 $postfields["system"] = "create_client";
 $postfields["syspwd"] = md5($syspwd);
 $postfields["name"] = $vars["FirstName"]." ".$vars["LastName"];
 $postfields["email"] = $vars["Email"];
 $postfields["password"] = $vars["Password"];
 $postfields["whmcs_id"] = $vars["ID"];
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_TIMEOUT, 10);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
 $results= curl_exec($ch);
 curl_close($ch);
}
add_hook("ClientAdd",0,"client_signup");

 

I have placed it in includes/hooks/client_signup.php

 

Thanks,

Martyn

Link to comment
Share on other sites

When I call client_signup($vars) with dummy data it works however it is not being called by WHMCS. I have tried both methods:-

 

add_hook("ClientAdd",0,"client_signup", "");

 

and

 

add_hook("ClientAdd",0,"client_signup");

 

Any ideas what else I might try?

 

Thanks,

Martyn

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