Jump to content

Disable header and footer


Kian

Recommended Posts

Hello. From documentation. Every page of WHMCS is a combination of 3 templates

 

header.tpl

The Page Template

footer.tpl

 

"The Page Template" is everyting you can find inside your WHMCS (clientareahome.tpl, announcements.tpl, knowledgebase.tpl). My question is very simple. How can i take "The Page Template" without header and footer? I have to include or iframe a part of my WHMCS in a website but i don't need header and footer. How can i exclude them?

Link to comment
Share on other sites

So are you saying you want to use all the files that come within WHMCS but just without the Header and Footer?

If so do you still need to use WHMCS direct if not then you could have blank header and footer.

but you you do need WHMCS direct then look at putting a else if statement in the header and footer files.

Link to comment
Share on other sites

Thank you for reply

 

No, it's more simple :) i don't want to use all the files of WHMCS. I don't even need any of its features. I have a custom page (php & tpl) that simply makes a query in WHMCS database and show results. It's a public page. Login, cookie, function and variabiles of WHMCS are not reqired,

 

I have to include() or iframe this page on external website that's why i need to disable header and footer. I'm going to use header and footer of the external website. I know that i can skip this problem with a bit of coding but i really don't want to spend time on it.

Edited by Kian
Link to comment
Share on other sites

Uhm... tpl is empty (html tables only) so i have to edit the related php file. It's the review.php module

<?php

 

 

 

require("dbconnect.php");

require("includes/functions.php");

require("includes/clientareafunctions.php");

 

$pagetitle = "Reviews";

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

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

 

initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav);

function HTMLKAC($value) {

$value = str_replace("<", "<", $value);

$value = str_replace(">", ">", $value);

return $value;

}

function uc_first($str){

$str[0] = strtr($str,

"abcdefgh�ijklmnopqrstuvwxyz".

"\x9C\x9A\xE0\xE1\xE2\xE3".

"\xE4\xE5\xE6\xE7\xE8\xE9".

"\xEA\xEB\xEC\xED\xEE\xEF".

"\xF0\xF1\xF2\xF3\xF4\xF5".

"\xF6\xF8\xF9\xFA\xFB\xFC".

"\xFE\xFF",

"ABCDEFGHI�JKLMNOPQRSTUVWXYZ".

"\x8C\x8A\xC0\xC1\xC2\xC3\xC4".

"\xC5\xC6\xC7\xC8\xC9\xCA\xCB".

"\xCC\xCD\xCE\xCF\xD0\xD1\xD2".

"\xD3\xD4\xD5\xD6\xD8\xD9\xDA".

"\xDB\xDC\xDE\x9F");

return $str;

}

$yorumlar = @mysql_query("SELECT userid, yorum, soyadgoster, emailgoster, tarih FROM mod_yorumlar WHERE onay='1' ORDER BY tarih DESC");

$row_yorumlar = @mysql_fetch_assoc($yorumlar);

$totalRows_yorumlar = @mysql_num_rows($yorumlar);

$i = 0;

if($totalRows_yorumlar > 0) {

do {

$row_musteri = mysql_fetch_assoc(mysql_query("SELECT firstname, lastname, email FROM tblclients WHERE id='".$row_yorumlar['userid']."'"));

if($row_yorumlar['soyadgoster'] == 1) {

$isim = uc_first($row_musteri['firstname'])." ".uc_first($row_musteri['lastname']);

} else {

$isim = uc_first($row_musteri['firstname']);

}

if($row_yorumlar['emailgoster'] == 1) {

$email = "<a href='mailto:".$row_musteri['email']."'>".$row_musteri['email']."</a>";

} else {

$email = "<i>Hidden</i>";

}

$yorum = HTMLKAC($row_yorumlar['yorum']);

$tarih = $row_yorumlar['tarih'];

$yorumlari[$i]['isim'] = $isim;

$yorumlari[$i]['yorum'] = $yorum;

$yorumlari[$i]['email'] = $email;

$yorumlari[$i]['tarih'] = date("d.m.Y", $tarih);

$i++;

} while($row_yorumlar = mysql_fetch_assoc($yorumlar));

}

 

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["yorumlari"] = $yorumlari;

 

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

 

$templatefile = "reviews";

 

outputClientArea($templatefile);

?>

It's based on your tpl customization. I don't understand what part i have to remove to delete header and footer

Link to comment
Share on other sites

  • 2 months later...

I used IF function with page title. Let's suppose that i have Reviews page (review.php & review.tpl). Page title is "Reviews". I want to hide header for this WHMCS page. Let's open header.tpl. We have something similar:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset={$charset}" />
<title>{$companyname} - {$pagetitle}{if $kbarticle.title} - {$kbarticle.title}{/if}</title>
{if $systemurl}<base href="{$systemurl}" />
{/if}<link rel="stylesheet" type="text/css" href="templates/{$template}/style.css" />
<script type="text/javascript" src="includes/jscript/jquery.js"></script>
</head>
<body>
[ the rest of the page ]
[ the rest of the page ]
[ the rest of the page ]
[ the rest of the page ]

Simply add IF function:

{if $pagetitle eq "Reviews"}
{else}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset={$charset}" />
<title>{$companyname} - {$pagetitle}{if $kbarticle.title} - {$kbarticle.title}{/if}</title>
{if $systemurl}<base href="{$systemurl}" />
{/if}<link rel="stylesheet" type="text/css" href="templates/{$template}/style.css" />
<script type="text/javascript" src="includes/jscript/jquery.js"></script>
</head>
<body>
[ the rest of the page ]
[ the rest of the page ]
[ the rest of the page ]
[ the rest of the page ]

I get $pagetitle. If $pagetitle is "Reviews" stop showing the content of the page else show everyting. Examples:

 

I visit knowledgebase.php. Is page title "Reviews"? No. Show everything.

I visit announcements.php?id=12. Is page title "Reviews"? No. Show everyting.

I visit reviews.php. Is page title "Reviews"? Yes. Show only the content between {if $pagetitle eq "Reviews"} and {else} (in my case nothing).

Link to comment
Share on other sites

  • 2 years later...

I dont see a reason for this to be fair. look at it this way, If you want all the pages across your website to have a unified design then the three template system is ideal.

 

Headers

 

Body

 

Footer

 

It saves replication of code across many files, this means you save disk space. If you decide to move everything into the body section of the website then that means every body template needs to contain a complete webpage.

 

The only reason i could possibly conceive of you wanting to be doing this is that you are calling up the installation from another website using their header and footer and using your white label installation to run many hosting companies.

 

Thats an idea of course but not one i would want to do. If that were the way in which you wanted to do it, then you could just create those header and footer files for those sites within the installation, you would simply need to run a check to see what domain is calling up the installation. It would also allow you to keep the installation intact and looking good for anybody that happens to come along to the installation website.

Link to comment
Share on other sites

It think that you forget that 90% of "real" installations is using whmcs only for billing and back office. Sure 100's of startups is trying to make a functional website of it but realistically you are very restricted in what you can do with it.

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