Jump to content

brian!

Honored Contributor
  • Content Count

    13189
  • Joined

  • Last visited

  • Days Won

    484

Everything posted by brian!

  1. you won't have to migrate the database yourself - the install script will do that when you give it the current v5.3.13 database details during installation. if you want to keep a copy of the database before doing that, then you could duplicate it in phpmyadmin, or do a SQL dump... although if the cron has been performing daily database backups, then you should already have a backup of the database locally.
  2. I think you'd have to go to those above Support, e.g the developers, to find someone who *knows* how it works.
  3. under most circumstances, that should be enough - support departments marked as hidden won't be shown to clients.... however, there is a way to bypass that hidden status and you're inadvertently doing it. you seem to have modified the contact link in the navbar to link specifically to the General Enquires department - assuming that link is in the client area too, then a client using that link will be able to submit a ticket to the GE dept.... if that link hadn't been modified (e.g it was just going to contact.php), then they shouldn't be able to (unless they know that they can directly link to the dept to bypass it's hidden status). so I would think that just removing the change to the navbar link should resolve the issue.
  4. oh if it's purely a text issue, e.g display this text string if they're logged in and another string if they're not, then that will definitely be doable - either by editing the template(s) and using if statements as per above, or by using a hook to rewrite these language strings on the fly based on the user's logged in status. if you go down the path of using hooks, then it should remove the need to reapply the changes after each update.
  5. yes. the simplistic way might be to do it in the template(s), e.g {if $loggedin}output template design A{else}output template design B{/if} or you could redirect to a specific orderform template using a hook based on the loggedin status. how different will the orderforms designs be e.g are they slight variations on each other or radically different ??
  6. you mean something like... ? {"$invoice_date_due +15 days"|strtotime|date_format:'%d-%m-%Y'} it should work, but you'd have to add strtotime to the Smarty Security Policy modifiers list otherwise it might not send. the alternative would be a EmailPreSend hook where you queried the database for the due date, did your date calculations on it and then returned it as a custom variable to the template - but if you're comfortable using Smarty in the template, then it's a valid option... though you might need to use the source editor to enter the code.
  7. aahh - you didn't get my little clue in the reply where I emboldened the word "gets"... perhaps I should have made it red too! 😎 <?php # Currency Selector On Custom Page Hook # Written by brian! use WHMCS\Database\Capsule; function waka_products($vars) { $currencyid = $_GET['currency']; $validcurrencies = array_column($vars['currencies'],'id'); if (!in_array($currencyid,$validcurrencies)) { $currencyid = 1; } $products = Capsule::table('tblproducts') ->join('tblpricing','tblproducts.id','=','tblpricing.relid') ->where('tblpricing.type', 'product') ->where('tblproducts.hidden','0') ->where('tblproducts.gid','10') ->where('tblpricing.currency', $currencyid) ->orderBy('tblproducts.order') ->get(); $results = json_decode(json_encode($products), true); return array("myproducts" => $results); } add_hook("ClientAreaPage", 1, "waka_products"); so the four differences from your hook are: i've added the code that checks for the value of the currency being passed in the URL. the query will now use that passed currency value to get the pricing in the selected currency - if currency value is not a valid currency value, then it defaults to 1 (which I assume is your default currency - change if it's not).... though if an invalid value is passed, the dropdown might show the wrong selected currency - but that shouldn't really matter as they should only be using currency selections from the dropdown choices. i've removed the select because if you're keeping everything from the result, you don't need to specify a select - ideally, you should be selecting only the info you need though rather than everything. i'm checking that the returned products aren't set to be hidden. personally, i'd also make three additional changes - not included as i'm sure you just want to get it working first before you clean it up. I would add an if statement in the hook so that it only runs on the custom page - as written, it's going to run on *every* client area page. if you're only interested in a specific billing cycle, I would check that it's values aren't -1, e.g it has a valid price set for it. I would format the price in the correct currency in the hook - though I assume you're going to do it in the template using {$currency.prefix} and {$currency.suffix} which is fine. and if it helps, I can give you the modified Smarty dropdown too... {if !$loggedin && $currencies} <select name="currency" class="form-control select-inline" onchange="if (this.value) window.location.href=this.value"> <option value="">{$LANG.choosecurrency}</option> {foreach $currencies as $currchoice} <option value="{$smarty.server.PHP_SELF}?currency={$currchoice.id}" {if $currchoice.id|intval eq $smarty.session.currency}selected{/if}>{$currchoice.prefix} {$currchoice.code}</option> {/foreach} </select> {/if}
  8. the important thing to appreciate here is that your WHMCS install isn't linked in the way you think to whmcs.com - the links within the software are just that, links.... whmcs.com is not embedded within the software, so the links to open a ticket, visit this community are just links and nothing more... hence why you need to login etc. creating admins in your WHMCS has no connectivity or interaction with whmcs.com - they're just staff that have access to your install, not whmcs.com. I suppose you could create contacts/sub-accounts on the WHMCS site for those admins who you want to be able to open tickets with WHMCS - but next time you open a ticket with them, ask them and i'm sure they'll be able to tell you if it's possible and the procedure.
  9. previously, you would edit the templates within standard_cart (or duplicate the theme and then modify/use the duplicate) because if you just use a sidebar hook to remove the sidebars in the cart (similar to above), it leaves a space where they were and doesn't adjust the width accordingly... this is a bug / design flaw that has existed for 5+ years. in their case, it's not removed - it's been hidden with CSS. in fact, looking at their browser code, they've seemingly must have done it in a really weird convoluted way using a sidebar hook to create custom sidebars that add css to hide/resize the sidebar/page. I don't think there's any need for that complexity, and it would be simpler to use a hook to add the CSS directly... <?php # Cart Sidebar Removal / Resizing Hook # Written by brian! function cart_remove_sidebars_hook($vars) { $validtemplates = array("products","domainregister"); if ($vars['filename'] == "cart" && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .pull-md-right { width:100%; } .sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); the only line that you might need to change is that first line, $vaidtemplates, which is defining which templates you want the cart sidebars to still be shown in - so as currently written, the sidebars will be shown on the products (first cart page) and Domain Register - all other templates will hide the sidebars and adjust the page width accordingly. tested as working on v7.8 and v7.10 using Six & Standard_cart - it should work on earlier versions than v7.8, but that's untested.
  10. asking the same question every three months isn't going to change the answer previously given. 🙄 the answer won't change until either a) WHMCS uses an alternative to the ECB list of currencies (won't happen until at least v8 and I doubt will happen even them), or a third-party addon is released that gets the exchange rates from an alternate source... until then, what you want to do cannot be automated out of the box.
  11. open a ticket with Support and let them see the details of the problem. if you get your license directly from WHMCS - https://www.whmcs.com/support/ if you get your license from a reseller / host - https://www.whmcs.com/reseller-support/
  12. Hi Charlie, imacs aren't really an area I know well (code for not at all lol), but it sounds as though it may be a caching issue in some way - e.g., if other methods are receiving the new logo, but imac is ignoring it... out of curiosity, did you change the image filename, or is the filename the same between the new and old logos ?
  13. if they've got their own WHMCS install, then they wouldn't necessarily need access to yours and should be able to develop it locally. even if they do need access, then they should usually only need access to that specific template folder (or a duplicate of it) - though it all depends on the extent of the modification and whether those changes are going beyond direct changes to the template code.
  14. I wouldn't rule out, nor surprise me, that there might be - but it would have been useful if you had posted your custom additionalfields file, or at least the lines relevant to this TLD, just in case there is an error in there somewhere.
  15. Hi Aqsa, ideally, you should be using a currency value in your hook query - otherwise it will, as you have found, either get all results for a given pid, or the first result (depending on the query used). ->where('tblpricing.currency', $currencyid) your currency dropdown should be passing a value for each currency, e.g page.php?currency=1 and then the hook gets that passed currency value and uses it in the query - that way you know the query should only be searching for selected product prices in the chosen currency. you can't really tell from the image, but each time i'm clicking on a currency link, the page is reloading and the hook runs again, using the currency being passed to it, to pull the product names and format the monthly pricing. if you aren't specifying a sort order in the query (in Capsule, that's orderBy), then it will just return the results in the order that it finds them, e.g the order they were added to WHMCS)... ->orderBy('tblproducts.order') i'm assuming that you are querying tblproducts with a join to tblpricing ? i'd probably need to see the hook you're using to see where any specific faults are.
  16. in general settings -> general, does the WHMCS System URL value include https or http ?
  17. it's intended behaviour to only show the IP Address on the client's first ticket post - if you need it on all of their ticket replies, then you might need to use a TicketUserReply action hook to get the IP and add it to the bottom of the reply.... though of course, IPs can be faked or masked.
  18. normally, direct license users should just login in to the Members Area and open a ticket via there... but as you say, that's where you're coming unstuck because it's not accepting your email address or password reset - possibly you used another email address when you bought the license ? in any event, if you can open a ticket via Reseller Support, you will be able to give them your license details and they should be able to check the details they have - and possibly reset or update the email address / password for you to allow you to login when you need to. i'm not aware of any direct email or telephone options - there is an online chat for certain license holders, but I think you'd need to login to use that, so not really of much use in your position! 🙂
  19. you shouldn't need to do anything to the template, just use an action hook to remove the sidebars from the left-hand side... once you have removed all of the sidebars, then the content should be displayed automatically over a wider area. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Overview'))) { $primarySidebar->removeChild('Service Details Overview'); } if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } });
  20. the quick way to get a status count for a particular status in a hook would be... <?php # Get Service Count Hook # Written by brian! function services_counts_hook($vars) { $client = Menu::context('client'); $activeservices = $client->services->where('domainstatus','Active')->count(); return array("activecount" => $activeservices); } add_hook("ClientAreaPageProductsServices", 1, "services_counts_hook"); that will give you an {$activecount} variable you can use in the template to show the number of active services... it should tally with the value in the sidebar (though I assume you aren't showing the sidebar). if you need other selected status counts, then it's just a case of duplicating that second line, adjusting the domainstatus value and including the result in the return array. if you need all the status counts in one array and via one query, then i'd probably use capsule/SQL rather than the model method.
  21. it's the curse of the internal archive of threads from this place in my head... i'll need to write a purge script at some point! ðŸĪŠ totally agree... hence why I included the least worst option of upping to 7.83 and hotfixing, rather than having to deal with anything they might have added (or removed) in v7.9 or v7.10
  22. given what you said in the other thread, i'm gulping before giving this advice - you might have to upgrade. ðŸ˜ēðŸ˜ē what you're seeing is a bug that was marked as fixed in later versions.... I think you have two options here - upgrade to v7.8.3 and then apply the hotfix below (and possibly any other v7.8.3 hotfixes you think might be applicable)... ... or upgrade to v7.9 (which should include the above hotfix) or later.
  23. @yggdrasil - what version of WHMCS are you using currently ?
  24. it's only been five months - give it until the Olympics after next and check again. âģ one prolific beta tester is hardly the community... how many users are actually testing the app? double figures at best I suspect. besides, we all know that they like to give the pretence of listening (occasionally they might) during a beta period... outside of that, you might as well kiss the camel. 🐊
  25. the sidebar should add filters for (default) service statuses that it finds for that client - are you using custom service statuses in some way ? are you wanting to add new custom filters to the sidebar or just using buttons elsewhere on the page? either way, i'd be inclined to think that you'll have to query the database to get a count for the current user and the occurrence of your custom status(es) in their services.
×
×
  • 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