Jump to content

Search the Community

Showing results for tags 'hook'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


WHMCS.Community

  • The Latest from the WHMCS Team
    • News & Announcements
    • Get to know the new WHMCS.Community
  • The WHMCS.Community
    • Community Announcements
    • Introduce Yourself
  • Using WHMCS
    • Pre-Sales Questions
    • Admin & Configuration Questions
    • Installation, Upgrade, and Import Support
    • Using WHMCS
    • Troubleshooting Issues
    • Vendor Discussions
  • WHMCS Beta Program
  • WHMCS Showcase
    • Showcase Your Site
    • Share Your Best Practices & Tips
  • Developing & Extending WHMCS
    • Third Party Add-ons
    • Service Offers & Requests
    • Developer Corner
    • Building Modules
    • Share Ideas for WHMCS Modules
  • Community Competitions
    • Competitions
  • General Discussions
    • General Discussion
  • General Feedback & Assistance
  • Turkish International Discussions's Topics
  • Russian International Discussions's Topics
  • Spanish International Discussions's Topics
  • Portuguese International Discussions's Topics
  • French International Discussions's Topics
  • Italian International Discussions's Topics
  • German International Discussions's Topics
  • Third Party Developers's Topics
  • WHMCS Brasil's Topics
  • WHMCS Brasil's Tópicos
  • ModulesGarden Club's Topics
  • Hungarian International Discussions's Segítség

Calendars

  • Community Calendar

Categories

  • Articles

