Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 03/21/2019 in all areas

  1. 2 points
    I assume you know that the sidebar already exists, but is only shown on the invoices page? no you don't - if the client is logged in, you can access the $clientsstats Smarty array from the hook and the variables you need are already there (effectively it's just the same as accessing $vars) - there's no need to go looping though invoices or using the API just to get two variables... and if the client isn't logged in, then the sidebar won't show anyway. the top sidebar is your sidebar (fixed by me!), the bottom is the default one shown on the invoices page... your sidebar will overwrite the default one if the menuitemname values are the same and will appear elsewhere in the clientarea. <?php # Unpaid Invoices Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar){ GLOBAL $smarty; $dueinvoices = $smarty->getTemplateVars()['clientsstats']['numunpaidinvoices']; $duebalance = $smarty->getTemplateVars()['clientsstats']['unpaidinvoicesamount']; $filename = APP::getCurrentFileName(); $client = Menu::context("client"); $clientid = (int) $client->id; if ($filename!=='clientarea' || $clientid===0 || $dueinvoices===0){ return; } $primarySidebar->addChild('My Invoices Summary', array('label' => Lang::trans("invoicesdue"),'order' => 1,'icon' => 'fa-money-bill-wave')); $primarySidebar->getChild('My Invoices Summary') ->setBodyHtml(sprintf(Lang::trans("invoicesduemsg"),$dueinvoices,$duebalance)) ->setFooterHtml('<a href="clientarea.php?action=masspay&all=true" class="btn btn-danger btn-sm btn-block">'.$duebalance.'</a>'); }); I suspect the default sidebar will use the Invoice class method to get the number/balance, but there seems little point in reinventing the wheel when we only need two variables and they're both accessible via Smarty. 🙂
  2. 2 points
    @brian! here this full custom already modified <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Module\AbstractWidget; use WHMCS\User\Client; class ClientOnline extends AbstractWidget { protected $title = 'Client Last Login'; protected $weight = 80; protected $cache = true; protected $cacheExpiry = 60; protected $requiredPermission = 'List Clients'; public function getData() { return array( 'client' => Client::orderBy('lastlogin', 'desc')->limit(24) ->get(array('email', 'id', 'firstname', 'lastname', 'ip', 'lastlogin'))->toArray(), ); } public function generateOutput($data) { $clientOutput = ''; $clients = array(); foreach ($data['client'] as $client) { $clientOutput .= '<div class="staff">' . '<a href="clientssummary.php?userid='.$client['id'].'"><img class="body-avatar" src="https://www.gravatar.com/avatar/'.md5($client['email']).'?s=60&d=mm" width="60" height="60"/></a>' . '<div class="name">'.$client['firstname'].' '.$client['lastname'].'</div>' . '<small><a href="http://www.geoiptool.com/en/?IP='.$client['ip'].'" target="_blank" class="name" style="color:red">'.$client['ip'].'</a></small>' . '<div class="note text-muted">' . Carbon::createFromFormat('Y-m-d H:i:s', $client['lastlogin'])->diffForHumans().'</div>' . '</div>'; } return <<<EOF <div class="widget-staff-container clearfix"> {$clientOutput} </div> EOF; } }
  3. 1 point
    Welcome to WHMCS.Community ezequiel! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  4. 1 point
    Welcome to WHMCS.Community Lucas15! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  5. 1 point
    Welcome to WHMCS.Community SanMarzano! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  6. 1 point
    When i use <script src="//example.com/jQuerys.js?v=<?php echo(rand()); ?>"></script> In normal php file then is generate random number. When i use in modules/servers/cpanel/template/overview.tpl Then code is not working. Please give me solution. Thanks
  7. 1 point
    Welcome to WHMCS.Community Interwork! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  8. 1 point
    Invalid numeric value “IPv4 shared; IPv6 none” for the “quota” setting. If anyone is having issues with this error here's how you fix it: Go to WHMCS admin area and click on Setup > Products and Services Find the Product that is giving you the error and then open it / edit it Go to the Module Settings tab and look at the far right, under where you select the WHM Package, find the link Switch to Advanced Mode Once Advanced Mode is open, look at Web Space Quota, it may say IPV4 Shared; IPv6 None in the text box Change this field to a numeric value or leave it blank BOOM Error gone once you accept the order now.
  9. 1 point
    one option if you wanted to remove the prices from that dropdown would be to edit the configureproduct.tpl template and change... {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$pricing.monthly} </option> {/if} {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {$pricing.quarterly} </option> {/if} {if $pricing.semiannually} <option value="semiannually"{if $billingcycle eq "semiannually"} selected{/if}> {$pricing.semiannually} </option> {/if} {if $pricing.annually} <option value="annually"{if $billingcycle eq "annually"} selected{/if}> {$pricing.annually} </option> {/if} {if $pricing.biennially} <option value="biennially"{if $billingcycle eq "biennially"} selected{/if}> {$pricing.biennially} </option> {/if} {if $pricing.triennially} <option value="triennially"{if $billingcycle eq "triennially"} selected{/if}> {$pricing.triennially} </option> {/if} to... {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$LANG.orderpaymenttermmonthly} </option> {/if} {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {$LANG.orderpaymenttermquarterly} </option> {/if} {if $pricing.semiannually} <option value="semiannually"{if $billingcycle eq "semiannually"} selected{/if}> {$LANG.orderpaymenttermsemiannually} </option> {/if} {if $pricing.annually} <option value="annually"{if $billingcycle eq "annually"} selected{/if}> {$LANG.orderpaymenttermannually} </option> {/if} {if $pricing.biennially} <option value="biennially"{if $billingcycle eq "biennially"} selected{/if}> {$LANG.orderpaymenttermbiennially} </option> {/if} {if $pricing.triennially} <option value="triennially"{if $billingcycle eq "triennially"} selected{/if}> {$LANG.orderpaymenttermtriennially} </option> {/if}
  10. 1 point
    if you need WHMCS to automatically take care of the provisioning for such features, you might want to take a look at the Configurable Package addon... https://marketplace.whmcs.com/product/30 https://docs.whmcs.com/Configurable_Package_Addon note, you only need the addon if you want WHMCS to take care of the provisioning.... if you want to provision manually, you won't need to buy it. don't forget that clients may just be parking those domains, they won't necessarily have new sites, or require additional webspace/bandwidth.
  11. 1 point
    if you're using dd/mm/yyyy in the client area, just use {$datepaid|strstr:' ':true} instead of {$datepaid} and that will remove all characters after (and including) the space in the date...
  12. 1 point
    Make sure to do the -vvv switch in the cron also.
  13. 1 point
    Hi Christian, yes, but you're thinking of it entirely the wrong way. that's simple enough. then it's time for you to leave your stupid world and enter my insane world! the solution is that instead of letting the data feed return the default price, e.g €100 EUR, and then trying to translate/manipulate/edit the result, you modify the feed code to suit your needs and return what you want from it! now, you should never modify existing data feeds because they will be overwritten by the WHMCS automatic updater - so create a new data feed in the feeds folder, post your code in there, modify it and use that... to save you time, i've quickly updated the productsinfo feed you mentioned and i've attached it to this post... just rename it to something else and remember to change your references (filename, productid, billingcycle, currency etc) in your template code that calls the feed(s). I have added 3 options - to either output the price with a suffix; with a prefix, or with neither... full string = <script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=annually&currency=1"></script><br> suffixed = <script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=annually&currency=1&output=suffix"></script><br> prefixed = <script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=annually&currency=1&output=prefix"></script><br> price only = <script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=annually&currency=1&output=number"></script><br> full string = £100.00 GBP suffixed = 100.00 GBP prefixed = £100.00 price only = 100.00 productsinfo.php
  14. 1 point
    require in the strictest sense, not really... one in-built solution would be to use Product Bundles. now if they chose to, the user could remove one of the products from the cart before checkout - so that's why I said the second product isn't REQUIRED because it can be removed (though I suppose you could price the bundle to encourage them not to remove it). Configurable Options might be another option, but it really depends what configuration this secondary product might need. if you need a commercial alternative, ModulesGarden's Product Linker might be a viable option...
  15. 1 point
    Hi, it is more than one 😉 Easy would be just to open the drop-down in the Products tab and just take one and search via google. One which is free and not in the List would be http://centos-webpanel.com so far you using CentOs as OS. Link is here with install Video --> http://wiki.centos-webpanel.com/whmcs-module-for-cwp-api Greetings Christian
  16. 1 point
    HI as stated above the only other material you could use is ISPConfig other then that i dont believe there is. if you have any questions or queries feel free to send me a message
  17. 1 point
  18. 1 point
    Modulegarden has one. https://www.modulesgarden.com/products/whmcs/quickbooks-desktop MyWorks has one but it is for online. https://myworks.design/software/whmcs-quickbooks-online-automatic-sync-module/ They also have a woocommerce quickbooks desktop sync, so perhaps have something for WHMCS in the works or already and just missed it. Perhaps contact them. I recall seeing another QB desktop module around but do not recall the developer and not seeing it on the marketplace.
  19. 1 point
    Welcome to WHMCS.Community GeewinMatches! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  20. 1 point
    Welcome to WHMCS.Community sai kit! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  21. 1 point
    i'm still inclined to think so. there are none - but a lot of WHMCS is probably still how it was 10 years ago, and this may be one of those occasions. but if the database doesn't store the updated date (or any date), then you're into the realms of having to store the date yourself when you update/create an article in the admin area... but I don't think that there are any specific hook points triggered when editing an article, so no simple way to do this. you can't extract what hasn't been saved. 🙂 no - just what has been programmed to be returned to be available to the template. not necessarily - as you saw with the useful/votes hook that I wrote that just amended the array with new content and returned it to the template... if the dates were naturally in the table, you could use that hook for this, but there are no dates stored. i'm not saying that it couldn't ultimately be done, just that there isn't a quick "here's a hook" solution... it's likely going to need an addon module for this, probably with custom database tables too.
  22. 1 point
    https://www.whmcs.com/members/index.php/knowledgebase/38/What-is-branding-removal.html in other words, you'll have to pay WHMCS to get that line removed by upgrading your license. 🙂
  23. 1 point
    Hi Abdul, there are a number of ways - and really depends on what you want to replace it with, that you could do... add your Twitter username to setup -> general settings -> social and that would display a text version of your twitter feed in place of the announcements. delete the announcement itself via the admin area... and looking at your site, it looks like this is what you've chosen to do. use an action hook to null the $announcements array on the homepage using a small .php file. there are other options, but seeing as you've deleted the announcement, there's no point going into them.
  24. 1 point
    you can edit this report to include the field/column you need, after 2 minutes I was able to make it export product name <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); $reportdata["title"] = "Services"; $filterfields = array("id"=>"ID","userid"=>"User ID","clientname"=>"Client Name","orderid"=>"Order ID","packageid"=>"Product ID","packagename"=>"Product Name","server"=>"Server ID","domain"=>"Domain Name","dedicatedip"=>"Dedicated IP","assignedips"=>"Assigned IPs","firstpaymentamount"=>"First Payment Amount","amount"=>"Recurring Amount","billingcycle"=>"Billing Cycle","nextduedate"=>"Next Due Date","paymentmethod"=>"Payment Method","domainstatus"=>"Status","username"=>"Username","password"=>"Password","notes"=>"Notes","subscriptionid"=>"Subscription ID","suspendreason"=>"Suspend Reason"); $reportdata["description"] = $reportdata["headertext"] = ''; $incfields = $whmcs->get_req_var('incfields'); $filterfield = $whmcs->get_req_var('filterfield'); $filtertype = $whmcs->get_req_var('filtertype'); $filterq = $whmcs->get_req_var('filterq'); if (!is_array($incfields)) $incfields = array(); if (!is_array($filterfield)) $filterfield = array(); if (!is_array($filtertype)) $filtertype = array(); if (!is_array($filterq)) $filterq = array(); if (!$print) { $reportdata["description"] = "This report can be used to generate a custom export of services by applying up to 5 filters. CSV Export is available via the download link at the bottom of the page."; $reportdata["headertext"] = '<form method="post" action="reports.php?report='.$report.'"> <table class="form" width="100%" border="0" cellspacing="2" cellpadding="3"> <tr><td width="20%" class="fieldlabel">Fields to Include</td><td class="fieldarea"><table width="100%"><tr>'; $i=0; foreach ($filterfields AS $k=>$v) { $reportdata["headertext"] .= '<td width="20%"><input type="checkbox" name="incfields[]" value="'.$k.'" id="fd'.$k.'"'; if (in_array($k,$incfields)) $reportdata["headertext"] .= ' checked'; $reportdata["headertext"] .= ' /> <label for="fd'.$k.'">'.$v.'</label></td>'; $i++; if (($i%5)==0) $reportdata["headertext"] .= '</tr><tr>'; } $reportdata["headertext"] .= '</tr></table></td></tr>'; for ( $i = 1; $i <= 5; $i ++ ) { $reportdata["headertext"] .= '<tr><td width="20%" class="fieldlabel">Filter '.$i.'</td><td class="fieldarea"><select name="filterfield['.$i.']"><option value="">None</option>'; foreach ($filterfields AS $k=>$v) { $reportdata["headertext"] .= '<option value="'.$k.'"'; if (isset($filterfield[$i]) && $filterfield[$i]==$k) $reportdata["headertext"] .= ' selected'; $reportdata["headertext"] .= '>'.$v.'</option>'; } $reportdata["headertext"] .= '</select> <select name="filtertype['.$i.']"><option>Exact Match</option><option value="like"'; if (isset($filtertype[$i]) && $filtertype[$i]=="like") $reportdata["headertext"] .= ' selected'; $reportdata["headertext"] .= '>Containing</option></select> <input type="text" name="filterq['.$i.']" size="30" value="'.(isset($filterq[$i])?$filterq[$i]:'').'" /></td></tr>'; } $reportdata["headertext"] .= '</table> <p align="center"><input type="submit" value="Filter" /></p> </form>'; } if (count($incfields)) { $filters = array(); foreach ($filterfield as $i => $val) { if ($val && array_key_exists($val, $filterfields)) { if ($val == 'clientname') { $val = "(SELECT CONCAT(firstname,' ',lastname) FROM tblclients WHERE id=tblhosting.userid)"; } $filters[] = ($filtertype[$i]=="like") ? $val . " LIKE '%" . db_escape_string($filterq[$i]) . "%'" : $val . "='" . db_escape_string($filterq[$i]) . "'"; } } $fieldlist = array(); foreach ($incfields AS $fieldname) { if (array_key_exists($fieldname,$filterfields)) { $reportdata["tableheadings"][] = $filterfields[$fieldname]; if ($fieldname=="clientname") $fieldname = "(SELECT CONCAT(firstname,' ',lastname) FROM tblclients WHERE id=tblhosting.userid)"; if ($fieldname=="packagename") $fieldname = "(SELECT `name` FROM `tblproducts` WHERE `tblproducts`.`id`=`tblhosting`.`packageid`)"; $fieldlist[] = $fieldname; } } $result = select_query("tblhosting", implode(',', $fieldlist), implode(' AND ', $filters)); while ($data = mysql_fetch_assoc($result)) { if (isset($data['paymentmethod'])) $data['paymentmethod'] = $gateways->getDisplayName($data['paymentmethod']); if (isset($data['password'])) $data['password']=decrypt($data['password']); $reportdata["tablevalues"][] = $data; } }
  25. 1 point
    I think I found it ... Configuration >> General Settings >> Other >> Allow Client Registration >> Tick this box to allow registration without ordering any products/services
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated