natanray Posted December 22, 2020 Share Posted December 22, 2020 Hello, I am using a custom support pin hook in WHMCS. The code is below: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { $client = Menu::context('client'); if (!is_null($client)) { $SupportPIN = generatePinCode($_SESSION['uid'], 5); $primarySidebar->addChild('Support-Pin', array( 'label' => "Support Pin", 'uri' => '#', 'order' => '1', 'icon' => 'fa-key' )); $primarySidebar->getChild('Support-Pin')->setBodyHtml($SupportPIN); } }); add_hook('AdminAreaClientSummaryPage', 1, function($vars) { return 'Support Pin: ' . generatePinCode($vars['userid'], 5); }); function generatePinCode($clientid = 0, $length = 6){ $clientid = intval($clientid); preg_match_all('!\d+!', md5(date("y" . $clientid)), $matches); $numbers = join("", $matches[0]); return substr($numbers, 0, $length); } This code is giving below UI in our WHMCS clientarea. (Pic: Screenshot (292).png) But I would like to show the Support Numbers in the another screenshot format. Like some boxes around the numbers and just a copy option right side. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 23, 2020 Share Posted December 23, 2020 16 hours ago, natanray said: But I would like to show the Support Numbers in the another screenshot format. Like some boxes around the numbers and just a copy option right side. then you could always buy the addon module that generates that screenshot from Marketplace - it's only $15 and i'm sure @string would appreciate it! 🎁 visually, it's just restyling the PIN content of the body with CSS or images; and then adding a footer that contains clipboard copy, recycle and help button functionality. technically, that's not complicated to do, but I see no point in reinventing the wheel and potentially damaging income to a developer, when they have already spent time coding what you want to do. just because I know how to do what you want, doesn't mean that I need to or, more importantly, should tell you.... buy the addon! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.