Jump to content

whmcs html integration (custom pages)


Ilyas

Recommended Posts

Hey,

 

I am trying to integrate my whole website (html) with whmcs.

The header, footer and homepage went great and now I want to add other pages to whmcs.

 

I tried this code ->

 

<?php

define("CLIENTAREA",true);
//define("FORCESSL",true); // Uncomment to force the page to use https://

require("init.php");

$ca = new WHMCS_ClientArea();

$ca->setPageTitle("Windows Hosting");

$ca->addToBreadCrumb('index.php',$whmcs->get_lang('globalsystemname'));
$ca->addToBreadCrumb('windows-hosting.php','Windows Hosting');

$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('windows-hosting');

$ca->output();

?>

 

This kind of works but it doesn't give me a blank working area. the title and some links appear when I visit the page.

How can I build my pages completely around whmcs? It would be awesomne for customer experience if everything is integrated in whmcs.

 

thx in advance!

Link to comment
Share on other sites

Create windows-hosting.tpl file inside the directory of your active template and write "I'm super cute!" inside of it. Now visit windows-hosting.php and you will find your "I'm super cute!" between the header and footer.

 

I already knew that. This way it is displaying a title above the custom content of that page.

 

https://client.phasehosting.be/windows-hosting.php'>https://client.phasehosting.be/windows-hosting.php <- like this

 

But what I want to achieve is like my homepage. -> https://client.phasehosting.be/

If I can do that then I can build around whmcs and have my content blended with the client area. that way I can replace

my main website with a fully integrated whmcs version.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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