Ja gibt es für V6 ohne Sidebar Eintrag
<?php
define("CLIENTAREA", true);
//define("FORCESSL", true); // Uncomment to force the page to use https://
require("init.php");
$ca = new WHMCS_ClientArea();
$ca->setPageTitle("Your Page Title Goes Here");
$ca->addToBreadCrumb('index.php', $whmcs->get_lang('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
$result = mysql_query("SELECT firstname FROM tblclients WHERE id=" . $ca->getUserID());
$data = mysql_fetch_array($result);
$clientname = $data[0];
$ca->assign('clientname', $clientname);
} else {
# User is not logged in
}
# Define the template filename to be used without the .tpl extension
$ca->setTemplate('mypage');
$ca->output();
Für V6 mit Sidebar Eintrag
<?php
use WHMCS\ClientArea;
use Illuminate\Database\Capsule\Manager as Capsule;
define('CLIENTAREA', true);
//define('FORCESSL', true); // Uncomment to force the page to use https://
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
*/
$client = Capsule::table('tblclients')->where('id', $ca->getUserID())->first();
$ca->assign('clientname', $client->firstname);
} 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('mypage');
$ca->output();
-------
Weitere Infos hier