با سلام یک کمک در مورد اضافه کردن صفحه جدید در whmcs می خوام
صفحه ایجاد میکنم ولی چیزی نمیتونم توش بنویسم
نمایش نسخه قابل چاپ
با سلام یک کمک در مورد اضافه کردن صفحه جدید در whmcs می خوام
صفحه ایجاد میکنم ولی چیزی نمیتونم توش بنویسم
می خوام صفحه اصلی به سایت اضافه کنم که نره صفحه کاربران این نماد گیر داده واسه اون می خوام ...
درود.
فایل قالب در مثال بالا: mypage.tplکد:<?php
use WHMCS\Database\Capsule;
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', 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');
$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();
منبع: http://docs.whmcs.com/Creating_Pages
دوستان index اصلی می خوام صفحه اصلی که میری سایت نره مستقیم توی whmcs
فایل index.php رو پاک کنید (چون برای ناحیه کاربری ریدایرکت میشه به clientarea.php) و سپس یک فایل با همان نام index.php بسازید و هرچیزی میخواید بگذارید توش.
اگر میخواید هدر و فوتر سایت مثل صفحهات دیگر لود شه و ... از کدی که بالا دادم استفاده کنید .
اگر هم نه, یک تک صفحه جدا بسازید.