Mahmoud Posted October 7, 2017 Share Posted October 7, 2017 I've followed the instructions to make a special page but nothing appears! https://developers.whmcs.com/advanced/creating-pages/ hosting is My page! <?php use WHMCS\ClientArea; use WHMCS\Database\Capsule; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Your Page Title Goes Here'); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('mypage.php', 'Your Custom Page Name'); $ca->initPage(); //$ca->requireLogin(); // Uncomment this line to require a login to access this page // To assign variables to the template system use the following syntax. // These can then be referenced using {$variablename} in the template. //$ca->assign('variablename', $value); // Check login status if ($ca->isLoggedIn()) { /** * User is logged in - put any code you like here * * Here's an example to get the currently logged in clients first name */ $clientName = Capsule::table('tblclients') ->where('id', '=', $ca->getUserID())->pluck('firstname'); // 'pluck' was renamed within WHMCS 7.0. Replace it with 'value' instead. // ->where('id', '=', $ca->getUserID())->value('firstname'); $ca->assign('clientname', $clientName); } else { // User is not logged in $ca->assign('clientname', 'Random User'); } /** * Set a context for sidebars * * @link http://docs.whmcs.com/Editing_Client_Area_Menus#Context */ Menu::addContext(); /** * Setup the primary and secondary sidebars * * @link http://docs.whmcs.com/Editing_Client_Area_Menus#Context */ Menu::primarySidebar('announcementList'); Menu::secondarySidebar('announcementList'); # Define the template filename to be used without the .tpl extension $ca->setTemplate('hosting'); $ca->output(); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 7, 2017 Share Posted October 7, 2017 11 hours ago, Mahmoud said: $ca->setTemplate('hosting'); does the hosting.tpl template exist in the templates/six (or your custom)/ folder ?? 1 Quote Link to comment Share on other sites More sharing options...
Mahmoud Posted October 8, 2017 Author Share Posted October 8, 2017 Yeah in my custom ! 0 Quote Link to comment Share on other sites More sharing options...
WebsiteIntegrations Posted October 8, 2017 Share Posted October 8, 2017 Odd, its not your code because I tried it out and its working on my install. 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 8, 2017 Share Posted October 8, 2017 1 minute ago, WebsiteIntegrations said: Odd, its not your code because I tried it out and its working on my install. same here... 1 Quote Link to comment Share on other sites More sharing options...
Mahmoud Posted October 8, 2017 Author Share Posted October 8, 2017 Thank you all the problem was not add hook I have followed the following post and the solution was thank you 0 Quote Link to comment Share on other sites More sharing options...
WebsiteIntegrations Posted October 8, 2017 Share Posted October 8, 2017 13 hours ago, Mahmoud said: Thank you all the problem was not add hook I have followed the following post and the solution was thank you Glad to hear you got it figured out 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.