Found 20 results

  1. We are trying to include a productID into a tracking link so we can include the product which was purchased. A hook is required for it and we require someone who can write a simple one. Example of the complete.tpl link: <img src="https://trackingurl.com/ep?ord={$ordernumber}&orderid={$orderid}&product={$THISISMISSING}&qlist={$smarty.session.orderdetails.Products|@count}&amtlist={$amount*100}&cur=USD&img=1"> Thank you!
  2. Hi I would like to send an email to another address if a ticket is opened from a specific support department ID. Here is my hook, but it's not working. Advice please; <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); function hook_send_emergency_email($vars) { $criticaldept = 5; // id of emergency department from whmcs admin $deptid = $vars['deptid']; $company = $vars['companyname']; if (in_array($vars['deptid'], $criticaldept)) { // Send email to specified address $to = '[email protected]'; // e-mail subject $subject = "Emergency Ticket Alert"; // e-mail message $message = "Hello Admin,\r\n" ."Emergency Ticket Opened For:\r\n" ."Company: $company\r\n"; $headers = "From: Some Company <[email protected]>\n" ."Reply-To: [email protected]\n" ."X-Mailer: PHP/".phpversion(); mail( $to, $subject, $message, $headers ); } // if in_array } add_hook("TicketOpen",1,"hook_send_emergency_email");
  3. Hi, I am trying to add a link tot he affiliate login page under the account menu section. Just like the log in hook for the main section. I would like it to be under the: login register lost password (Affiliate Login) Thanks for any help. I've checked the TMSecondaryNavbar.php file but can't see what to add. I tried to add this: $primaryNavbar->getChild('Company') ->addChild('Affiliate Login', array( 'uri' => 'affiliates.php', 'order' => '20', )); But it crashed the whole site. Thank you, Charles
  4. A-Record by product.

    I'm in need of setting an A-record to a specific IP when certain set of products is ordered. Enom and using their API. Would I create a hook?
  5. Hey guys! I was unable to find a good way of updating bitcoin currency rates so I decided to create my own module to do this for me and that resultet in Anveto Currency Rates. This addon will update additional currency rates when the daily cron runs or when Anveto cron runs (see downloads here for anveto cron https://anveto.com/members/downloads/2/WHMCS) in order to update currencies multiple times daily. Currently it uses the bitpay (https://bitpay.com/api/rates) to get currency rates but you could set this to any source as long as it follows the same json format. The module costs $10 and can be purchased here https://anveto.com/members/cart.php?a=add&pid=21 It is currently pending community app store review. The source code is not encrypted as I want users to be able to modify this however they would like as long as they purchase the module. I hope some of you find it useful!
  6. How can I show the clients first and last name in a support ticket hook. I got everything else working such as userid, message, and subject. But I can't get the first and last names to show. I tried $firstname and $lastname as a varible but it doesn't show.
  7. Good morning, We created a WHMCS provisioning module for our control panel. Because in our control panel, the usernames match the domain names, we added a hook which overrides the username that is automatically generated by WHMCS when an order is being placed. The hook look as follow: /** * Replace generated username by domain name */ add_hook('OverrideModuleUsernameGeneration', 1, function ($vars) { if($vars['moduletype'] != 'imscp') { return null; } return $vars['domain']; }); This works well for products that are setup automatically (the hook is run as expected and the username is set with the domain name as expected). However, when the order is placed and accepted manually, or when the product setup is not automatic, the hook is not triggered and thus, the username is not overriden. We already reported the issue to WHMCS team (#AMI-418461 no answered yet) but it would be great if someone here could help us to find a temporary workaround. The hook should be triggered in every contexts (when our provisioning module is involved). To resume, each time the username is being generated, that hook should be called. Thank you for your help. Involved WHMCS version: 6.3.1
  8. What I am trying to do is to add a hook where variables are send to an external page for processing via get or post. The page is on other domain and involves creating directories so te hook itself won't be able to do that. hook = get variables (userid, domain) and send to an external page. (Same server, other domain. The database can be updated from either side so it's no problem) Do anybody have some ideas please?
  9. Hello, I'm working on making it possible to show a Twitter feed based on the client. That way we can show different feeds for resellers and end-users. When someone isn't logged in I would probably show the end-user Twitter account. Changing the Twitter account for the URLs pointing to Twitter is easy. However with an AJAX (?) call it doesn't work. From WHMCS support I did hear I should be able to create some output on it when using the ClientAreaPage hookpoint. However this doesn't seem to work as the code below doesn't return any content (and that is what I would expect). <?php function whmcs_hook_test($vars){ var_dump($vars); } add_hook('ClientAreaPage',10,'whmcs_hook_test'); Any pointers as where to look? Or should I just create a new PHP file for it that gets the required information from Twitter and call that file using the Javascript?
  10. With the Login with PayPal Module, your clients can authenticate into your WHMCS using PayPal. It’s the same procedure we already know for Facebook, or maybe Twitter and GitHub. The Login with PayPal module is a commerce identity solution that enables clients to register/login into the client area quickly and securely using their PayPal login credentials. One of the most important reasons to use the module is simplicity. Your clients will not need to remember another set of credentials – the same advantage OAuth via FB, Twitter, etc have. In addition, the login procedure is absolutely secured fewer concerns for you. However, it’s not just an email and a password. Features Login form the client are login page Register form the client register page Register or login form the checkout page Connect to PayPal for existing clients from the client panel Clients register list for admin area to see all connected clients Custom buttons – you can use your own buttons style Debug mode – sandbox or live View the product Page View all our works and Products
  11. I created an action hook (almost) that will force clients to agree to new terms of service (on login) before being able to continue to client area. I created a new column under "tblclients" called "tosversion" (which is type "date" instead of a version number) and that gets updated no problem when the client logs in. The only problem is displaying a page or popup that displays the TOS before this field is updated. the code: <?php $updateddate = "2016-02-16"; function hook_tos_clientlogin($vars) { /// CHANGE YOUR TOS VERSION $updatedtosversion="2016-02-16"; $clientid = $vars['userid']; if (!filter_var($clientid, FILTER_VALIDATE_INT)) { return; } $tbl="tblclients"; $fields = "tosversion"; $where = array("id"=>$clientid); $result = select_query($tbl,$fields,$where); $data = mysql_fetch_array($result); $ctosversion = $data['tosversion']; if ($ctosversion < $updatedtosversion) { //we don't match, do something. // make sure we update at the end of this $update = array("tosversion"=>"$updatedtosversion"); $where2 = array("id"=>"$clientid"); update_query($tbl,$update,$where2); } else { //just a courtesy else } } add_hook("ClientLogin",1,"hook_tos_clientlogin"); ?> What am I missing?
  12. I am looking to delete certain gateways from a hook so that these gateways are not shown on the cart. The following code does the filtering/removal of the relevant gateways in a hook: function hook_HideGateways($vars) { global $CONFIG; if ($vars['filename']=='cart') { // delete all but securetradingadvanced from gateways array foreach ($vars['gateways'] as $gw_name => $gw) { if ($gw_name != 'securetradingadvanced') { unset($vars['gateways'][$gw_name]); // delete gateway } } } } add_hook('ClientAreaPage', 1, 'hook_HideGateways'); How can I then return/override the $gateways Smarty variable as used in the cart templates? Thanks in advance!
  13. I am trying to run ClientChangePassword hook after ClientEdit hook. BUt no matter what priority I set for them, ClientChangePassword always runs before ClientEdit! How to overcome this? Can anyone please help?
  14. We just finished updating the Admin Private Messages module to v2.0.0 to work on WHMCS v6. Note that v2.0.0 only support WHMCS v6 or later if you need the module to work on WHMCS v5 you can still use Admin Private Messages v1.6.0 Changlog Rewrite the code from scratch Support only WHMCS v6 Changed the dialog box Added send messages section Added email template editor Added send message to all staff View the product Page View all our works and Products
  15. Take advantage of our WHMCS Addons with 50% Discount during this Weekend! Offer is available to new and existing customers. The Coupon Code is: 50OFFWE Supports WHMCS v5 & v6. One Time pricing. For Screenshots, More Details and Prices please visit our WHMCS Addons page.
  16. Favicon manager module lets you add a favicon image to your WHMCS website. Favicon is a small icon image or logo displayed in the address bar of a web browser. By using this Module, you can easily upload and change favicon icon on your WHMCS. You can create favicon icon for each page or only use one favicon icon The favicon manager module is free. You can download the favicon manager module from the product page. The favicon manager module is encoded with ionCube if you want the source code you can buy from the product page Favicon Manager Module Features Very simple and easy to use. No complex menus or setting. Just upload an image and change your website's default favicon logo. Enable or disable the favicon on the website. Create favicon icon for each page on the website. Compatible with WHMCS version 6.x.x View the product Page View all our works and Products
  17. A very important feature is missing from WHMCS, the language fallback. It's impossible to able to translate all custom stings to all languages, so best scenario is to load the default string translation, for example "english". This is the hook code of "languageFallback.php", the code seems OK but does not effect the loaded language. Any suggestion? /* Developer: Stergios Zgouletas Web-site: web-expert.gr License: GNU GPL v2 */ if(!defined("WHMCS")) die("This file cannot be accessed directly"); function languageFallback($vars){ $defaultLanguage='english'; //Fallback Language $currentLanguage=strtolower($vars['language']); //Current Active Language global $_LANG; $current=$_LANG; if($defaultLanguage!=$currentLanguage){ //Load default language file $default=array(); if(file_exists(ROOTDIR.'/lang/'.$defaultLanguage.'.php')){ require(ROOTDIR.'/lang/'.$defaultLanguage.'.php'); $default=$_LANG; } //Load default override language file $defaultOverride=array(); if(file_exists(ROOTDIR.'/lang/overrides/'.$defaultLanguage.'.php')){ require(ROOTDIR.'/lang/overrides/'.$defaultLanguage.'.php'); $defaultOverride=$_LANG; } //Load module's language $module=array(); if(isset($_REQUEST['m']) && !empty($_REQUEST['m']) && file_exists(ROOTDIR.'/modules/addons/'.$_REQUEST['m'].'/'.$defaultLanguage.'.php')){ require(ROOTDIR.'/modules/addons/'.$_REQUEST['m'].'/'.$defaultLanguage.'.php'); $module=$_ADDONLANG; } $_LANG=array_merge($default,$defaultOverride,$module,$current); return array('languageFallback'=>1); } return array('languageFallback'=>0); } add_hook("ClientAreaPage",0,"languageFallback");
  18. V6.01 I have a hook menu.php It is working to do what I wanted, add an item to the support menu and remove the downloads item. Cool! But when logging out from the client area it throws an error. "Fatal error: Call to a member function addChild() on a non-object in /home/steved/public_html/includes/hooks/menu.php on line 9" This implies that when someone is logging out and logout.php is being loaded, it is calling the menu hook. Reloading logout.php then redirects to index.php When logout.php is being called, by that time the $ca->isLoggedIn() flag should be false shouldn't it? So it shouldn't even see the code throwing the error. Or am I completely missing the point somewhere? $ca = new WHMCS_ClientArea(); use WHMCS\View\Menu\Item as MenuItem; if ($ca->isLoggedIn()) { add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar){ /** Add Create Ticket to the Support Menu **/ $primaryNavbar->getChild('Support')->addChild('Firewall Management', array( 'label' => 'Open a Ticket', 'uri' => 'https://domain.com/submitticket.php', 'order' => '1', )); }); add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Support'))) { $primaryNavbar->getChild('Support')->removeChild('Downloads'); } }); }
  19. I am having an issue where my the hook for the DailyCronJob is not being called. I know cron is running as I get the email daily. It seems like the method is not being called to perform the update but if I call this from the browser it seems to work fine. What am I missing or doing wrong here? class MyAddon_Hooks { protected static $instance = NULL; public static function get_instance() { if ( NULL === self::$instance ) self::$instance = new self; return self::$instance; } function __construct() { $files = array("addonfile.php"); foreach ($files as $f) { if (file_exists($f)) { include_once($f); } } } function update() { Anveto::get_instance()->cron(); } } function myaddon_update() { MyAddon_Hooks::get_instance()->update(); } add_hook("DailyCronJob",1,"myaddon_update"); This is the code in my hooks.php file.
  20. Ok, so I have a hook in place for ShoppingCartCheckoutCompletePage. When they reach completion page, hook checks for products in the order and based on product ID and if order status is pending, it sends out a correct email. Because I'm using ShoppingCartCheckoutCompletePage hook, the email should go out right there and then when order is complete. So why does the email go out when dailycron runs in the morning? Thoughts? I'm using internal API inside hook to sendmail with a correct template.
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines