04-18-2010, 01:38 AM
As you can see here, I have added some custom pages to my THT installation. Here's how it's done, in case you're interested.
First, decide what the page will be called. For example's sake, the page will be called "Why us?", and the URL will be "/whyus".
Make a directory in your THT root called "whyus", and touch a file called "index.php". Paste this and save:
Now go to http://yourhosting.com/tht/whyus - You should get this:
Now, edit these PHP variables to your liking:
define("PAGE", "Why us?"): The title of your page. In <title> and the navbar button
define("SUB", "We're different"): As far as I can tell, this is only used in <title>
define("INFO", "Something else here"): This is shown in small text at the top right of the page.
$c_sidebar_title: The title above the sidebar
$c_sidebar: The content in the sidebar
$c_main_title: The title above the main content box
$c_main: The contents of the main content box
Now, we need to add this page to the navbar! Here's how:
1) Log in to your THT admin
2) Click "Look and Feel" in the sidebar
3) Click "Navbar editor"
4) Click "Add NavBar link"
- Name: Must be the same as "define("PAGE".......", otherwise the tab won't be "selected" when you happen to be on that page.
- Icon: Choose one.
- Link: Should be "whyus" or whatever you named the directory we made earlier
5) Drag it to wherever you want, then save and refresh. If you did everything right, you should be done.
If you want a custom page to be the default page (Like I have), you need to make a database edit. Go into phpMA and open up "tht_config". Find "default" and change "order" to "whyus" (your directory name. If you're doing this, you probably want "home", "welcome", etc).
First, decide what the page will be called. For example's sake, the page will be called "Why us?", and the URL will be "/whyus".
Make a directory in your THT root called "whyus", and touch a file called "index.php". Paste this and save:
PHP Code:
<?php
//////////////////////////////////
// The Hosting Tool
// Order Form
// By Jonny H
// Released under the GNU-GPL
//
// Custom pages by rollthebones
//////////////////////////////////
define("LINK", "../includes/");
include(LINK ."compiler.php");
// Variables
define("PAGE", "Why us?"); // What do you want to call this page?
define("SUB", "We're different"); // Give this page a subtitle. From what I can tell, this is only used in the <title> tag.
define("INFO", "IP Logged: ". $_SERVER['REMOTE_ADDR']); // This is shown at the top of the page in small print.
// Sidebar
$c_sidebar_title = "Sidebar Title";
$c_sidebar = "
<p style=\"padding: 5px;\">
~~ Sidebar content goes here ~~
</p>
";
// Main
$c_main_title = "Main Box Title";
$c_main = "
<p style=\"padding: 5px;\">
~~ Main content goes here ~~
</p>
";
// You can ignore everything below this line unless you know what you're doing.
echo $style->get("header.tpl");
$ip = $_SERVER['REMOTE_ADDR'];
echo '<div id="ajaxwrapper">';
echo '<div id="left">';
echo $main->table($c_sidebar_title, $c_sidebar);
echo '</div>';
echo '<div id="right">';
echo $main->table($c_main_title, $c_main);
echo '</div>';
echo '</div>';
echo $style->get("footer.tpl");
include(LINK ."output.php");
?>
Now go to http://yourhosting.com/tht/whyus - You should get this:
Now, edit these PHP variables to your liking:
define("PAGE", "Why us?"): The title of your page. In <title> and the navbar button
define("SUB", "We're different"): As far as I can tell, this is only used in <title>
define("INFO", "Something else here"): This is shown in small text at the top right of the page.
$c_sidebar_title: The title above the sidebar
$c_sidebar: The content in the sidebar
$c_main_title: The title above the main content box
$c_main: The contents of the main content box
Now, we need to add this page to the navbar! Here's how:
1) Log in to your THT admin
2) Click "Look and Feel" in the sidebar
3) Click "Navbar editor"
4) Click "Add NavBar link"
- Name: Must be the same as "define("PAGE".......", otherwise the tab won't be "selected" when you happen to be on that page.
- Icon: Choose one.
- Link: Should be "whyus" or whatever you named the directory we made earlier
5) Drag it to wherever you want, then save and refresh. If you did everything right, you should be done.
If you want a custom page to be the default page (Like I have), you need to make a database edit. Go into phpMA and open up "tht_config". Find "default" and change "order" to "whyus" (your directory name. If you're doing this, you probably want "home", "welcome", etc).