Jump to content


Popular Content

Showing content with the highest reputation since 05/27/20 in all areas

  1. 3 points
    Hi Mohamed, <?php function admin_custom_css_hook($vars) { $currenttemplate = $vars['template']; if ($currenttemplate == "blend" ) { $head_return = ''; $head_return = '<link href="templates/blend/css/admin-dark.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(document).ready(function() { $(\'.header .logo img\').attr(\'src\', \'templates/blend/images/logo-dark.gif\'); }) </script>'; return $head_return; } } add_hook("AdminAreaHeadOutput",1,"admin_custom_css_hook"); there was two bugs in the original hook - first, it was changing the logos on the marketconnect pages with your logo(!)... i've fixed that by being more accurate with the logo .css reference in the hook. the second bug is when you look at admin pages that appear to be in a subdirectory (due to Friendly URL settings), e.g the setup pages for notifications, security settings etc, the logo is broken - that's purely down to the path to the image being wrong... I suspect that would be fixed by either expanding the hook for those conditions or referencing the replacement image with a full URL rather than a relative path.
  2. 2 points
    Hi everyone! Since I spend most of my time during the day on the WHMCS admin dashboard, answering tickets, activating services, following up with stuff, etc. I wanted to keep eye strain to a minimum, so I recently created this CSS file to turn our admin area into a dark look and feel. ------- Today, I'd like to share with you steps to achieve that. The file is compatible with Blend theme of v7.9.2 of WHMCS, I haven't tested it on the other versions yet. The process is pretty simple and straightforward IF YOU HAVEN'T MADE ANY CUSTOMIZATIONS to your Blend theme already. So just download the attached file (blend-dark.zip) and extract it anywhere in your computer. Next, open the folder and then the "images" folder to locate the (logo-dark.psd) file to edit it by placing your own logo there. Then save it as "logo-dark.gif" replacing the already existing file. Now you should end up with a file tree like this ... blend |__ css | |__ admin-dark.css | | |__ images | |__ logo-dark.gif | |__ logo-dark.psd | |__ header.tpl Now back top and compress your "blend" folder ... Name it something memorable, like "blend-2222.zip" in this example. Next navigate to the "admin" folder inside your WHMCS installation, and open the "templates" folder (based on your customizations, the "admin" folder name may differ, so this here presumes the default setting). /path/to/whmcs/admin/templates/ Next make sure to ZIP and backup your current Blend theme folder (name it something like "blend-original.zip). Next, upload the "blend-2222.zip" you compressed earlier to the "templates" folder and unzip it, and you should be all set and ready! If you have any notes or additions, please feel free to add! Also, any mistakes or errors are unintentional, please feel free to share and highlight them. Wishing everyone a good day! - Mohamed
  3. 2 points
    I would consider this expected behaviour of Six - the reason why you're seeing it twice is because this client has already entered an answer to a security question - so the template is showing the question they chose and a field for the answer... that field is left blank in case they want to change their security question and/or answer - in order to do so, then will have to enter their existing answer again. after an answer has been updated, the template has access to the answer, so in the current session, it will show the answer (hidden as a password). if you had to, you could either get the page to show it by default if it exists - that's just a tweak to the template... either as a hidden password field or as text.
  4. 2 points
    there be the question - the trick is knowing which template is generating the output. πŸ˜• so if this is a cPanel product, then it's going to be /modules/servers/cpanel/templates/overview.tpl and specifically... <input type="button" onclick="popupWindow('whois.php?domain={$domain}','whois',650,420);return false;" value="{$LANG.whoisinfo}" class="btn btn-info btn-sm" /> it's worth noting... https://docs.whmcs.com/Working_with_Module_Templates so you can duplicate this overview template and move it to the active template folder (and then edit it to make your changes) - which means that during an update, WHMCS shouldn't overwrite it - if you modify the original version in the cPanel folder, it likely will.
  5. 2 points
    instead of modifying header.tpl, I would have been tempted to use a hook because as far as I can tell, there are only two changes in the template... adding a link to the custom dark css file. the changing of the WHMCS logo. so the first you can inject with an adminareaheadoutput hook without any issue; the second is a pain because the logo url is hardcoded in the template... one option would be to just replace the default whmcs logo.gif file... yes, you'll have to replace it after each update - but theoretically you're going to have to check the css still works after every update too - especially a major update. the other two quick alternatives would be to just remove the logo using CSS (you already know which company you're working for - so unless you are logging into multiple different installs, then you don't need the WHMCS logo)... or you use JS to change the image on the fly (that would work, but you might see the default logo first and then the replacement logo loading afterwards). <?php function admin_dark_blend_css_hook($vars) { $currenttemplate = $vars['template']; if ($currenttemplate == "blend" ) { $head_return = ''; $head_return = '<link href="templates/blend/css/admin-dark.css" rel="stylesheet" type="text/css" /> <style>.logo {display: none;}</style>'; return $head_return; } } add_hook("AdminAreaHeadOutput",1,"admin_dark_blend_css_hook"); that way, if you need to disable the dark blend theme, you can just disable/remove the hook and it will default back to using "normal" blend. πŸ™‚
  6. 1 point
    Hey @zitu4life, You’re asking a very expansive question there and certainly one you want to be asking of your server administrator or hosting provider. The reason for this is it vastly depends on the environment you are using. As a very basic example...A server with one CPU core that has a single process running at 100% all of the time would have a load average of 1.0, however, a server with four CPU cores, the load average would be 4.0 where the CPU’s are being fully utilised. You probably want to be concerned when the server is overloaded, in other words, the CPU(s) running over capacity. How you to determine that is based upon the server configuration/environment itself (which I gave a basic example of). I hope this helps.
  7. 1 point
  8. 1 point
    if you're using the premium comparison template, then it would be in /templates/orderforms/premium_comparison/products.tpl and specifically moving the block of code that starts... {if count($productGroup.features) > 0} if you're going to do this, then you may be better off duplicating the premium folder, renaming it and then associating that with your product groups - otherwise, any changes you make to this template will be overwritten after the next WHMCS update.
  9. 1 point
    yes... if you ignore the navbar parts and just focus on the sidebar part of the hook below, that can be used to change the links in that sidebar... if you're doing that in a hook, then it's just a removeChild. if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support')->removeChild('Downloads'); }
  10. 1 point
    do you get your license direct from WHMCS? if so, a free development license might be an option... that would give you a chance to duplicate your production install, and then give WHMCS access to the duplicate dev rather than the live production - and then if Support happen to trash the dev whilst testing, it won't matter.
  11. 1 point
    open up the email template source editor... ... and check in the popup window that WHMCS hasn't changed any of the above code.
  12. 1 point
    you won't need the brackets around order_details.. {if $order_details|strstr:".net"} do something {/if}
  13. 1 point
    if you're in order confirmation, then the space likely won't exist after .net, so you can remove that from the if statement... though that might cause issues depending on what TLDs you sell.
  14. 1 point
    if you had/wanted to, you could use a hook to add a link to a custom renamed custom.css file that WHMCS wouldn't touch/overwrite during an update. it's probably best to backup BEFORE you make any change, rather than after it! πŸ™‚ as I said, the hooks folder should be safe from WHMCS interference... the css and templates are another matter.
  15. 1 point
    out of the box WHMCS couldn't do it - not least because it won't necessarily know how much you have paid for a domain from a supplier... possibly if the price was static per TLD over the entire period, it would be calculable in a custom report - but if the cost prices were fluctuating throughout the year(s) and TLDs, there is an existing Server Revenue Forecast Report for future income per server... because you can enter monthly server cost pricing, it would be possible to work out the profit per server.
  16. 1 point
    <section class="search-bar sb2 section-space"> <div class="container sb"> <div class="col-md-8 center-block"> !-- Search Form --> <form action="https://www.iholytech.com/cg/domainchecker.php" method="post"> <!-- Search Field --> <div class="row fadesimple"> <div class="default-title"> <h3 class="text-white">Search your Domain</h3> <div class="title-arrow1"></div> <p>Register your domain with in short time</p> </div> <div class="form-group"> <div class="input-group"> <input class="form-control bar" name="domain" type="text" placeholder="Enter your domain name" required=""> <button class="btn button search-button btn-lg" type="submit"> Search Domain </button> </div> <div class="ltds clearfix"> <div class="col-sm-3 col-xs-1 border-right1"> <p class="blue">.com <span>$10.91</span></p> </div> <div class="col-sm-3 col-xs-1 border-right2"> <p class="yellow">.org <span>$13.11</span></p> </div> <div class="col-sm-3 col-xs-1 border-right3"> <p class="orange">.net <span>$14.95</span></p> </div> <div class="col-sm-3 col-xs-1 border-right4"> <p class="green">.info <span>$15.32</span></p> </div> </div> </div> </div> </form> <!-- End of Search Form --> </div> </div> </section>
  17. 1 point
    hi to file clientregister.tpl All input like the <input type="text" name="firstname" id="inputFirstName" class="field form-control"style="padding-right:40px" placeholder="{$LANG.orderForm.firstName} style="padding-right:40px" Do it
  18. 1 point
    that's not true - you can change the links (navbar/sidebar/panel) whether the user is logged in or not... you can even determine if they're logged in and send them to one of multiple different urls depending on whether they are or not... and who they are. sometimes, you can be lazy, e.g as you did in your hook above, because you know (or can assume) a particular link is client only, e.g Open Ticket... only clients see that link, so you don't have to check whether they're logged in or not... other links, such as Home are shown to everyone, but their links change whether the user is logged in or not (clientarea.php / index.php)... so a trivial example hook, redirecting the home link to Google if they're logged in , Twitter if they're not... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); if (!is_null($primaryNavbar->getChild('Home'))) { if ($client) { $primaryNavbar->getChild('Home')->setUri('https://google.com'); } else { $primaryNavbar->getChild('Home')->setUri('https://twitter.com'); } } }); can I say "not in a nice way" again ? there would be nothing to stop you using ClientAreaNavbars/Sidebars, getting the content of both navbars/sidebars in the hooks, looping through them and modifying URLs (e.g replace a with b, c with d etc) when you find an applicable link... but whether you should run such a hook every time the user changes pages, I doubt. if htaccess works, then that's possibly going to be easier because you won't have to work through finding each link to change in the navigation (though I doubt there will be that many), the htaccess will just react to the specified rules.
  19. 1 point
    sadly, yes - if you haven't renamed/duplicated the six template folder, then during an update, those template/css files get overwritten.... including custom.css which makes no sense for WHMCS to overwrite with a blank file - that's been discussed here many times over the years, but they don't see it as a problem... you'll need to check your templates too, as any changes you might have made to them pre-update, might also have been undone.... hooks should be unaffected, but always worth checking that they still work as expected. if you were using the automatic updater, then it should have warned you that you were about to overwrite modified files and suggested taking a copy - generally speaking, it's always good to take a copy of the files and database before running any update - just in case things go wrong. if you wanted to remove those two items using a hook, a quick way would be... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar){ if (!is_null($primaryNavbar->getChild('Services'))) { $primaryNavbar->getChild('Services')->removeChild('View Available Addons'); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar){ if (!is_null($secondarySidebar->getChild('My Services Actions'))) { $secondarySidebar->getChild('My Services Actions')->removeChild('View Available Addons'); } });
  20. 1 point
    I'm happy to help six.zip
  21. 1 point
    yes! I was beginning to question my own sanity. πŸ‘¨β€βš•οΈ
  22. 1 point
    aahh, that explains it - there was a bug/discrepancy where that value wasn't passed in v7.8 - you'll have to get it another way... <?php # Email Verification Icon Hook # Written by brian! function email_verified_icon_hook($vars) { $client = Menu::context('client'); $emailverified = $client->emailVerified; if ($emailverified) { $displayTitle = $vars['displayTitle'].' <i class="fas fa-user-check fa-xs"></i>'; return array("displayTitle" => $displayTitle); } } add_hook("ClientAreaPageHome", 1, "email_verified_icon_hook"); the above is tested as working in v7.8.3 - and should work in every version thereafter.
  23. 1 point
    it might be worth putting this in a GitHub and adding a link to it in Marketplace - who knows what's going to happen to Blend after v8, but that's going to be many months away at best.
  24. 1 point
    not a nice way - other than modifying the links in the navbar/sidebar/panels with hooks... though they wouldn't change any links that were shown in other template, or generated internally outside of the navigation. I could be tempted to suggest htaccess redirection, but then you're potentially fighting against Friendly URLs settings and redirection loops.... though you could try it with one link type and see if it works, and then expand if it does.
  25. 1 point
    well, for WHMCS main language I would use the following: Lang::trans('sms_message', array('name' => "John")) and that support to work as they use Laravel! but as you want to use Addon language translation and as all the phrases has been already assigned into an array ($vars['_lang']) and since WHMCS doesn't have the same functionality above, the only option is to use "str_replace" which will give you the same result.
  26. 1 point
    Whomever is responsible for modifying community emails and whatnot (those sent out re: reminders for threads, and the like) might want to take a look at the templates Links from those emails direct to https://staging.whmcs.community/thread , instead of https://whmcs.community/thread The two appear to be the same (at least thread content wise), but SSL errors pop up, as expected.
  27. 1 point
    Here's an updated and more enhanced version of the CSS file. admin-dark.css Upload this file to the following path (based on your customizations, the "admin" folder name may differ, so this here presumes the default setting.) /path/to/whmcs/admin/templates/blend/css/ As brian suggested above, it is better and more convenient to use a hook to call the file, instead of directly linking it in the header.tpl ... So create a hook and name it something like "darkblend.php". As for the logo, we'll use the JS method described above as well, but with exception of providing the whole URL for the logo image (to avoid 404 on some pages in the admin area). Hook file content: <?php // Contributed by brian! (https://whmcs.community/profile/210329-brian/) function admin_custom_css_hook($vars) { $currenttemplate = $vars['template']; if ($currenttemplate == "blend" ) { $head_return = ''; $head_return = '<link href="templates/blend/css/admin-dark.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(document).ready(function() { $(\'.header .logo img\').attr(\'src\', \'https://dash.wevrlabs.net/assets/img/logo-dark.gif\'); }) </script>'; return $head_return; } } add_hook("AdminAreaHeadOutput",1,"admin_custom_css_hook"); don't forget to change https://dash.wevrlabs.net/assets/img/logo-dark.gif with the correct full URL path of your own image.
  28. 1 point
    Congratulations, you did a great job and nice tutorial.
  29. 1 point
    no - the above is an action hook, so create a .php file in /includes/hooks, give it a memorable filename so that you know what it does and then copy & paste the code into it - save, refresh the page and the panel should be renamed.
  30. 1 point
    your best friend for something like this is to add {debug} to the template, refresh the page and you should get a popup window of most available smarty arrays/variables... then by examining the $service array in there, you should be able to tell which variables are available to you - specifically in your case, module (I think it's in there), and you can check those values to see if you can identify server product(s). if yes, then it's just another if statement... {if $service.module eq "some value"}do something{/if}
  31. 1 point
    you should just need to remove the line below from the feed (~ line 51)... $year, and the part used to display the column heading... <th>' . \Lang::trans('domainminyears') . '</th> however, there's no point editing the existing domainpricing.php file as any changes you make to it will get overwritten during a WHMCS update - therefore, duplicate the feed file, remove the above line and save it with a different filename - and then reference that new feed filename in your main website.
  32. 1 point
    it's just echoing the design of form that's on the homepage of the Six template - that too uses one form for both registering/transfer searches. then change the label... πŸ™‚ sadly, you can't really do that with a language override as WHMCS is using that string in multiple locations and whilst changing it would make sense in this panel, it wouldn't elsewhere... so then it's just a quick hook to change it's title. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaHomepagePanels', 1, function(MenuItem $homePagePanels) { if(!is_null($homePagePanels->getChild('Register a New Domain'))){ $homePagePanels->getChild('Register a New Domain') ->setLabel('Register or Transfer A Domain'); } }); now, if your site was multilingual, then you would create a new language string for each language and reference that new language string in the hook - but as your site is seemingly English only, the above should suffice. to a degree, I can see what you're saying about the possibility for confusion - but then I don''t think having two similar forms taking up space on the client area makes much sense either. don't get me wrong, separating the functionality into two panels could be done and it wouldn't be difficult - i'm just thinking in terms of the use of client area space and reducing the amount of elements for the user to deal with.
  33. 1 point
    We are also aware Office 365 are set to retire POP Basic Authentication access to Exchange Online mailboxes which was scheduled for October 2020 has been delayed until the second half of 2021 for people using it but also will be something we are adding soon. The team do have this on the list, can't confirm what we have for V8 but it is something that we are working towards
  34. 1 point
    Separate the ticket / support / kb system from WHMCS. Give WHMCS the ability to integrate into other packages - like zendesk, freshdesk etc - The WHMCS support/ticket system should plugin the same way as any other system, giving us the flexibility to choose the support platform we wish to use.
  35. 1 point
    you could use CSS.. .kb-article-content {font-family: arial; font-size: 10px}
  36. 1 point
    https://docs.whmcs.com/Clients:Contacts_Tab https://docs.whmcs.com/Sub-Accounts Client users may have more than one set of contact information on their account. WHMCS uses this contact information when sending messages from specific systems. For instance, a client contact can be configured as a domain contact, and WHMCS will send all domain related email to the contact instead of the client. The contact object models this extra client contact information. Client contacts may optionally be configured as sub-accounts. Sub-accounts can log into the WHMCS client area and interact with the client's record and services, given the proper permissions set by the client. depends what you want to edit... if you just want to tweak a label on a default sidebar, then you can use Language Overrides. if it's more wholesale changes than that (e.g add/remove children, change icons etc), then you'll need to use action hooks.. https://docs.whmcs.com/Editing_Client_Area_Menus https://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet though an existing hook, or a similar one modifiable to your needs, will probably have already been posted here previously. you can't easily - you could edit the content of the existing panel (with an action hook), but it really wouldn't be worth spending the time doing it - it would be quicker to just remove it and create two new panels from scratch (the content code for each would be virtually identical apart from the button and title). https://docs.whmcs.com/Working_With_Client_Area_Home_Page_Panels any particular reason why you want to split them up into two separate panels?
  37. 1 point
    if you're looking to pay a developer to do this for you, then you should post in Service Offers & Requests. are you seeing specific errors ? that's around v7.6 - have you actually updated WHMCS since then, or are you wanting to update the theme before you update WHMCS ? which btw is the order in which you should ideally do an upgrade- e.g don't update WHMCS until you know the theme,hooks,addons have all been updated and are compatible with the new release.
  38. 1 point
    why? are they going to have a survey or a vote on what to add ?? (even if they did, how many users would vote??) no - they will already know what's going to change, and the user base will either have to like it or lump it.
  39. 1 point

    Version 1.0.0


    An issue has been identified in the 7.10.2 release - published on 19th May 2020, that can result in an Oops fatal PHP error in certain circumstances when interacting with invoices: exception 'Whoops\Exception\ErrorException' with message 'Call to a member function isRecurring() on null' in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/Billing/Invoice.php:0 This occurs when viewing, sending a reminder email or attempting capture on an invoice containing a line item related to a deleted service.
  40. 1 point
    Oh 😞 You could try with Mass Payment that allows customers to pay multiple invoices at once also with credit. On paper it works but keep in mind that Mass Payment can't be used in some countries where the resulting invoice would be considered a billing error.
  41. 1 point
    Hello there My felling is that, like we missed it on the right time to ask future requests when WHMCS add option on v7.10 upload images on browser. On announcements if we want to add an images we need to goo to cpanel and upload images first, it would be really a must if we had that future too, as it looks not much changes as WHMCS already has those code future created. Announcements with images can make us interacting more with regarding company achievements showing that to clients and all visitors, and these days google bots scan announcements a lot too for SEO. I will add a future requests, but crossing my fingers that WHMCS consider add it, in future soon as code already exists from KB articles. πŸ‘
  42. 1 point
    Hi Kingsley, there's no need to do that - in fact, you should never edit the dist.whois.json as you can create a whois.json custom file in the same folder and the update won't touch that file. you should just test those TLDs after an update to ensure that they still work... if they don't, then check to see if an updated entry has been added in the dist.whois.json file. https://docs.whmcs.com/WHOIS_Servers
  43. 1 point
    I've expanded this hook a bit to also cover failed transfers and log everything it does to the activity log. <?php use WHMCS\Database\Capsule; add_hook('DomainTransferCompleted', 1, function($vars) { //This hook will complete to-do items for transfers when the transfer is completed. $toDoID = Capsule::table('tbltodolist') ->where('status', 'In Progress') ->where('title', 'Domain Pending Transfer') ->where('description', 'LIKE', '% ' . $vars['domain'] . '%') ->get(); //Loop through the ID's and set them as completed. foreach ($toDoID as $entry) { $command = 'UpdateToDoItem'; $postData = array( 'itemid' => $entry->id, 'adminid' => '1', //Update this ID to an admin ID 'status' => 'Completed', ); localAPI($command, $postData); logActivity('Clean-up To-do List: ID ' . $entry->id . ' has been set as complete as the transfer completed successfully - Domain ID: ' . $vars['domainid'] . ' - Domain: ' . $vars['domain']); } }); add_hook('DomainTransferFailed', 1, function($vars) { //This hook will update to-do items for ttransfer that fails. $toDoID = Capsule::table('tbltodolist') ->where('status', 'In Progress') ->where('title', 'Domain Pending Transfer') ->where('description', 'LIKE', '% ' . $vars['domain'] . '%') ->get(); foreach ($toDoID as $entry) { $description = Capsule::table('tbltodolist') ->where('id', $entry->id) ->value('description'); $command = 'UpdateToDoItem'; $postData = array( 'itemid' => $entry->id, 'adminid' => '1', //Update this ID to an admin ID 'status' => 'Incomplete', 'description' => '*FAILED* '.$description, ); localAPI($command, $postData); logActivity('Clean-up To-do List: ID ' . $entry->id . ' has been set as incomplete as the transfer has failed - Domain ID: ' . $vars['domainid'] . ' - Domain: ' . $vars['domain']); } });
  44. 1 point
    I suspect the OP wants a tutorial on how to do it rather than purchase commercially... though if he wants to buy, there will be plenty of options in Marketplace. there is an old (v7.4.2) Six RTL template on GitHub - that might be a starting point to compare the LTR Six with it.. https://github.com/mehranranji/WHMCS-7.4.2-RTL-Template
  45. 1 point
    Hi, As I said many times, there's no need to use WordPress, Joomla, Drupal or any other CMS that comes to mind. It takes weeks to get a decent integration and keeping it functional is a never ending process with lot of cons that I'm not going to list now. On the other hand it takes few weeks more to expand WHMCS to the point that you no longer need to use any external software. It took me years and tens of integrations to realize this concept πŸ˜… but now I'm fine since I no longer need to put so much efforts in such a silly activity. There's no question that your page can be integrated in WHMCS and personally I wouldn't consider any other alternative. Using WHMCS in example.com rather than client.example.com makes absolutely no difference. Not to mention that getting rid of WordPress lets you to save time and money for a number of reasons. In conclusion using WordPress and WHMCS feels like using the abacus - that's my personal opinion.
  46. 1 point
    in response to the thread below, please find attached two hooks to generate Homepage Panels to output a clients email history (with clickable links) - don't use both, just choose one! πŸ™‚ The "original" version, that I quickly wrote as a demo for the above thread, links each row to open that email in a new tab/window... The updated "popup" version includes a clickable "button" that opens the email in a popup window (as per the Email History page accessible from the secondary navbar menu)... both panels use Language Translations to display the phrases "Email History", "View All" and "View" in the client's language. the date output uses the Global Date Format (as specified in your general settings -> localisation) - you could easily make it use the Client Date Format, but because we only have limited space for date and subject, I thought it easier to use the shorter global format. currently, the hook obtains ALL of your clients email history - if you want to limit that to a certain amount, e.g 100, then you would add a limit to the query... $clientemails = Capsule::table('tblemails')->where('userid', $client->id)->select('id','subject','date')->orderBy('date','desc')->limit(100)->get(); with additional coding, and probably some new Language Overrides, you should be able to identify each email type (based on the subject), and color the "button" links accordingly... i'm not going to include that version here - not least because it would require a lot of coding (which I haven't done!) to thoroughly cover all email templates and languages , but it would be achievable given the required effort.
  47. 1 point
    firstly, well done for posting your code - it's sad how many users don't share their own solutions. are you thinking specifically of the encrypted clientservices.php page? might be awkward to do that... unless you wrote a hook to change the actual names of the services in the database and then you wouldn't have to worry about tweaking the output in the client/admin areas. the other way in might be the clientsummary.tpl template... which on the frontpage shows the products for an individual client... that at least gives you an identifiable array that you can manipulate with a hook to tweak the product name.
  48. 1 point
    Just an update. I was able to implement this for the client area only like this: includes/hooks/service_customfields.php <?php use WHMCS\Database\Capsule as DB; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } add_hook('ClientAreaPageProductsServices', 1, function($vars) { $fieldId = 1; //Custom field id if (isset($vars['services'])) { $csVals = []; foreach ($vars['services'] as $service) { $fieldVal = ''; $data = DB::table('tblcustomfieldsvalues AS t1') ->leftJoin('tblcustomfields AS t2', 't1.fieldid', '=', 't2.id') ->select('t1.value') ->where('t2.id', $fieldId)->where('t2.type', 'product')->where('t1.relid', $service['id']) ->first(); if (!is_null($data)) { $fieldVal = $data->value; } $csVals[$service['id']] = $fieldVal; } return ['customFields' => $csVals]; } }); templates/six/clientareaproducts.tpl - I have added "- {$customFields[$service.id]}" right after {$service.product} ... <td><strong>{$service.product} - {$customFields[$service.id]}</strong>{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{/if}</td> ... But I am still unable to apply the same logic to the admin area interface where I list the products. I even searched for the "service.product" string in all whmcs files and did not find any except those in the client area that I already applied this to. Does anyone know how do I apply the same to the admin interface? Please help. Thanks!
  49. 1 point
    This will work with either 6.x or 7.x . Sorry, it's been a while since I played around on the WHMCS forums, but here's an updated version. No more editing necessary <?php use WHMCS\View\Menu\Item as MenuItem; use Illuminate\Database\Capsule\Manager as Capsule; /* Add credentials to the end of all secondary sidebars. */ add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { /* Get the credentials. */ $service = Menu::context('service'); $username = "{$service->username}"; $serverid = "{$service->server}"; $domain = "{$service->domain}"; $password = "{$service->password}"; $server = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('hostname'); $ipaddress = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('ipaddress'); $name1 = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('nameserver1'); $name2 = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('nameserver2'); if (is_array($name2)) { $name2 = $name2['0']; } if (is_array($name1)) { $name1 = $name1['0']; } if (is_array($ipaddress)) { $ipaddress = $ipaddress['0']; } if (is_array($server)) { $server = $server['0']; } $password = decrypt($password); /* If the username isn't empty let's show them! */ if ($username != '') { /* Add a panel to the end of the secondary sidebar for credentials. Declare it with the name "credentials" so we can easily retrieve it later. */ $secondarySidebar->addChild('credentials', array( 'label' => 'Service Information', 'uri' => '#', 'icon' => 'fa-desktop', )); /* Retrieve the panel we just created. */ $credentialPanel = $secondarySidebar->getChild('credentials'); $credentialPanel->moveToBack(); /* Show the username. */ $credentialPanel->addChild('username', array( 'label' => $username, 'order' => 1, 'icon' => 'fa-user', )); /* Show the password. */ $credentialPanel->addChild('password', array( 'label' => $password, 'order' => 2, 'icon' => 'fa-lock', )); /* Show the password. */ $credentialPanel->addChild('domain', array( 'label' => $domain, 'order' => 3, 'icon' => 'fa-globe', )); /*show the server IP*/ $credentialPanel->addChild('ip', array( 'label' => $ipaddress, 'order' => 4, 'icon' => 'fa-info', )); /*show the server name*/ $credentialPanel->addChild('server', array( 'label' => $server, 'order' => 5, 'icon' => 'fa-server', )); /*NS1*/ $credentialPanel->addChild('name1', array( 'label' => $name1, 'order' => 6, 'icon' => 'fa-info-circle', )); /*NS2*/ $credentialPanel->addChild('name2', array( 'label' => $name2, 'order' => 7, 'icon' => 'fa-info-circle', )); } });
  50. 1 point
    harder, but not impossible... besides in the above hook, I was just fixing the code to work - not coding it for all eventualities! then you wrap the sidebar creation in an if statement that checks the domain status and reacts accordingly. there were always 3 fundamental problems with the menu system... 1. it should have been launched with a menu manager built into the admin area - it's criminal that it wasn't and users (who may not be coders) should be expected to learn (or buy addons) to modify menus/sidebars. 2. the documentation was, and still is, shockingly poor - for a commercial product, the documentation should both cover the basics and detailed examples too... with an explanation of every option.... much like the class docs does (in a limited way)... at least the menu code isn't written by WHMCS (like a lot of WHMCS), it's a third-party product, so there is limited documentation elsewhere.... and don't get me started on the v6 documentation disappearing! 3. the code for existing navbar/sidebar/panels should be publicly visible/available... seriously, if you want to change one minor thing, why should it be easier (almost necessary) to recreate the hook from scratch... usually by trying to reverse engineer the output into code... ridiculous. I dread to think how much support time has been wasted by this nonsense over the last 2 years. I doubt it's to do with Smarty... though I won't have a bad word said against Smarty - it was one of the first things I completely understood when I first started using WHMCS. i'd like to see an example of that, because your explanation of that process sounds bizarre. again, that comes down to poor documentation - I wish WHMCS would understand that if you made the documentation better, you'd generate more developers - and that can only be good for the product. the logic of the encoding, from what I was told by someone @ WHMCS, was to (among other reasons) prevent users from editing core functions and causing bugs... which has some merit, but I don't see the need to hide the code used to generate existing naviagtion output... it's a complete pain.
  • 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