Jump to content

Non-logged in template pages


jackgordon

Recommended Posts

I am having a bit of trouble trying to create extra template pages within WHMCS that the user could have access to without logging in.

 

I want to create a page that is linked to from the header menu. I want this to be available to people who are not logged in. I can get the link in the menu, but I can't get a page to display the data I put into it.

 

Normally, I would emulate one of the php pages in the root directory, but since they are all encrypted that does not seem to be an option.

 

I do not want to link to outside of WHMCS if I don't have to.

 

Is there a way to do this?

Link to comment
Share on other sites

Thanks Cafe. I found that page, but am still having trouble.

 

Here are some questions that may help clear things up...

 

I copied the code verbatim into a text file and saved it as "links.php". Then the directions are unclear.

 

They say:

Edit $breadcrumbnav and $templatefile to match the filename of the page you want to create. Eg. If you were creating a page called aboutus, you would edit $templatefile = "homepage"; to $templatefile = "aboutus";. Save this as a php file and upload to your root WHMCS directory (eg. example.com/whmcs)

 

I understand what to do to the "$templatefile", but there are two lines called "$breadcrumbsnav":

$breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>';

$breadcrumbnav .= ' > <a href="mypage.php">My Page</a>';

 

So what do I do with these? The php file is named "link.php" - do one or both of these get defined as "links.php"? If not both, then which one? And what do I do with the other one?

 

Then, for the template file, can it be pure html or does it require any smarty or php code?

Link to comment
Share on other sites

$breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>';
$breadcrumbnav .= ' > <a href="YOU NEW PAGE LINK HERE.php">YOU NEW PAGE NAME HERE</a>'; 


# Define the template filename to be used without the .tpl extension

$templatefile = "THE NAME OF YOUR NEW .TPL PAGE HERE"; 

outputClientArea($templatefile);

Link to comment
Share on other sites

hmmm... still having an issue

 

here is what I have in the main WHMCS directory, called links.php

 

<?php

 

define("CLIENTAREA",true);

 

require("dbconnect.php");

require("includes/functions.php");

require("includes/clientareafunctions.php");

 

$pagetitle = $_LANG['clientareatitle'];

$pageicon = "images/support/clientarea.gif";

$breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>';

$breadcrumbnav .= ' > <a href="links.php">Industry Links</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 = "links";

 

outputClientArea($templatefile);

 

?>

 

Then, for links.tpl in the template directory, I just copied contact.tpl and renamed the copy links.tpl to test it.

 

But when I go to domain.com/whmcs/links.php, all I get is a completely blank page.

 

Can you see what I am doing wrong?

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