Jump to content

Creating pages --> loads as blank?


Diesel

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

<?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");}

?>

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