Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Added New menu to whmcs clientarea and its working fine. But i am facing the issue, that when a customer clicks on it, its opens on same window. how can i set to open it on seperate window or tab, <?php #adding Menu Item to primaryNavbar use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $primaryNavbar->addChild('Premium Support') ->setUri('My url') ->setOrder(70); });
  3. Today
  4. I create this in configureproduct.tpl now its working <script> function makeid(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for (var i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } function generatePass(pLength){ var keyListAlpha="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", keyListInt="123456789", keyListSpec="!@#$%^&*_-+=?", password=''; var len = Math.ceil(pLength/2); len = len - 1; var lenSpec = pLength-2*len; for (i=0;i<len;i++) { password+=keyListAlpha.charAt(Math.floor(Math.random()*keyListAlpha.length)); password+=keyListInt.charAt(Math.floor(Math.random()*keyListInt.length)); } for (i=0;i<lenSpec;i++) password+=keyListSpec.charAt(Math.floor(Math.random()*keyListSpec.length)); password=password.split('').sort(function(){return 0.5-Math.random()}).join(''); return password; } $(document).ready(function() { $('#inputHostname').val('' + makeid({/literal}{$hostname_interfix}{literal}) + '{/literal}{$hostname_prefix}{$hostname_suffix}{literal}') }); $(document).ready(function() { $('#inputRootpw').val(generatePass(14)); }); </script>
  5. I believe there is problem with this part of updating db with new details...
  6. add_hook('OverrideModuleUsernameGeneration', 1, function($vars) should i change taht OverrideModuleUsernameGeneration ?
  7. Nothing , it like din't work . still have another special string $digits = '0123456789'; $chars = 'abcdefghijklmnopqrstuvwxyz'; $special = '!@#$%^&*?'; // Plesk does not consider (, ), -, = and + as special characters
  8. What error do you get? And yes it is an hook.
  9. Sorry , its not working my version is 8.5.1
  10. already added the code to hook folder with file name clntareasidebarhooks.php
  11. Hello, I was facing SEO "duplicate contents" issues in whmcs due to whmcs multi-language and cart pages indexed in google. So to prevent google indexing, I edited the modules/{template}/header.tpl. And add the below tag; I believe it will avoid google indexing of clientarea.php "pages", login and register and cart. Since we are using WHMCS KBs for writing FAQs and support articles, we must allow KB pages to be indexed in Search engines. But we need to avoid multiple language page indexing. Because it harms our website SEO, can anyone suggest something to fix this? {if $filename=='clientarea' or $filename=='login' or $filename=='register' or $filename=='cart'} <meta name="robots" content="noindex,nofollow" /> {else} <meta name="robots" content="index,follow" /> {/if} We are using whmcs "lagom" templates. How we can fix KB multi language page duplicate entries and avoid SEO issues.
  12. Shockingly (lol) the docs are slightly wrong. The $domain is an array, that is holding a "domain" item that is then the Domain object. So it should be: <?php add_hook('ClientAreaDomainDetailsOutput', 1, function($domain) { //passed $domain might be object or might be array, lets test if (is_array($domain)) $domain = $domain['domain']; // Replace domain array with domain object $domainName = $domain->domain; $clientModel = $domain->client; $domainStatus = $domain->status; $clientName = $clientModel->firstName . ' ' . $clientModel->lastName; return 'You can place any HTML here that will be output in the $hookOutput smarty variable array'; }); Would have been quite surprised if it was indeed a domain object but maybe that is in a later version than my dev is at right now. Also, objects are great and embrace them you will. 😉 Whenever you are questioning what WHMCS is giving you, just do: logActivity("What is this junk: ".print_r($the_thing,true)); or logModuleCall("hook-hookname", 'I-did-it', "I asked for this and got", "only this short message", $processedData, $replaceVars);
  13. Put the hook file in to WHMCS_install/includes/hooks.
  14. Yesterday
  15. The sample code in doc about ClientAreaDomainDetailsOutput ( https://developers.whmcs.com/hooks-reference/output/#clientareadomaindetailsoutput ) seems to wrong: <?php add_hook('ClientAreaDomainDetailsOutput', 1, function($domain) { $domainName = $domain->domain; $clientModel = $domain->client; $domainStatus = $domain->status; $clientName = $clientModel->firstName . ' ' . $clientModel->lastName; return 'You can place any HTML here that will be output in the $hookOutput smarty variable array'; }); $domain is an object, not an array, and so $domainName in sample code is null ... I could convert the object in array and then parsing it, but I guess there should be a smarter way (that I don't know because I hate objects ... 😄 ) Any smart idea to retrieve domain data?
  16. Hi thanks for posting. I sent an email to support and they just gave me the usual canned reply, so not very helpful. Good to know I'm not alone and that there might be a fix coming. Kinkly keep this post updated, thank you.
  17. i would like to add a small image to the left side of clientarea home page. so i added a hook page like this. But after that what to do next.? <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); add_hook('ClientAreaSidebars', 1, function() { GLOBAL $smarty; $templatefile = $smarty->getVariable('templatefile'); $allowedpages = ['clientareahome','homepage','knowledgebase']; if (in_array($templatefile, $allowedpages)) { $secondarySidebar = Menu::secondarySidebar(); $title = 'Image Banner'; $bodyHtml = '<div> <div> <div> <a href=""> <img src="https://dummydomain.tld/clients/images/kbaseimages/bharat_pey_qr.jpg" height="95px"> <div> <h4>Los Angeles</h4> </div> </a> </div> </div> </div>'; } });
  18. Have you tried {$ticket_link} instead?
  19. Whmcs confirmed it’s a bug and was able to replicate it on their own install MODULE-7849 Has been created for me and it’s now a waiting game. Hopefully a patch willbe released.
  20. Im my sms clients template i missed {currency} variable value code have 'variables' => '{firstname}, {lastname}, {duedate}, {total}, {invoiceid}, {currency}' When my user getting sms they also missing country code like USD or BDT they getting first name last name and ammount perfect but missing country code only . My hook full code blew can any one suggest what is missing or wrong in the code? <?php $hook = array( 'hook' => 'InvoiceCreated', 'function' => 'InvoiceCreatedWa', 'description' => array( 'english' => 'After Invoice Creation' ), 'type' => 'client', 'extra' => '', 'defaultmessage' => 'Hello {firstname} {lastname}, Your invoice with id {invoiceid} has been generated. Total amount is {currency} {total}. The last day of payment is {duedate}. Kindly pay your bill before due date to use services without interruption', 'variables' => '{firstname}, {lastname}, {duedate}, {total}, {invoiceid}, {currency}' ); if(!function_exists('InvoiceCreatedWa')){ function InvoiceCreatedWa($args){ $api = new wamessenger(); $template = $api->getTemplateDetails(__FUNCTION__); if($template['active'] == 0){ return null; } $settings = $api->apiSettings(); if(!$settings['api_key'] || !$settings['api_token']){ return null; } $userSql = " SELECT a.total,a.duedate,b.id as userid,b.firstname,b.lastname,b.currency,`b`.`country`,`b`.`phonenumber` as `gsmnumber` FROM `tblinvoices` as `a` JOIN tblclients as b ON b.id = a.userid WHERE a.id = '".$args['invoiceid']."' LIMIT 1 "; $result = mysql_query($userSql); $num_rows = mysql_num_rows($result); if($num_rows == 1){ $UserInformation = mysql_fetch_assoc($result); $currency_sql=mysql_query('SELECT code FROM tblcurrencies WHERE id='.$UserInformation['currency']); $replace_currency=""; if(mysql_num_rows($currency_sql) > 0){ $currency_result=mysql_fetch_assoc($currency_sql); $replace_currency=$currency_result['code']; } $template['variables'] = str_replace(" ","",$template['variables']); $replacefrom = explode(",",$template['variables']); $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$api->changeDateFormat($UserInformation['duedate']),$UserInformation['total'],$args['invoiceid'],$replace_currency); $message = str_replace($replacefrom,$replaceto,$template['template']); $api->setCountryCode($UserInformation['country']); $api->setGsmnumber($UserInformation['gsmnumber']); $api->setMessage($message); $api->setUserid($UserInformation['userid']); $api->send(); } } } return $hook;
  21. You can use phpMyAdmin. Remember to take a backup first!
  22. We too are now getting this error, did you find a fix?
  23. Hey! No idea. This is how it looks in the back-end.
  24. What is producing those [square brackets] in that? Links should be in the form of href="https....". No square brackets anywhere.
  1. Load more activity
×
×
  • 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