Jump to content

WHMCS Chance

WHMCS Jr. QA Developer
  • Content count

  • Joined

  • Last visited

  • Days Won


WHMCS Chance last won the day on July 13 2015

WHMCS Chance had the most liked content!

Community Reputation

48 Excellent

About WHMCS Chance

  • Rank
    Jr. QA Developer

Recent Profile Visitors

804 profile views
  1. WHMCS Chance

    60-day trial setup

    Hey there, Have you checked over our docs pages for Common Promotions: https://docs.whmcs.com/Common_Promotions#Free_Trial https://docs.whmcs.com/Products_and_Services#Pricing_Tab As Bear mentioned, its rather difficult to provide a 60day promo to anything outside a monthly cycle. The best way to do this is how we have listed in the Free Trial promo docs page, where you have 2 products, one is what you will use the free trial promo code on and then once they term out it will upgrade them to the actual product set on the proper term you want them to use. Hope that helps.
  2. Hey everyone and welcome to the SkunkWorx forum! Today we are going to be looking at a hook that will create an output for your Admin Area in WHMCS for support tickets. This output will provide a banner with the number of Staff Online and the number of tickets in the Awaiting Reply status which by default is how tickets requiring a response will be shown when you pull up supporttickets.php or clicking on the Awaiting Reply link from the top of the homepage. This is a combination of jQuery and localAPI calls placed inside functions and their results then processed via the AdminAreaFooterOutput hook point. Simply create a new file in your [highlight]includes/hooks/[/highlight] directory and name it something that will easily make it known as to what it does, in this case lets call it Overload.php. Here is the code in which is copy/paste ready and you can download it following this link Overload.txt (simply rename the extension to .php): <?php /** * This hook will check the count of tickets * in Active Status and then using jQuery add * a banner informing of any overload based on * logged in admins. * * @package WHMCS * @author WHMCS Chance * @copyright Copyright (c) WHMCS Limited 2005-2016 * @license https://www.whmcs.com/license WHMCS Eula * @link https://www.whmcs.com/ */ if (!defined('WHMCS')) { die('This hook should not be run directly'); } function checkTicketCount() { $count = localAPI('gettickets', array( 'limitnum' => '1000', 'status' => 'Awaiting Reply' )); return $count['totalresults']; } function checkAdmins() { $getStaff = localAPI('getstaffonline'); return $getStaff['totalresults']; } function showOverload() { $overLoad = checkTicketCount(); $staff = checkAdmins(); $page = $_SERVER['PHP_SELF']; $pos = strrpos($page, 'supporttickets.php'); if ($pos != false) { if ($overLoad <= 9 && $staff <= 1) { $show = '<script> $(function() { $(\'<div class="alert alert-success text-center">Tickets are looking good!!!! <div style="font-size: 14px;">Staff Online: <b>'.$staff.'</b></div><div style="font-size: 14px;">Tickets: <b>'.$overLoad.'</b></div></div>\').prependTo("#contentarea"); }); </script>'; } elseif ($overLoad >= 10 && $staff >= 1) { $show = '<script> $(function() { $(\'<div class="alert alert-danger text-center">We are in <b>OVERLOAD</b>!!!! <div style="font-size: 14px;">Staff Online: <b>'.$staff.'</b></div><div style="font-size: 14px;">Tickets: <b>'.$overLoad.'</b></div></div>\').prependTo("#contentarea"); }); </script>'; } return $show; } } add_hook('AdminAreaFooterOutput', 1, 'showOverload'); Let's break this code down a little bit and I will give you some points on where to adjust the sensitivity of the hook so you can set it based on your workflow and such. ($overLoad <= 9 && $staff <= 1) This above is what sets the limitations for the hook to show either the All Good or the Overload message which you can see in the screenshots. In the first if statement this is your All Good message so here is where you would set the number of tickets to be lower as this would mean you've got things under control so to speak. In the following elseif statement is the Overload message. Here you would want to put a number 1 higher whatever you have set for your previous check as mentioned above. The same goes for the $staff variable in the if statements as well, you would bump this up or down depending on the number of staff you have and your workflow. function checkTicketCount() { $count = localAPI('gettickets', array( 'limitnum' => '1000', 'status' => 'Awaiting Reply' )); return $count['totalresults']; } In the above function, the localAPI call that is made, you can also pass in deptid as an array item and specify which departments you would like to get the tickets from as well in case you would like to only pull for the Support Department or Sales Deptarment, etc. You can read more about the other variables for this API call here: GetTickets API call I hope that this customization will come in handy for some of you out there looking to add a little flair to your WHMCS installation and in the process, make it more your own. At the time of writing, this hook is tested with the current versions of WHMCS that fall under Active Support as listed here http://docs.whmcs.com/Long_Term_Support#WHMCS_Version_.26_LTS_Schedule]Active Support and are not guaranteed to work with prior versions of WHMCS. I look for any feedback, comments and questions that you may have for me that were not answered already. Thanks!
  3. Hello @harvard, Please ensure that your reseller account has access to the packages in WHM. If you are still having issues, please open a ticket to support and provide logins so we can further investigate. Thanks!
  4. @twhiting9275 The new developer docs pages are in their infancy as we have just rolled out the new changes for this. If you see there is something that is missing, or could use better documentation, please feel free to fork the repo from here: https://github.com/WHMCS/developer-docs Then you will have a version in which you can make modification to and submit a Pull Request for review and if accepted will be merged into the upstream. This will work for everything in the developer docs pages except for the hooks and api lists as these are pulled directly from the doc blocks in the source code itself. You are more than welcome to submit an issue for one of these via GITHUB or open a bug case to have this investigated so we can input the proper case type and have it added. Thanks!
  5. WHMCS Chance

    problem at "configregistrars.php" at admin

    Hey rollerD, This could be due to custom registrar modules that you have added. I would try removing any customizations present on your installation including hooks/addons/modules/etc and see if you are still experiencing this issue. If you are still having issues, please submit a ticket to Support so we can further assist. Thanks!
  6. WHMCS Chance

    WHMCS 6 email verification

    Hey forum-goers! So with the new feature added of Email Verification, I would like to say that this is in it's infancy. The ground work has been laid in order to build a more feature rich and robust addition to client accounts. However, with a little bit of hook work, you can use this new feature to your benefit. Using the ClientAreaPage hook point, http://docs.whmcs.com/Hooks:ClientAreaPage , you could check in the DB to see if the verification has been completed and allow the client to pass through unaffected. However, if the validation has not occurred you can have it block access to any client area page until they verify. We appreciate all feedback on the new feature added to WHMCS and look forward to the future of our new additions to the core of the product. Thanks!
  7. WHMCS Chance

    Open support ticket through API

    Hey behnam, Give this code a try as I know this is working: <?php /** * This API call is for OpenTicket which * will open a new support ticket as a client * * @package WHMCS * @link https://www.whmcs.com/ * @author WHMCS Chance * @see http://docs.whmcs.com/API:Open_Ticket */ $url = 'http://yourdomain.tld/includes/api.php'; $user = 'adminuser'; $pass = md5('adminpass'); # Build your request params $request = array( 'username' => $user, 'password' => $pass, 'action' => 'openticket', 'clientid' => '1', 'deptid' => '4', 'subject' => 'API TEST TICKET', 'message' => 'Testing API OpenTicket call to see how this works!', 'priority' => 'high', 'customfields' => base64_encode(serialize(array('8' => 'Custom Support Field Value'))), 'responsetype' = 'json', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($request)); $response = curl_exec($ch); if (curl_error($ch)) { die('Conn Error: ' . curl_errno($ch) . ' - ' .curl_error($ch)); } curl_close($ch); $decode = json_decode($response); # Show it on screen echo '<textarea rows="50" cols="100">' . 'Request: ' . print_r($request, true) . "\n" . 'Response: ' . htmlentities($response) . "\n" . 'Array: ' . print_r($decode, true) . '</textarea>'; That should get you going.
  8. WHMCS Chance

    Live Help by Stardevelop updated - available?

    Hey jbro, Did they happen to provide you this information via a chat or ticket you submitted to them? We have not received any updates from them as we have been working with them on getting this new version to integrate with WHMCS. If you have this available, please open a support ticket and provide the source so we can look into this. Thanks!
  9. WHMCS Chance

    WHMCS is not working with PHP 5.5.x and ionCube 4.5.0

    Hey forum goers! I wanted to reach out on this forum thread and address this scenario. From a WHMCS standpoint, WHMCS in it's current version only supports PHP 5.4.x down to 5.2.x. However, with that being said, I would recommend the 5.4.x version of PHP at this time. The 6.0 version will support PHP 5.5 when it is released. While there are new updates for IonCube that in theory _backport_ to allow you to achieve running WHMCS 5.3.x on PHP 5.5, this is entirely unsupported. So if you were to open a ticket, and we cannot determine the cause of the issue and you are running PHP 5.5 on the 5.3.x or older version of WHMCS, we will respectfully ask that you bring your system into a supported versioning to further address the issue. I have seen WHMCS running on PHP 5.5 in a handful of different scenarios, what the underlying configuration on those setups is unknown to me and I would venture to say they are not all the same. I cannot say for sure that upgrading your IonCube to the newest version and upgrade PHP to 5.5 will work as we have not tested this and we are not supporting this currently. 6.0 will be the first official WHMCS version to support PHP 5.5.x Thanks!
  10. WHMCS Chance

    Upgrade to 5.3.12 Issue

    Heya, So this looks to me that there was a file that was not properly overwritten during the upgrade process. I would double check that /includes/classes/WHMCS/License.php was indeed overwritten and showing the correct version information in the top of the file. Further, I would actually ensure that the entire /includes directory was updated properly. If you are still having issues, please submit a ticket so we can further investigate. Thanks!
  11. Hey urgid0, I have confirmed this in my test install using iWHMCS. However, this is actually how the API call getclients functions. http://docs.whmcs.com/API:Get_Clients We use this call for the search feature in iWHMCS. The search variable of this call only allows wildcard matching after the term you provide and searches at the beginning of the field for the term you provide and wildcard matches anything after that. So if you have Firstname: Some Guy and Lastname: Testing WHMCS the search function of the call will only return matches for Some and Testing but not Guy and WHMCS. Whilst this is intended functionality I went ahead and opened a case with the developers to look into this. CaseID: 5519 I would recommend also putting in a feature request for this here: http://requests.whmcs.com Feel free to search existing feature requests, vote, comment and submit your ideas. For now, you will need to search by the first string of data entered into that field. Thanks!
  12. Hey jas8522, Thanks for the reply. I have created a case for this issue: CaseID 5341 I do not have an ETA on a fix or resolution for this at this time however. Please check the changelog for updates regarding this case when we release updated versions of the App. Thanks!
  13. Hey urgid0, Can you confirm the version of the iWHMCS app you are using along with the iOS version and model of phone? I was unable to replicate this using the latest version of the iWHMCS app 2.0.2 on iPhone 6 running iOS 8.0.2. If you view that product from WHMCS, do you have any errors? I would recommend opening a support ticket with us and provide the login details along with the API key so we can further run some tests for you as it appears to be specific to your install. Thanks!
  14. Hey urgid0, This is intended functionality of the API call that is used in the iWHMCS app to open tickets. http://docs.whmcs.com/API:Open_Ticket By default, the API call opens the ticket on behalf of the client. To open as an Admin, you would need to pass the admin variable through the call and assign it a value. This is not built into the iWHMCS app at this time, however we welcome suggestions for new features on our feature request system: http://requests.whmcs.com Feel free to search existing feature requests, vote, comment and submit your ideas. Thanks!
  15. Hey there Damo, We have had this reported to us and have created a case on this with our developers: Case 5266 Thank you for bring this to our attention. I do not have an ETA on when this will be fixed, but check our blog posts when we release new updates to our app. Thanks again!

Important Information

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