Jump to content

Search the Community

Showing results for tags 'PHP'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • The latest WHMCS Release
    • WHMCS 8.4 Release Discussion Board
  • The Latest from the WHMCS Team
    • News, Announcements & Blogs from WHMCS
  • 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 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
    • Feedback
    • WHMCS.Community Tips & Tricks
  • Third Party Developers's Topics
  • 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
  • WHMCS Brasil's Topics
  • WHMCS Brasil's Tópicos
  • ModulesGarden Club's Topics
  • Hungarian International Discussions's Segítség
  • ThemeMetro Club's Topics
  • WHMCS Services Club's Topics
  • WHMCS Global Services Club's Topics
  • Katamaze's Free Scripts
  • Katamaze's Module Support
  • Zomex Club's Topics
  • 0100Dev Club's Topics

WHMCS Version

  • V8.4.x Hotfixes
  • V8.3.x Hotfixes
  • V8.2.x Hotfixes

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me

Found 48 results

  1. I hope someone has knowledge about this .. I find very little information about it. I hope someone helps me. I am trying to prevent users from being able to change some fields in their profile. I found the following function: https://developers.whmcs.com/hooks-reference/everything-else/#customfieldsave <?php add_hook('CustomFieldSave', 1, function($vars) { return array('value' => 'overridden value',); }); this prevents any field from being editable, however, how can I select a specific field? img: someone posted an idea in 2019. however it doesn't work, because fieldid and relid return NULL from $vars any idea? I just need to select the fields that I want to prevent from being edited.
  2. Hello, I am designing a custom order form for myself in whmcs. I changed the domain name selection part when purchasing hosting. I did as in the attached image. The transfer part is not working. In the transfer part, it performs the domain inquiry part. However, when I click the continue button, the domain configuration page does not appear. In other words, the page where I will enter the transfer code does not open, it transfers it directly to the cart. The domain name I selected for the product does not appear in the cart. I will show them all in the appendices below. If it is a javascript-related problem, if there is javascript code that I need to share, if you let me know in the comments, I will share it. I don't know exactly what is causing the problem. I would be glad if you help. Thanks in advance..
  3. whmcs dismisses the best ideas? for developers trying to create a better ecosystem for whmcs "they discard the best ideas" to get into context, some time ago while working with the whmcs API, I noticed that whmcs does not allow including "custom files within /includes/api" I'll leave a link on what I had to do to achieve it: which is absurd if you think about it. if they allowed to include files (within the api roles) they would allow other developers to join the project and add new functions that WHMCS does not yet have. now I take it that someone posted the exact same question but it was discarded: https://requests.whmcs.com/idea/custom-api-support it is very obnoxious that the WHMCS team does not allow one to create their own api functions. it is unfortunate that they do not listen to users. It is unfortunate that the vision of whmcs is not to allow the use of its software as a means of administration, but that we generate our own functions for our projects (in the case of my company, a laravel project). I wonder if the WHMCS team really listens to users. I wonder if they ever have ... I am very disappointed that whmcs does not allow the newly added files to appear in the api folder as shown in these images: as you can see from the images, we are unable to assign the role of the new file. instead I had to modify the table: tblapi_roles within my database directly to manually give the file permissions. WHMCS DOES NOT LISTEN TO ITS CUSTOMERS, WHMCS IS NOT INTERESTED IN THAT WE DO BETTER PROJECT, NOR THAT THE ECOSYSTEM IS IMPROVED! If an admin reads this topic, please understand that I am looking for WHMCS to be used more by developers. Currently we live very limited, the documentation and all the files written in / includes/api lack many features that we developers could include. We could provide more external functionalities. and we would have the ability to develop our own characteristics. this would open the doors much more for new customers to join in purchasing whmcs licenses. In addition to increasing sales of whmcs, it would also allow the possibility of writing our own characteristics, developing new modules that we would publish in the marketplace ecosystem, increasing the number of modules and characteristics that WHMCS currently has. I hope this topic has relevance to both whmcs and external developers. my point of view is that if they allow "Role Management" to detect the files included in /includes/api as roles. (similar to how it works when we add modules and plugins that automatically appear in the whmcs module manager). it would open new doors for developers. I am sure that this functionality could be done with a few lines and in a short time. as a developer I know that this would not take too much work. I hope they understand me. my english is not very good. 🙂
  4. this is a snippet of my quote/contract script it seems to know the recurring but not the onetime, it shows the "unit price" but no the "total price I need to have the one time and payments show up in the contract the 2 hooks you need to add in //term is the call // 1 displays the number of months [term: 1] [recur:36] <?php $pdf->Image(ROOTDIR.'/assets/img/rwclogo.png', 63,10,75,'c'); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',11); $pdf->Cell(175,40,"CONTRACT FOR $subject ONLINE MARKETING SERVICES",25,1,'C'); $total_onetime = 0; $total_recur = array(); foreach ($lineitems AS $item) { $description = $item["description"]; # find term $matches = array(); preg_match('/\[term:(.*?)\]/i', $description, $matches); if (empty($matches)) { $term = ''; } else { $term = strtolower(trim($matches[1])); $description = str_replace($matches[0], '', $description); } # find recur $matches = array(); preg_match('/\[recur:(.*?)\]/i', $description, $matches); if (empty($matches)) { $recur = ''; } else { $recur = strtolower(trim($matches[1])); $description = trim(str_replace($matches[0], '', $description)); } # get unit price and total price $matches = array(); preg_match('/\d+\.\d+/', $item['unitprice'], $matches); $item_unitprice = (float)$matches[0]; $matches = array(); preg_match('/\d+\.\d+/', $item['total'], $matches); $item_total = (float)$matches[0]; # add onetime and recurring totals if ($recur == '') { $total_onetime += $item_total; } else { if (!array_key_exists($recur, $total_recur)) { $total_recur[$recur] = 0; } $total_recur[$recur] += $item_total; } } $pdf->SetFont('freesans','B',9); if ($total_onetime > 0) { } foreach (array('monthly', 'quarterly', 'semi-annually', 'annually', 'biennially') as $recur) { if (isset($total_recur[$recur]) && $total_recur[$recur] > 0) { } unset($total_recur[$recur]); } # any remaining recurs foreach ($total_recur as $recur => $amount) { } #========================================================================== # determine weather to show the ONE TIME payment or not #if ( $total_onetime < 100 ) { #$ot_show = false; #} #else { #$ot_show = true; #} #========================================================================== # determines weather or not to split the initial payment in half #if ( $total_onetime >= 10000 ) { #$bulk = $total_onetime / 2; #$addtl_payment_msg = 'and the second half of $' .$bulk. ', will be due within 60 days. '; #} else { #$bulk = $total_onetime; #$addtl_payment_msg = ''; } #========================================================================== #calculate One time payment using monthly pymts as a varible #========================================================================== #$otpp = ( $total_recur[$recur] * $recur ); #$ots = ( $otpp * .1); #$ots = round( $ots, 2, PHP_ROUND_HALF_UP ); #$otp = $otpp - ($otpp * .1); #$otp = round( $otp, 2, PHP_ROUND_HALF_UP ); #========================================================================== #calculate One time payment and monthly payment to come up with a total #$totalot = ( $total_recur[$recur] * $recur + $bulk ); #$totalot10 = ( $totalot - $ots ); #========================================================================== $pdf->SetDrawColor(255); $pdf->SetFillColor(255); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Authorization:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,C); $pdf->MultiCell(170,5," This document defines the TERMS AND CONDITIONS (T&C) of our working relationship. All projects or services (“the work”) that AGENCY (or “we”) RWC ME 04401 may be contracted to produce or provide for CLIENT ($clientsdetails[companyname]) will be subject to and you the undersigned agree to the following: The CLIENT authorizes the AGENCY access CLIENT's current website, webhost, and all digital materials to transfer as needed from the CLIENT for the purposes of completeing the work on the domain $subject. The CLIENT authorizes use of CLIENT's logo and all brand identification in the creation of the website. The CLIENT understands they are entering into a$pdf->Cell $recur month contract with THE AGENCY. The Agency will only begin work after CLIENT’s approval of the project authorization to proceed,(ATP) and the terms and conditions,(T&C) and after receipt of payment of the initial invoice $".$total_onetime. ". Your signature/execution of the ATP and the T&C will constitute an AGREEMENT between us. "); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Description of the work:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5,"$notes",0,1,'C'); if ($proposal) { $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Installment Plan:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5,$proposal ); } $pdf->AddPage(); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Approvals:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5," $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Additions and Alterations:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,C); $pdf->MultiCell(170,5," "); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Payments:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5,"The AGENCY is providing Online Marketing Services in advance of total payment. The CLIENT will have an initial down payment of $" . $bulk . ". that is due at the signing of this contract, " .$addtl_payment_msg. "Then an ongoing payment of $pdf->Cell $$total_recur[$recur], on a monthly basis for the following$pdf->Cell $recur months, starting from the date of signing this agreement. " ); $pdf->MultiCell(170,5,""); $pdf->AddPage(); $pdf->Image(ROOTDIR.'/assets/img/rwclogo.png', 63,10,75,'c'); $pdf->SetFont('freesans','B',11); $pdf->Ln(); $pdf->SetFont('freesans','B',9); $pdf->Ln(); $pdf->SetFont('freesans','',9); $pdf->MultiCell(39,5,""); $pdf->Ln(); $pdf->SetFont('freesans','B',9); $pdf->SetDrawColor(200); $pdf->SetFillColor(239); $pdf->SetFont('freesans','',9); $pdf->Cell(10,6,"Qty",1,0,'C','1'); $pdf->Cell(80,6,"Description",1,0,'C','1'); $pdf->Cell(20,6,"Recur",1,0,'C','1'); $pdf->Cell(20,6,"Term",1,0,'C','1'); $pdf->Cell(20,6,"Unit Price",1,0,'C','1'); $pdf->Cell(20,6,"Total",1,0,'C','1'); $pdf->Ln(); $pdf->SetFont('freesans','B',9); $total_onetime = 0; $total_recur = array(); foreach ($lineitems AS $item) { $description = $item["description"]; #========================================================================== # find term #========================================================================== $matches = array(); preg_match('/\[term:(.*?)\]/i', $description, $matches); if (empty($matches)) { $term = ''; } else { $term = strtolower(trim($matches[1])); $description = str_replace($matches[0], '', $description); } #========================================================================== # find recur #========================================================================== $matches = array(); preg_match('/\[recur:(.*?)\]/i', $description, $matches); if (empty($matches)) { $recur = ''; } else { $recur = strtolower(trim($matches[1])); $description = trim(str_replace($matches[0], '', $description)); } #========================================================================== # get unit price and total price #========================================================================== $matches = array(); preg_match('/\d+\.\d+/', $item['unitprice'], $matches); $item_unitprice = (float)$matches[0]; $matches = array(); preg_match('/\d+\.\d+/', $item['total'], $matches); $item_total = (float)$matches[0]; #========================================================================== # add onetime and recurring totals #========================================================================== if ($recur == '') { $total_onetime += $item_total; } else { if (!array_key_exists($recur, $total_recur)) { $total_recur[$recur] = 0; } $total_recur[$recur] += $item_total; } #========================================================================== # display line items #========================================================================== $numlines = ceil(strlen($description)/55); $cellheight = $numlines * 8; $pdf->MultiCell(10,$cellheight,$item["qty"],1,'C','',0); $pdf->MultiCell(80,$cellheight,$description,1,'L','',0); $pdf->MultiCell(20,$cellheight,$recur,'1','C','',0); $pdf->MultiCell(20,$cellheight,$term,'1','C','',0); $pdf->MultiCell(20,$cellheight,sprintf('$%.2f',$item_unitprice),1,'C','',0); $pdf->MultiCell(20,$cellheight,sprintf('$%.2f',$item_total),1,'C','',1); } $pdf->SetFont('freesans','B',9); /* $pdf->Cell(145,6,"Subtotal",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$subtotal,1,0,'C','1'); $pdf->Ln(); if ($taxlevel1["rate"]>0) { $pdf->Cell(145,6,$taxlevel1["name"]." @ ".$taxlevel1["rate"]."%",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$tax1,1,0,'C','1'); $pdf->Ln(); } if ($taxlevel2["rate"]>0) { $pdf->Cell(145,6,$taxlevel2["name"]." @ ".$taxlevel2["rate"]."%",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$tax2,1,0,'C','1'); $pdf->Ln(); } $pdf->Cell(145,6,"Total",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$total,1,0,'C','1'); $pdf->Ln(); */ if ($total_onetime > 0) { $pdf->Cell(150,6,'Pre-Pay',1,0,'R',1); $pdf->Cell(20,6,sprintf('$%.2f',$total_onetime),1,0,'C',1); $pdf->Ln(); } foreach (array('monthly', 'quarterly', 'semi-annually', 'annually', 'biennially') as $recur) { if (isset($total_recur[$recur]) && $total_recur[$recur] > 0) { $pdf->Cell(150,6,ucfirst($recur) . ' Monthly Payments',1,0,'R',1); $pdf->Cell(20,6,sprintf('$%.2f',$total_recur[$recur]),1,0,'C',1); $pdf->Ln(); } unset($total_recur[$recur]); } #========================================================================== # any remaining recurs #========================================================================== foreach ($total_recur as $recur => $amount) { $pdf->Cell(150,6,ucfirst($recur) . ' Monthly Payments',1,0,'R',1); $pdf->Cell(20,6,sprintf('$%.2f',$amount),1,0,'C',1); $pdf->Ln(); } $pdf->SetFont('freesans','',9,l); $pdf->MultiCell(170,5,"
  5. I have change php version 7.3 to 7.4 from cPanel. I also edit cron job command and change opt/alt/php73/usr/bin/php -q /*****/****/****/crons/cron.php to opt/alt/php74/usr/bin/php -q /*****/****/****/crons/cron.php but I got error on system health check page on my WHMCS. How can I solve this issue?
  6. while working with the api I realized that getproducts (https://developers.whmcs.com/api-reference/getproducts/) does not bring up the field to know if the product is active or not. I saw someone post a similar idea several years ago: so with a little engineer I made my own version of getproducts and uploaded it to /includes/api/ Request Parameters "GetProductsActive" Parameter Type Description Required action string “GetProductsActive” Required pid int string Obtain a specific product id configuration. Can be a list of ids comma separated gid int Retrieve products in a specific group id Optional Response Parameters Parameter Type Description result string The result of the operation: success or error totalresults int The total number of results available startnumber int The starting number for the returned results numreturned int The number of results returned products array An array of products matching the criteria passed I will leave the file called: getproductsactive.php however this may throw an api error, you have to give access in the table tblapi_roles in database, in the field: permissions add: ,"getproductsactive": 1 before closing }, This modification is due to WHMCS not showing the files added in includes/api as a role. (I do not know why). With this you can get the field: hidden which defines 0 if it is visible and 1 if it is hidden. (true or false also works) my code is a copy of includes/api/getproduct.php just add to show the hidden field (, "hidden" => $data["hidden"]), this would have been easier if WHMCS implemented it, it only took me 2 minutes to show this field. <?php if (!defined("WHMCS")) { exit("This file cannot be accessed directly"); } if (!function_exists("getCustomFields")) { require ROOTDIR . "/includes/customfieldfunctions.php"; } if (!function_exists("getCartConfigOptions")) { require ROOTDIR . "/includes/configoptionsfunctions.php"; } global $currency; $currency = getCurrency(); $pid = $whmcs->get_req_var("pid"); $gid = $whmcs->get_req_var("gid"); $module = $whmcs->get_req_var("module"); $where = array(); if ($pid) { if (is_numeric($pid)) { $where[] = "tblproducts.id=" . (int) $pid; } else { $pids = array(); foreach (explode(",", $pid) as $p) { $p = (int) trim($p); if ($p) { $pids[] = $p; } } if ($pids) { $where[] = "tblproducts.id IN (" . implode(",", $pids) . ")"; } } } if ($gid) { $where[] = "gid=" . (int) $gid; } if ($module && preg_match("/^[a-zA-Z0-9_\\.\\-]*\$/", $module)) { $where[] = "servertype='" . db_escape_string($module) . "'"; } $result = select_query("tblproducts", "tblproducts.*", implode(" AND ", $where), "tblproductgroups`.`order` ASC, `tblproductgroups`.`id` ASC, `tblproducts`.`order` ASC, `tblproducts`.`id", "ASC", "", "tblproductgroups ON tblproducts.gid = tblproductgroups.id"); $apiresults = array("result" => "success", "totalresults" => mysql_num_rows($result)); while ($data = mysql_fetch_array($result)) { $pid = $data["id"]; $productarray = array("pid" => $data["id"], "gid" => $data["gid"], "type" => $data["type"], "name" => $data["name"], "description" => $data["description"], "module" => $data["servertype"], "paytype" => $data["paytype"], "hidden" => $data["hidden"]); if ($language = $whmcs->get_req_var("language")) { $productarray["translated_name"] = WHMCS\Product\Product::getProductName($data["id"], $data["name"], $language); $productarray["translated_description"] = WHMCS\Product\Product::getProductDescription($data["id"], $data["description"], $language); } if ($data["stockcontrol"]) { $productarray["stockcontrol"] = "true"; $productarray["stocklevel"] = $data["qty"]; } $result2 = select_query("tblpricing", "tblcurrencies.code,tblcurrencies.prefix,tblcurrencies.suffix,tblpricing.msetupfee,tblpricing.qsetupfee,tblpricing.ssetupfee,tblpricing.asetupfee,tblpricing.bsetupfee,tblpricing.tsetupfee,tblpricing.monthly,tblpricing.quarterly,tblpricing.semiannually,tblpricing.annually,tblpricing.biennially,tblpricing.triennially", array("type" => "product", "relid" => $pid), "code", "ASC", "", "tblcurrencies ON tblcurrencies.id=tblpricing.currency"); while ($data = mysql_fetch_assoc($result2)) { $code = $data["code"]; unset($data["code"]); $productarray["pricing"][$code] = $data; } $customfieldsdata = array(); $customfields = getCustomFields("product", $pid, "", "", "on"); foreach ($customfields as $field) { $customfieldsdata[] = array("id" => $field["id"], "name" => $field["name"], "description" => $field["description"], "required" => $field["required"]); } $productarray["customfields"]["customfield"] = $customfieldsdata; $configoptiondata = array(); $configurableoptions = getCartConfigOptions($pid, array(), "", "", "", true); foreach ($configurableoptions as $option) { $options = array(); foreach ($option["options"] as $op) { $pricing = array(); $result4 = select_query("tblpricing", "code,msetupfee,qsetupfee,ssetupfee,asetupfee,bsetupfee,tsetupfee,monthly,quarterly,semiannually,annually,biennially,triennially", array("type" => "configoptions", "relid" => $op["id"]), "", "", "", "tblcurrencies ON tblcurrencies.id=tblpricing.currency"); while ($oppricing = mysql_fetch_assoc($result4)) { $currcode = $oppricing["code"]; unset($oppricing["code"]); $pricing[$currcode] = $oppricing; } $options["option"][] = array("id" => $op["id"], "name" => $op["name"], "rawName" => $op["rawName"], "recurring" => $op["recurring"], "required" => $op["required"], "pricing" => $pricing); } $configoptiondata[] = array("id" => $option["id"], "name" => $option["optionname"], "type" => $option["optiontype"], "options" => $options); } $productarray["configoptions"]["configoption"] = $configoptiondata; $apiresults["products"]["product"][] = $productarray; } $responsetype = "xml"; ?> Hope this helps others to show the field they need to show files and hidden products. getproductsactive.php
  7. Hello, I'm trying to get some way to query if a user is online. I don't want to know the current user. if not something you can define for example $clientid or $userid or $emailclient ... I am making an external site. and i need to work with user sessions. (I am making a remote connection with the api). this function does not currently exist in the api available. I've been seeing this: https://developers.whmcs.com/advanced/authentication/ however I do not see that it allows to define the user. I was also seeing this: https://docs.whmcs.com/Sessions I was able to save the cookie in the database, however I can't find any way to identify the one that belongs to each user. any idea how I can get (which users are online?) .. (please nothing to do with smarty, only php). postdata: forget to tell the method I use to get user authentication in my application. create the following code for my application: I first make a connection to the api: https://developers.whmcs.com/api/authentication/ soon ValidateLogin: https://developers.whmcs.com/api-reference/validatelogin/ soon GetClientsDetails: https://developers.whmcs.com/api-reference/getclientsdetails/ soon CreateSsoToken: https://developers.whmcs.com/api-reference/createssotoken/ // validar usuario $command = 'ValidateLogin'; $postData = array( 'email' => $email_user, //post 'password2' => $password_user, //post ); $api_login = localAPI($command, $postData); //var de id de usuario: $api_login["userid"]; // si se encuentra el user entonces traer detalles del usuario via email $clientid = array(); // array que tiene el id del cliente if ($api_login["userid"] == true) { $command = 'GetClientsDetails'; $postData = array( 'email' => $email_user, // email login ); $details_client = localAPI($command, $postData); $clientid[] = $details_client["client_id"]; } // variable del clientid es: $clientid[0]; // crear token de session $command = 'CreateSsoToken'; $postData = array( 'client_id' => $clientid[0], ); $results_ssotoken = localAPI($command, $postData); echo '<pre>'; var_dump($results_ssotoken); echo '</pre>'; this will create the url with (CreateSsoToken) where the user will be redirected for autologin, however the cookie is created only after entering the client area. that's why I don't know how to get the cookie, or identify the user. @brian! would you help me with this?
  8. Hello I have a variable that is printed with {debug} in the tpl template. however I want to get the result in php of this variable. I need to get $customfields from a hook. how could you access $customfields that is printed inside a product @brian! could you help me?
  9. 1. Plesk Extended For WHMCS 3.5.0 Because your system can never suffer from too many user-friendly features, today we are storming ahead with a solid update of Plesk Extended For WHMCS 3.5.0 that is about to nurture your web hosting business in more than a few different ways: Take maximum advantage of the newly introduced support for WHMCS V8.1 and "Twenty-One" theme. In order to limit the system resources consumed by PHP scripts, your clients are now allowed to use a custom PHP version and configurations per website. While in the comfy surroundings of the client area, let us also move a bit further to the new "Log Rotation" section where your customers can manage conditions for the log files to be cleaned up once they are too old or too big. Be sure to enjoy the full changelog available on our website! 2. SMS Center For WHMCS 3.8.0 Just as much deserving of a special mention is SMS Center For WHMCS, specifically because of its spanking-new 3.8.0 update! The module’s scope of support has been broadened to integrate well with as many as five all-new SMS gateways. Thanks to it, the official list of available SMS gateways now includes 51 providers in total! Additionally, the product has also received a series of tweak-ups so as to secure its rock-solid compatibility with both WHMCS V8.1 and "Twenty-One" system theme. Keep in touch with your customers no matter the time and place! 3. Under the Microscope: MetricsCube Live Dashboard for WHMCS Reading through your business data feels as though you were reading a foreign language? Live Dashboard for WHMCS that forms a central part of MetricsCube communicates crucial metrics in a visual format to make all complex relationships in your data self-explanatory. Drop by the MetricsCube blog as soon as you can to get a close-up look at every single report and graph illustrating the real-time performance of your WHMCS business down to the last detail. Take an insightful stroll through the data-filled confines of Live Dashboard! Need Custom Software Development For Your Business? Get Your Free Quote Now! Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
  10. Hi, How do I make a registration in html (php) sending a request to WHMCS? Example: <form action="{$systemsslurl}dologin.php?goto=clientarea.php" method="post" name="frmlogin"> <label>Email address</label> <input type="email" name="username" placeholder="Your Email"> <label>Password</label> <input type="password" name="password"> <button type="submit">Login</button> </form> <a href="/pwreset.php" >Forgotten your Password? Click Here</a> But how do I implement this for registration? is it possible to do this?
  11. sometimes the client can have 2 emails. one for your account details and one for the account owner. I need to know if the account owner's email is verified. The var: $client = Menu::context("client"); gets the email that the customer has in the account details, however this is not the email owner of the account. I hope to make myself understood correctly.
  12. Hi, Sorry if this has been asked before but i can seem to find any solution for it! I am looking for a way to display a "Network Status" icon/ css on the home page of my website based on the WHMCS network status rss feed (https://portal.whmcs.com/networkstatusrss.php). The concept is to have the icon/css auto change when one of the following network issues are opened rather then having to change it manually. Low Medium High Critical Attached is an illustration of what i am looking at doing. PS: I already wrote the css to have pluse icons, just need to implement the second part. Thank you in advance! 😁
  13. What's the best way to add a snippet of PHP inside a .tpl file? It looks like everybody recommends against using the {php}{/php} bracket for security reason. Should I be creating my .php snippet file in root WHMCS directory and just using include to beam it in? {php} include "my-php-snippet.php"; {/php} I'm looking to "add recent wordpress posts to non wordpress site" and they all involve adding php snippet to include the wp-load.php file. It'd be cool if I can avoid using an <iframe> too. This is the snippet I'd like to add a .tpl page: <?php // Include the wp-load'er include('/public_html/wordpress/wp-load.php'); // Get the last 10 posts // Returns posts as arrays instead of get_posts' objects $recent_posts = wp_get_recent_posts(array( 'numberposts' => 10 )); // Do something with them echo '<ul>'; foreach($recent_posts as $post) { echo '<li><a href="', get_permalink($post['ID']), '">', $post['post_title'], '</a></li>'; } echo '</ul>'; ?> * whmcs 7.4 is installed on root domain, and the wordpress site is installed in a subfolder * https://davidwalsh.name/wordpress-recent-posts * https://www.webmoves.net/blog/web-design-development/display-wordpress-posts-outside-of-wordpress-3081/
  14. Hi, I wrote an PHP utility for importing domains from an old administrative panel. The utility creates new order then confirm it. We were using nicIT for .it domains and ascio for the others tld; all worked fine, A few days ago we added internetbs and now when trying to create the order for .com domains (still managed by ascio) the AddOrder API returns a null response although the order is created and left in 'pending' status. With .it domains still works fine. Any idea ? is it possible to get a sort of log where to look for the reason the API call does not work properly ?
  15. Hi All, On my System Health Status Page and the Dashboard it says..... PHP Version Your PHP version 7.2.29 is supported by WHMCS. The PHP 7.2 branch no longer receives regular bug fixes and will only receive critical security updates until it reaches its end of life. Please see our documentation for more information. but my Hosting Server is running version 7.4 of PHP (See Screenshot attached) Do i need to run something in WHMCS to update the System Health Page so the warning goes away ? I am Running WHMCS 7.10 (Latest Version), but the warning is not new and was also in previous WHMCS Version. Cheers Giles
  16. Hi guys, I have a php file executing some mysql queries with variables parsed by Ajax , this is why i can't do the queries directly in php tags in the WHMCS template. So basically there is a query.php file that i need to export the session variable to for further usage. I need this variable in that file {php} echo $_SESSION['uid']; {/php} so i can use it for further manipulations.
  17. I am trying to create a custom WHMCS page without any sidebars. I only want it to show the top bar where clients can choose language, etc. I have this code currently: <?php define("CLIENTAREA",true); //define("FORCESSL",true); // Uncomment to force the page to use https:// require("init.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle("Support Center"); $ca->addToBreadCrumb('index.php',$whmcs->get_lang('globalsystemname')); $ca->addToBreadCrumb('support.php','HostAble Support'); $ca->addToBreadCrumb('support-center.php','Support Center'); $ca->initPage(); # Check login status if ($ca->isLoggedIn()) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".$ca->getUserID()); $data = mysql_fetch_array($result); $clientname = $data[0]; $ca->assign('clientname', $clientname); } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $ca->setTemplate('supportcenter'); $ca->output(); ?> But obviously it isnt working, it just shows the page but with the sidebars and navigation bar too. Thank you if you can help me :)
  18. Hello, I'm working on an Addon Module to store a License Key for an addon. I can have it verify the get the license key from the table.. but what I'm trying to do is figure out how to put a check_license within this: class License extends Model { /** @var string $table The table in which the addon settings are stored. (mod_mylicensetable) */ protected $table = 'mod_squareLicensing'; //protected function results($results); private $vString = "16da9d4d6fc1e1ec25ce622d59d3d34e2b147bed894296693492985d85d27868"; } $Licensedata = License::where('id', '1')->first( As such, I can get my License data as expected, however, within the Addon Module itself -- to ideally get everything, the check needs to be inside the Class. I'd like to do something like function verify_license { //--get information from original license call and do our actions for invalid or active } Can someone give me guidance? I'm new working with Laravel. I know how to do a license call with the default check_sample.php and have adapted that as needed, and have built upon it.. but working with the classes are new to me. Any help and pointers would be greatly appreciated 🙂
  19. Hi all, Grizzlyware has just released Ranger for WHMCS, which will allow you to generate, manage and distribute license keys for software that you sell, via WHMCS. It's much like the WHMCS 'Licensing' module, however it has only just been released, so while it's fully functional and full featured, there is more to be added. We built Ranger to satisfy our own needs, it's open source and allows developers to license their software in the field. This is a WHMCS module which uses the Ranger framework. You can of course use the Ranger library on its own if you prefer. The module is bundled with email templates too. It's free - There is no charge for this module or the Ranger framework, all of the source code is available online as well as a packaged up WHMCS module. More information can be found here: https://www.grizzlyware.com/apps/whmcs/ranger/ We will have more WHMCS modules coming out in the not too distant future too. With that said, we just released 'Email Catcher' which scans your ticket replies for mismatched client email addresses (so you don't send an email address to the wrong client). Any questions or confusion, please give me a shout. Thank you, Josh
  20. Hello, I am trying to create a hook for adding a new element in sidebar. I have created the hook. add_hook('ClientAreaPrimarySidebar', 1, function($primarySidebar) { /* @var \WHMCS\View\Menu\Item $primarySidebar */ $newMenu = $primarySidebar->addChild( 'accountmanager', array( 'name' => 'Home', 'label' => Lang::trans('account_manager'), 'order' => 1, 'icon' => 'fas fa-life-ring', ) ); $newMenu->addChild( 'accountmanager', array( 'label' => Lang::trans('account_manager_label'), ) ); }); I am trying somehow to get the userid, and assign it to a variable. And is it possible to be used in translations? I tried with this one here but it's not working: $variable = $template->getVariable('variablename')->value; $template->assign('variablename ', 'variable');
  21. Hello, I got to thinking.. For the license module, if you have different license tiers, and want to offer auto upgrades.. Could you make a page like this: https://www.whmcs.com/members/autoupgrade.php With using bootstrap like that.. I know it's possible, but does this somehow manage a custom field within WHMCS? I've always thought about that! I'd love to know your thoughts, as I'd love to build something like it!
  22. Hello, I made a Square Gateway, which is in the Marketplace. The issue right now, is it's coded with PHP, and has to rely on allowing it to run with the php smarty tags, which aren't recommended. Is there an alternative way to avoid Smarty PHP tags? Thanks!
  23. I found a old pretty cool script and i would like to perform him because like as been reported before the hook put the admin area with infinite loops <?php add_hook('ClientAreaPage', 1, switch_language($vars)); function switch_language($vars) { $country_to_language = array( 'default' => 'english', 'AR' => 'arabic', 'AR-DZ' => 'arabic', 'AR-BH' => 'arabic', 'AR-EG' => 'arabic', 'AR-IQ' => 'arabic', 'AR-JO' => 'arabic', 'AR-KW' => 'arabic', 'AR-LB' => 'arabic', 'AR-LY' => 'arabic', 'AR-MA' => 'arabic', 'AR-OM' => 'arabic', 'AR-QA' => 'arabic', 'AR-SA' => 'arabic', 'AR-SY' => 'arabic', 'AR-TN' => 'arabic', 'AR-AE' => 'arabic', 'AR-YE' => 'arabic', 'AZ' => 'azerbaijani', 'CA' => 'catalan', 'ZH' => 'chinese', 'ZH-HK' => 'chinese', 'ZH-CN' => 'chinese', 'ZH-SG' => 'chinese', 'ZH-TW' => 'chinese', 'HR' => 'croatian', 'CS' => 'czech', 'DA' => 'danish', 'NL' => 'dutch', 'NL-BE' => 'dutch', 'EN' => 'english', 'EN-AU' => 'english', 'EN-BZ' => 'english', 'EN-CA' => 'english', 'EN-IE' => 'english', 'EN-JM' => 'english', 'EN-NZ' => 'english', 'EN-PH' => 'english', 'EN-ZA' => 'english', 'EN-TT' => 'english', 'EN-GB' => 'english', 'EN-US' => 'english', 'EN-ZW' => 'english', 'ET' => 'estonian', 'FA' => 'farsi', 'FR' => 'french', 'FR-BE' => 'french', 'FR-CA' => 'french', 'FR-FR' => 'french', 'FR-LU' => 'french', 'FR-MC' => 'french', 'FR-CH' => 'french', 'DE' => 'german', 'DE-AT' => 'german', 'DE-DE' => 'german', 'DE-LI' => 'german', 'DE-LU' => 'german', 'DE-CH' => 'german', 'HE' => 'hebrew', 'HU' => 'hungarian', 'IT' => 'italian', 'IT-CH' => 'italian', 'MK' => 'macedonian', 'NO' => 'norwegian', 'NB' => 'norwegian', 'NN' => 'norwegian', 'PT-BR' => 'portuguese-br', 'PT' => 'portuguese-pt', 'RO' => 'romanian', 'RO-MO' => 'romanian', 'RU' => 'russian', 'RU-MO' => 'russian', 'ES' => 'spanish', 'ES-AR' => 'spanish', 'ES-BO' => 'spanish', 'ES-CL' => 'spanish', 'ES-CO' => 'spanish', 'ES-CR' => 'spanish', 'ES-DO' => 'spanish', 'ES-EC' => 'spanish', 'ES-SV' => 'spanish', 'ES-GT' => 'spanish', 'ES-HN' => 'spanish', 'ES-MX' => 'spanish', 'ES-NI' => 'spanish', 'ES-PA' => 'spanish', 'ES-PY' => 'spanish', 'ES-PE' => 'spanish', 'ES-PR' => 'spanish', 'ES-ES' => 'spanish', 'ES-UY' => 'spanish', 'ES-VE' => 'spanish', 'SV' => 'swedish', 'SV-FI' => 'swedish', 'SV-SV' => 'swedish', 'TR' => 'turkish', 'UK' => 'ukranian', // NOTE: You can add more below ); if(!isset($_SESSION['switch-language']) && $_SESSION['uid'] == false) { $_SESSION['switch-language'] = true; // prevent from redirecting back again in this session } $current_country = strtoupper(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)); $language = $current_country != '' && isset($country_to_language[$current_country]) ? $country_to_language[$current_country] : $country_to_language['default']; if(!isset($_SESSION['Language']) || $_SESSION['Language'] != $language) { $location = '?language='.$language; if($_SERVER['QUERY_STRING'] != '') $location .= '&'.$_SERVER['QUERY_STRING']; ob_clean(); header('location: '.$location); die(); } } ?> some one have one idea to do a work arround, he give so many loops on admin area like this administator/?language=portuguese-pt&language=portuguese-pt&language=portuguese-pt&amp;lang... so there is any suggestion to fix this old good script he works great for client area but no for admin area ☹️ credits for, @webix @Remitur @brian!
  24. Hi @ all, got some problems with modifying the configuredomains.tpl This is what I have at the moment : This is what I would like to have : That's the part that drives me to despair : {foreach key=domainfieldname item=domainfield from=$domain.fields} <div class="form-group"> <label class="{$responsio.classes.col}-3 {$responsio.classes.label} control-label">{$domainfieldname}</label> <div class="{$responsio.classes.col}-8"> {if $domainfield.type == "tickbox"}<div class="checkbox {$responsio.classes.checkbox}">{$domainfield}</div>{else}{$domainfield|replace:"type=\"text\"":"type=\"text\" class=\"form-control `$responsio.classes.input`\""|replace:"type=\"password\"":"type=\"password\" class=\"form-control `$responsio.classes.input`\""|replace:"<select":"<select class=\"form-control `$responsio.classes.input`\""|replace:"<textarea":"<textarea class=\"form-control `$responsio.classes.input`\""|replace:"style=\"width:90%;\"":""}{/if} </div> </div>{/foreach} Maybe someone has an idea how I could solve it . Thanks and best regards Christian
  25. I found an older post regarding this but I wanted to post a working hook that adds recaptcha to the checkout page. I think this a great thing especially if you're being bombarded with fake accounts and orders. /includes/hooks/checkout-recaptcha.php: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); function limitOrders($vars) { $url = 'https://www.google.com/recaptcha/api/siteverify'; $privatekey = "YOUR_RECAPTCHA_SECRET_KEY_HERE"; $response = file_get_contents($url . "?secret=" . $privatekey . "&response=" . $_POST['g-recaptcha-response'] . "&remoteip=" . $_SERVER['REMOTE_ADDR']); $data = json_decode($response); if (isset($data->success) AND $data->success == true) { // everything is ok! } else { $pm = $vars['paymentmethod']; if ($pm == "paypalpaymentspro") { global $errormessage; $errormessage.= "<li> Please, confirm that you are not a robot! <br/></li>"; } //if CC } } //function add_hook("ShoppingCartValidateCheckout", 1, "limitOrders"); Change YOUR_RECAPTCHA_SECRET_KEY_HERE to your the recaptcha private/secret key Google gives you. I'm using for my credit card checkout which is "paypalpaymentspro" but you can use it for any payment method. I think you really only need if you accept credits though. To get your payment method view source on the checkout page and search for "paymentmethod" your payment method will be near this. In your checkout.tpl file you also need to add somewhere under the "Complete Payment" button: <div class="g-recaptcha" data-sitekey="YOUR_RECAPTCHA_PUBLIC_KEY_HERE"></div> Replace YOUR_RECAPTCHA_PUBLIC_KEY_HERE with your public recaptcha key provided by Google. This is tested working on WHMCS v7.5.1.
  • 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