Diesel Posted June 30, 2009 Share Posted June 30, 2009 Hi, I am busy evaluating WHMCS and I really like it. Before I buy a license I wanted to see how difficult it will be for me to create custom pages, so I am using the instructions found here. I am trying to create a page named about.php. I have done it exactly as per the above documentation and created a page called about.tpl and in that I simply typed in "Hello World!". All I get is a blank page when loading the php file in the browser. I've not worked with tpl files before so I could be getting this all wrong, please be gentle (can't find an answer here using search). The only thing I can think of that might be causing this is because I am still using the evaluation license? It's not a deal-breaker for me if I can't get it right. I could emulate the layout of the template using plain HTML/CSS, but I figured I'd give this a go first. Any help would be much appreciated. 0 Quote Link to comment Share on other sites More sharing options...
jaygreentree Posted June 30, 2009 Share Posted June 30, 2009 have you uploaded the about.tpl to /templates/{$template}/ where {$template} is the name of the template? 0 Quote Link to comment Share on other sites More sharing options...
Diesel Posted June 30, 2009 Author Share Posted June 30, 2009 Yup, several times! 0 Quote Link to comment Share on other sites More sharing options...
jaygreentree Posted June 30, 2009 Share Posted June 30, 2009 is the about.php in your whmcs directory? also do you have php errors off? if so turn them on and see if any errors show. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted June 30, 2009 Share Posted June 30, 2009 Make sure you have $templatefile = "[color=red]about[/color]"; in the php. 0 Quote Link to comment Share on other sites More sharing options...
Diesel Posted June 30, 2009 Author Share Posted June 30, 2009 Here's the code for the about.php file (which is in the right place): <?php define("CLIENTAREA",true); require("/home/myuser/public_html/accounts/billing/dbconnect.php"); require("/home/myuser/public_html/accounts/billing/includes/functions.php"); require("/home/myuser/public_html/accounts/billing/clientareafunctions.php"); $pagetitle = $_LANG['clientareatitle']; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="http://mydomain.net/accounts/billing/about.php">'.$_LANG['globalsystemname'].'</a>'; $breadcrumbnav .= ' > <a href="http://mydomain.net/accounts/billing/about.php">About</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template $smartyvalues["variablename"] = $value; # Define the template filename to be used without the .tpl extension $templatefile = "about"; outputClientArea($templatefile); ?> The about.tpl file I originally just had "Hello World" in the code. Got a blank. I then copied the entire code from the homepage.tpl to my new page to see if it would work but still just get the blank page. Before I put the absolute path in the php file I was getting PHP errors, but now I only get the blank page. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 1, 2009 Share Posted July 1, 2009 <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); if ($CONFIG['Version'] >= "3.8.1") {require("includes/clientareafunctions.php");} $pagetitle = "About Us"; $pageicon = "images/supporttickets_big.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > <a href="index.html">About Us</a>'; if ($CONFIG['Version'] >= "3.8.1") {initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav);} else {require("init.php");} # Define the template filename to be used without the .tpl extension $templatefile = "about"; if ($CONFIG['Version'] >= "3.8.1") {outputClientArea($templatefile);} else {require("display.php");} ?> 0 Quote Link to comment Share on other sites More sharing options...
Diesel Posted July 1, 2009 Author Share Posted July 1, 2009 Aha! Thank you! That works perfectly. I guess it must have been the changing of index.html to about.php that was causing the screw up. 0 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.