Jump to content

Any free samples of hooks scripts? And how to connect to another server?


bigideaguy

Recommended Posts

I was wondering if there are any sample action hook scripts that are open source and free to look at as a sample?

 

Also is there any open source code on how to connect to a server using action hooks and execute something. Like lets say I wanted to have a file downloaded to a directory on the clients account and then have that file execute. How could this be done?

 

Thanks!

Link to comment
Share on other sites

Ok I think I am starting to figure out part of my question. But now I have another question, could it be this easy?

 

To execute my file could I simply have a file on my other server (server a) run this:

 

<form action="(serverbpath)/(userpath)/file.php">

<input type="hidden" name="(variable)" value="1" />

</form>

Link to comment
Share on other sites

Have a read here http://wiki.whmcs.com/Action_Hooks

 

As hooks can be anythink you like so seeing someone's hook will not help I think.

 

As all you do is:

 

function name_here_must_be_different_to_all_others($vars_name_you_would_like_to_use_to_display_your_data) {

put the code you want to run/use here in php code

} add_hook("put_your_selected_hook_point_name_here",1,"function_name_here");

Edited by thehost5968
Link to comment
Share on other sites

Have a read here http://wiki.whmcs.com/Action_Hooks

 

As hooks can be anythink you like so seeing someone's hook will not help I think.

 

As all you do is:

 

Thanks, the reason I asked is because I read that others were saying there was a lot of code available to go off of.

 

Anyways, thanks for the part above, I got that far in my hook, what I had trouble with was to run my function for a specific product id

Link to comment
Share on other sites

then within "put the code you want to run/use here in php code" rape your code in a if statment.

 

Now the best way to find how the pages you are going to have this working on handle / calls the Product id put {debug} in the page or just within the header.tpl then you will see how it is in smarty for that page?

 

If that does not / can not be done then you will need to do a database lookup.

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