Jump to content

Search the Community

Showing results for 'clientareaprimarysidebar' in content posted by brian!.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


WHMCS.Community

  • WHMCS Beta Program
    • WHMCS 9.0 RC Discussion
  • WHMCS.Community
    • Community Announcements
    • Introduce Yourself
    • MarketConnect Partner Product Status Updates
  • 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
    • News, Announcements & Blogs from WHMCS
    • 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'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
  • RactStudio Club's Topics

WHMCS Version

  • V8.13.x Hotfixes
  • V8.12.x Hotfixes
  • V8.11.x Hotfixes

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

  1. then the hook would be along the lines of the code below - create a .php file in /includes/hooks and paste the code into it... <?php # Add Icons To Service Actions Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $ActionDetails = $primarySidebar->getChild("Service Details Actions"); if (empty($ActionDetails)) { return; } $ActionDetailsChildren = $ActionDetails->getChildren(); $kidsToIcon = ["Login to cPanel","Login to Webmail","Change Password","Cancel"]; foreach($ActionDetailsChildren as $key => $Action_details_child) { if (in_array($key, $kidsToIcon)) { if ($key === "Login to cPanel" || $key === "Login to Webmail"){$newicon = "fa-sign-in-alt";} elseif ($key === "Change Password"){$newicon = "fa-unlock";} elseif ($key === "Cancel"){$newicon = "fa-ban";} $ActionDetails->getChild($key)->setIcon($newicon." fa-fw"); } } }); you can ignore the Upgrade/Downgrade sidebar link if your products don't have upgrade options... if they do, you can easily update the hook to add an icon to it. <?php # Add Icons To Service Actions Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $ActionDetails = $primarySidebar->getChild("Service Details Actions"); if (empty($ActionDetails)) { return; } $ActionDetailsChildren = $ActionDetails->getChildren(); $kidsToIcon = ["Login to cPanel","Login to Webmail","Change Password","Upgrade/Downgrade","Cancel"]; foreach($ActionDetailsChildren as $key => $Action_details_child) { if (in_array($key, $kidsToIcon)) { if ($key === "Login to cPanel" || $key === "Login to Webmail"){$newicon = "fa-sign-in-alt";} elseif ($key === "Change Password"){$newicon = "fa-unlock";} elseif ($key === "Cancel"){$newicon = "fa-ban";} elseif ($key === "Upgrade/Downgrade"){$newicon = "fa-sort";} $ActionDetails->getChild($key)->setIcon($newicon." fa-fw"); } } }); take a look at the following post for a couple of solutions to this...
  2. does it have any language files of its own in the relevant addon module folder, or do you think the strings are hardcoded within the code itself ? I assume the addon module is SwiftModders Feature Requester ? if so, it's not changing the strings on a language change, so there can't be multiple language files within the addon. so it's this sidebar... ? the trick with Sidebars is to not necessarily worry about the URI (though you can use that if you have to) - focus on the menuitemname values and then use them in your ->getChild values in the hook. so as per your hook, if you wanted to change the My Requests to My Topics, it should be... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 10, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('My Info')) && !is_null($primarySidebar->getChild('My Info')->getChild('My Requests'))) { $primarySidebar->getChild('My Info')->getChild('My Requests')->setLabel('My Topics'); } }); if it doesn't work, then I suspect the above hook might be running *before* the addon module has used its own hook to create the custom sidebar in the first place - hence the hook has nothing to modify.... changing the priority value on your hook might help (10 above), but you might need to double check with SwiftModders what the priority of their hook is and adjust accordingly. in terms of the second one, that looks just like a variation of a breadcrumb hook to me... <?php add_hook('ClientAreaPage', 1, function($vars) { $breadcrumb = $vars['breadcrumb']; if ($breadcrumb[1]['label'] == "Feature Requests") { $breadcrumb[1]['label'] = "Features and Requests"; return array('breadcrumb' => $breadcrumb); } }); that "Features & Requests" text could be a language string if you ever needed it to be multilingual, e.g by creating the overrides and using Lang::trans instead.... you can search Lang::trans and my username and you should find loads of working hook examples that uses it.
  3. that's not a bug, it's intentional by design - the space is added by the sidebar.tpl template if a child has an icon.... and it's been in every version of the template since v6.0 was released in 2015 (and would occur similarly in the navbar too). {if $item->hasIcon()}<i class="{$item->getIcon()}"></i>&nbsp;{/if} I guess in most sidebars where icons are used, all of the children have icons (e.g the support menu) and so you might have never noticed this occurring before - it's "fixable" in multiple ways, e.g getting the hook to add a space to the labels of the children with no icons, or adding a "blank" FA icon to those children... <?php # Add Icons To Service Actions Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $ActionDetails = $primarySidebar->getChild("Service Details Actions"); if (!is_null($ActionDetails)) { $ActionDetailsChildren = $ActionDetails->getChildren(); foreach($ActionDetailsChildren as $key => $Action_details_child) { if ($key === "Login to cPanel" || $key === "Login to Webmail"){$newicon = "fa-sign-in-alt";} elseif ($key === "Change Password"){$newicon = "fa-unlock";} elseif ($key === "Cancel"){$newicon = "fa-ban";} else {$newicon = "fa";} $ActionDetails->getChild($key)->setIcon($newicon." fa-fw"); } } });
  4. it's not a custom link, it's a default link that WHMCS isn't disabling - it's a cPanel product... and the Manage SSO link doesn't work anyway... possibly you could argue that it's a bug it isn't disabled, but if I needed to disable it with a hook, it would be simple to do. the examples given in the help docs are just how to do the basics - I tend to disregard them anyway as I still recall the examples first posted when Six was released were buggy and used to crash WHMCS... the class docs can be a useful resource - though there are errors and missing details in there to make life exciting. 🙄 a conditional sidebar hook based on a service's status is simple to do.... <?php # Status Conditional Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $service = Menu::context('service'); $status = $service->status; if ($status == "Active" && !is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions')->addChild('Service Status')->setLabel($status)->setOrder(100); } }); to save time, i'm just adding a child to an existing sidebar if the current service status is Active - if it's not, the hook does nothing... if the status were cancelled/terminated, then it could return a disabled link.... and it could be tweaked to create a new sidebar if necessary and use that instead.
  5. tempted to post this, but it's not what directly you're looking for.... ... though it is modifying a sidebar's content based on a ticket class... the principle would work on product details too if it had to determine to do something (add/edit/remove a sidebar/child) based on the service's status (but there are other ways). for a terminated/cancelled product, those links would be shown, but disabled - do you want to change that and not show them at all under those circumstances ? <?php # Remove Disabled Children From Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $SDA = $primarySidebar->getChild("Service Details Actions"); if (!is_null($SDA)) { $SDAChildren = $SDA->getChildren(); foreach($SDAChildren as $key => $child) { $disabled = $SDA->getChild($key)->isDisabled(); if ($disabled) { $SDA->removeChild($key); } } } }); => if WHMCS wasn't disabling these links, then you could do that manually with a hook, or remove them individually or collectively if you had to... i'm just taking a shortcut based on WHMCS already disabling the links.
  6. that output is defined in the template based on the value of $lockstatus - the tweaked hook below (it's just returning a value for $lockstatus) should prevent it from showing... <?php # Regitrar Lock Filter Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $domain = Menu::context('domain'); $blockedtlds = array('eu','nl'); if (in_array($domain->tld, $blockedtlds) && !is_null($primarySidebar->getChild('Domain Details Management'))) { $primarySidebar->getChild('Domain Details Management')->removeChild('Registrar Lock Status'); function domain_registrar_lock_link_removal_hook($vars) { $managementoptions = $vars['managementoptions']; $managementoptions['locking'] = false; return array ("managementoptions" => $managementoptions, "lockstatus" => "locked"); } add_hook("ClientAreaPageDomainDetails",1,"domain_registrar_lock_link_removal_hook"); } });
  7. I wouldn't bet my life on it, but i'm fairly sure... 🙂 https://docs.whmcs.com/Domains_Management#Viewing.2FEditing_Locking_Status that's definitely not the case - for example, it isn't shown for .uk domains for me because the Nominet module doesn't support it... if a domain isn't assigned to any registrar, or the registrar it is assigned to doesn't support registrar locking, then I think the lock option will not be shown. so your issue is that the registrar supports the locking feature, but is assuming that all TLDs are available for locking. if only this had been posted about five years ago... 🙂 ... which, if you update that hook for recent versions of WHMCS, becomes... <?php # Regitrar Lock Filter Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $domain = Menu::context('domain'); $blockedtlds = array('eu','nl'); if (in_array($domain->tld, $blockedtlds) && !is_null($primarySidebar->getChild('Domain Details Management'))) { $primarySidebar->getChild('Domain Details Management')->removeChild('Registrar Lock Status'); function domain_registrar_lock_link_removal_hook($vars) { $managementoptions = $vars['managementoptions']; $managementoptions['locking'] = false; return array ("managementoptions" => $managementoptions); } add_hook("ClientAreaPageDomainDetails",1,"domain_registrar_lock_link_removal_hook"); } }); this should, for the TLDs listed in the $blocktlds array, remove the two registrar locking links in the red boxes... you could die of old age waiting for WHMCS to do something. 👴 there is a feature request to add this option to domain pricing - 2 years, 18 votes... as with all FR, they could be added in the next release, or you could wait another 5 years and find that it's still not implemented.
  8. yeah - though you wouldn't need the global declaration at the beginning.... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { $footer = '<div><button class="btn btn-success btn-sm btn-block" onclick="jQuery(\'#ticketReply\').click()"><i class="fas fa-pencil-alt"></i> '.Lang::trans('supportticketsreply').'</button></div>'; if (!is_null($primarySidebar->getChild('Ticket Information'))) { $primarySidebar->getChild('Ticket Information')->setFooterHtml($footer); } }); of course, there are other ways for a client to close a ticket - but if you don't know them, then it's unlikely your customers will. 🤪
  9. you're in it 😜 one day i'll do it myself... my greatest hits collection. 🤪 I would have thought it should still work, just as long as what WHMCS had as the department name was what you were checking for. I don't think v8.1 likes how the hook is trying to access the department value from the template... can they reply ? assuming the answer to that question is yes, then... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { GLOBAL $smarty; $departmentid = $smarty->getVariable('departmentid'); $status = $smarty->getVariable('status'); $validdepts = array(4,7); $statuslabel = Lang::trans('supportticketsstatusonhold'); if (in_array($departmentid,$validdepts) && strpos($status,$statuslabel) !== false) { $footer = '<div><button class="btn btn-success btn-sm btn-block" onclick="jQuery(\'#ticketReply\').click()"><i class="fas fa-pencil-alt"></i> '.Lang::trans('supportticketsreply').'</button></div>'; if (!is_null($primarySidebar->getChild('Ticket Information'))) { $primarySidebar->getChild('Ticket Information')->setFooterHtml($footer); } } }); which basically says, if dept is either 4 or 7 AND the status of the ticket is on hold, then do something - in this case, modify the footer...
  10. try the following - pretty sure i've posted it before, but can't find the thread or specific post )might even be in this thread lol)... <?php use WHMCS\View\Menu\Item as MenuItem; use WHMCS\Database\Capsule; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar){ $filename = basename($_SERVER['REQUEST_URI'], ".php"); $parseFile = explode('.', $filename); $client = Menu::context("client"); $clientid = intval($client->id); if ($parseFile['0']!=='clientarea' || $clientid===0){ return; } $primarySidebar->addChild('Client-Balance', array('label' => Lang::trans('availcreditbal'), 'uri' => '#', 'order' => '1', 'icon' => 'fa-money')); $balancePanel = $primarySidebar->getChild('Client-Balance')->moveToBack()->setOrder(0); $balancePanel->addChild('balance-amount', array('uri' => 'clientarea.php?action=addfunds','label' => '<h4 style="text-align:center;">'.formatcurrency($client->credit,$client->currencyId).'</h4>','order' => 1)); $balancePanel->setFooterHtml('<a href="clientarea.php?action=addfunds" class="btn btn-success btn-sm btn-block"><i class="fa fa-plus"></i> '.Lang::trans('addfunds').'</a>'); });
  11. original code from the thread below... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { GLOBAL $smarty; $templatefile = $smarty->getVariable('templatefile'); $client = Menu::context('client'); if (!is_null($client) && in_array($templatefile, array('clientareahome'))) { $SupportPIN = generatePinCode($_SESSION['uid'], 8); $primarySidebar->addChild('Support-Pin', array( 'label' => "Pin de Soporte", 'uri' => '#', 'order' => '10', 'icon' => 'fa-ticket' )); $primarySidebar->getChild('Support-Pin')->setBodyHtml($SupportPIN); } }); the second hook in the file would remain the same as that refers to the admin area.
  12. so as per the above thread, to hide the Clients Details sidebar for everyone, you would use... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->removeChild('Client Details'); } }); but to do what you want to do and hide it from subaccounts only, i'd suggest using this... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { GLOBAL $smarty; $contactid = $smarty->getVariable('loggedinuser')->value['contactid']; if ($contactid && !is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->removeChild('Client Details'); } });
  13. it wouldn't help that you're using a Navbar hook, when you should be using a Sidebar hook instead. 🙂 <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Ticket List Status Filter'))) { $primarySidebar->removeChild('Ticket List Status Filter'); } });
  14. I would just put a spacer div between the two buttons and you can adjust the height to suit your needs... <?php # Modify Sidebat Footer Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $invoicesummary = $primarySidebar->getChild("My Invoices Summary"); if (!is_null($invoicesummary)) { $footer = str_replace(array("col-xs-6 col-button-left","col-xs-6 col-button-right"),"col-xs-",$invoicesummary->getFooterHtml()); $footer = str_replace("/div><div","/div><div style=\"height: 5px\"></div><div",$footer); $invoicesummary->setFooterHtml($footer); } });
  15. there wouldn't really be a file/template you can edit.... well maybe sidebar.tpl, but the coding would be a pain. a quick way to do this would be to use a hook.... <?php # Modify Sidebat Footer Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $invoicesummary = $primarySidebar->getChild("My Invoices Summary"); if (!is_null($invoicesummary)) { $invoicesummary->setFooterHtml(str_replace(array("col-xs-6 col-button-left","col-xs-6 col-button-right"),"col-xs-",$invoicesummary->getFooterHtml())); } });
  16. for what it's worth, this is the way I would do it... <?php # Remove Specific Child Links From Domain Details Management Sidebar Hook @ JokaUK # Written by brian! use WHMCS\View\Menu\Item as MenuItem; use WHMCS\Database\Capsule; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $DDM_Sidebar = $primarySidebar->getChild("Domain Details Management"); if (!is_null($DDM_Sidebar)) { $DDM_SidebarChildren = $DDM_Sidebar->getChildren(); $ValidProducts = array(1,48); $ChildrenToRemove = array('Modify Nameservers','Registrar Lock Status','Auto Renew Settings','Domain Addons'); $client = Menu::context('client'); $domain = Menu::context('domain'); $productcount = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->whereIn('packageid',$ValidProducts)->where('domain',$domain->domain)->count(); if ($productcount > 0) { foreach($DDM_SidebarChildren as $key => $child) { if (in_array($key, $ChildrenToRemove)) { $DDM_Sidebar->removeChild($key); } } function ddm_custom_headeroutput_hook($vars) { $header_return = '<style>#tabNameservers {display: none !important;}</style>'; return $header_return; } add_hook("ClientAreaHeaderOutput",1,"ddm_custom_headeroutput_hook"); } } }); it works in a similar way to yours, but the database query checks whether the current domain has active products (x, y, z etc) associated with it (that array can contain 1 product if that's all you need to currently check for) - if yes, then the count will be positive and the specified sidebar kids will be removed (if they exist) and the CSS applied.
  17. that's not true - you can modify them just like any other sidebar. e.g if you wanted to add a new link to the existing "Service Details Actions" sidebar (the one in your image), you would just need to create a new file in /includes/hooks, and paste the following code into it. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions') ->addChild('Google Link') ->setLabel('Click to visit Google') ->setUri('http://www.google.com') ->setOrder(100); } }); if you wanted to change the existing cPanel and Webmail links, you could use the hook in the thread below... https://forum.whmcs.com/showthread.php?104894-Login-to-cPanel-amp-Webmail-on-Client-Product-Details&p=432807#post432807 and should you want to add a new sidebar to the productdetails page, one way would be to use the following hook.. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar){ $filename = APP::getCurrentFileName(); $action = $_GET['action']; $allowed = array('productdetails'); $client = Menu::context("client"); $clientid = (int) $client->id; if ($filename!=='clientarea' || $clientid===0 || !in_array($action,$allowed)){ return; } $primarySidebar->addChild('Brian Sidebar', array( 'label' => 'New Sidebar', 'uri' => '#', 'order' => '100', 'icon' => 'fa-briefcase' )); $primarySidebar->getChild('Brian Sidebar') ->addChild('Google Link') ->setLabel('Click to visit Google') ->setUri('http://www.google.com'); }); you could expand that hook to show the sidebar on various pages of the clientarea, or even outside of the client area.... there are other ways to check if the user is logged in when adding sidebars/navbars, but I won't list them all here as numerous hook code examples have been posted over the last 18 months showing the various methods. I hope this helps. btw - modifying these sidebars using hooks is probably the preferred method.. if only to avoid the need of updating the templates after each WHMCS update - there are rare occasions when it's easier to just modify the template, but which method you choose really depends on what you want to do and which is the easier method for you!
  18. if you're going down the road of using $clientsstats values, then it should be... GLOBAL $smarty; $paidinvoices = $smarty->getTemplateVars()['clientsstats']['numpaidinvoices']; but perhaps a cleaner way would be to use the $client context instead of GLOBAL $smarty - which allows you to check that they're logged in (e.g a client) before attempting to get the client variables... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $client = Menu::context('client'); if ($client) { $paidinvoices = $client->invoices->where('status','Paid')->count(); if ($paidinvoices < 2 && !is_null($primarySidebar->getChild('Domain Details Management')) && !is_null($primarySidebar->getChild('Domain Details Management')->getChild('Registrar Lock Status'))){ $primarySidebar->getChild('Domain Details Management')->removeChild('Registrar Lock Status'); } } }); the count values should be the same between the two methods.... there are other methods, but either of the above two should be the simplest for your situation.
  19. if you run the docs site through any half decent link verifier, you'll find dozens of 404 errors - some are nofollow example.com links which are only for show and can be discounted, but there are multiple links to cpanel pages that are broken.... and the least the left hand should be able to know is what the right hand is doing! yep - if you're going to release a product that requires PHP knowledge to change a menu(!), then the least they can do is provide working coding examples of the basics. the one I always remember, and I don't think it's there anymore, was a sidebar hook that looked up weather forecasts or temperature by zip code... of course, worked fine for US addresses, but crashed when any outside US address was used.... hardly a good example ! it's a story i've told previously, but the first week or fortnight I got WHMCS back in 2013, I made a list of the errors I kept on finding in the docs - damn thing went of for three sheets of A4 before I gave up... and i'm not even talking development docs, just installing and configuring the software. one of the many reasons why I gave up on beta testing was the regular occurrence of the relevant dev docs coming out long after the GA had been released... it was a joke situation that got passed being funny. well, you could filter on only my posts when i've mentioned a particular hook, e.g ClientAreaPrimarySidebar, and that will find only my PS posts. with regards to hooks for older versions, you might have to remind me with an old example of one that wouldn't work in the latest versions - I don't think the fundamentals of menu hooking have changed that much since 2015. and I wouldn't disagree with that - but we're not in control of that, but I am in control of what I post here and elsewhere. although even if I wrote complete docs and examples on menu hooking and published them on one of my sites, it would be against the forums rules to link to it as it would be classed as self promotion / advertising... in years gone by, I might have written a tutorial here, but those days are long gone.
  20. 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'); } });
  21. Hi Noah, technically as a hook it would be... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions')->getChild('Change Password')->setLabel('Change cPanel Password'); } }); however, if all you are wanting to do is change the label of a default sidebar, then you could use Language Overrides and adjust the strings int eh languages used on your site. $_LANG['serverchangepassword'] = "Change Password"; the caveat I would give to either solution is that you're not checking whether the current service is a cPanel account - now if you only provide cPanel accounts, then this isn't relevant - but if you were in a situation, where you were offering cPanel and Plesk options, you wouldn't want it to say cPanel in the label if it were a Plesk account password.
  22. in the client area, yes - https://developers.whmcs.com/themes/css-styling/ I should warn you that the WHMCS templates are not well designed in terms of CSS and so it's not always accurate enough to be able to easily specify a specific element. let's say you wanted to remove the cPanel login /webmail sidebar links - personally, I would use a hook and such hooks will have been posted here many times over the years... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions') ->removeChild('Login to cPanel') ->removeChild('Login to Webmail'); } }); if you were using Six and wanted to hide those elements using CSS, then it's... #Primary_Sidebar-Service_Details_Actions-Login_to_cPanel, #Primary_Sidebar-Service_Details_Actions-Login_to_Webmail {display:none;} just bear in mind that whilst these elements have been visibly hidden using CSS, the links themselves will still exist in the source code available in the browser and a knowledgable user could still find them - with a hook, they will be removed entirely.
  23. I thought it might be. 🙂 it's worth noting that everyone can access your announcements page by default (if they know where it is) - clients, non-clients... anyone. as an example, here's WHMCS own announcements page - they obviously no longer use it (not for the last 8 years), but you don't need to log in to see it... anyone can find it via Google. https://www.whmcs.com/members/announcements.php if your client area is not like your main site in appearance, then perhaps that is a reason not to use announcements. the two sidebars on the left hand side? you can remove them with a hook and the remaining content will use the deserted space. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Announcements Months'))) { $primarySidebar->removeChild('Announcements Months'); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { GLOBAL $smarty; $templatefile = $smarty->getVariable('templatefile'); if (!is_null($secondarySidebar->getChild('Support')) && $templatefile == 'announcements') { $secondarySidebar->removeChild('Support'); } }); the hook should work on Boxchat without issue and will remove the Announcement Months sidebar (first sidebar) and the Support sidebar (lower one) from the Announcements page only. i'm assuming that there is a .php and.tpl for a custom page with that theme? as currently written, both pages (announcements and blog) would display the same content. indeed... but I don't know if you think that is a good thing or not! 🙂 possibly, with those two sidebars now removed from the announcements page, it might be a simpler option to rename it to Blog and use that. however, if not, you can be in control of what content is displayed on these pages... e.g if you are saying that you only want specific blog posts/announcements to appear on the blog page, and you don't want those blog posts to appear in announcements, then that's doable... in fact, I can think of ways where you could create announcement posts for multiple different blogs and use the hook (or the php file) to determine what is shown on which blog page and/or announcements page... but let's not overcomplicate the issue if all you wanted to do is remove those two sidebars! 😀
  24. Hi Mahim, <?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('Services Divider') ->removeChild('Order New Services') ->removeChild('View Available Addons'); } if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing') ->removeChild('My Quotes'); } }); add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Edit Account Details') ->removeChild('Security Settings') ->removeChild('Contacts/Sub-Accounts'); } }); add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setFooterHtml(''); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->removeChild('Client Shortcuts'); } if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } if (!is_null($secondarySidebar->getChild('My Services Actions'))) { $secondarySidebar->removeChild('My Services Actions'); } }); only that final IF statement is new - the rest is as before. i'll take a look.
  25. you can do most of it in one file - so if I merge all the hooks on this page into one file, we get... <?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('Services Divider') ->removeChild('Order New Services') ->removeChild('View Available Addons'); } if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing') ->removeChild('My Quotes'); } }); add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Edit Account Details') ->removeChild('Security Settings') ->removeChild('Contacts/Sub-Accounts'); } }); add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setFooterHtml(''); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->removeChild('Client Shortcuts'); } if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } }); take care not to still have any other active hook files trying to remove the same elements... removing the tile on the client area homepage is usually done by editing the clientareahome.tpl template - if you just wanted to remove any (or all) of them, then you can do that with css... .tile:nth-child(2) {display: none;} ... but that will leave a space at the end... I assume from your screenshot, that you don't sell domains - and that second tile normally gives the total for domains, failing that affiliate total or as a last resort, quotes... if you're going to edit the template, then you can either remove that second tile and adjust the width of the other three... <div class="tiles clearfix"> <div class="row"> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=services'"> <a href="clientarea.php?action=services"> <div class="icon"><i class="fas fa-cube"></i></div> <div class="stat">{$clientsstats.productsnumactive}</div> <div class="title">{$LANG.navservices}</div> <div class="highlight bg-color-blue"></div> </a> </div> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='supporttickets.php'"> <a href="supporttickets.php"> <div class="icon"><i class="fas fa-comments"></i></div> <div class="stat">{$clientsstats.numactivetickets}</div> <div class="title">{$LANG.navtickets}</div> <div class="highlight bg-color-red"></div> </a> </div> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=invoices'"> <a href="clientarea.php?action=invoices"> <div class="icon"><i class="fas fa-credit-card"></i></div> <div class="stat">{$clientsstats.numunpaidinvoices}</div> <div class="title">{$LANG.navinvoices}</div> <div class="highlight bg-color-gold"></div> </a> </div> </div> </div> or you just replace the second tile with something else more relevant to your install. you can even increase the number of tiles if you want to (and have something to put in them!), but that would have layout consequences for non-English languages (where the translations are longer than one line of text)... I think there would be a scenario where you could remove and adjust the other tiles with jQuery, but it really would be easier to just edit the template. 🙂
×
×
  • 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