Professional Documents
Culture Documents
PHP Template Guide - Small
PHP Template Guide - Small
Last Updated : 07/01/02 There are many uses for a template page. You have some old HTML files, or you
can only program in HTML and you want them to viewed in PHPNuke. You may want
to include another kind of file (I don't know, you suggest one), or you just want the
PHPNuke menu and header/footer on this other page. All of those things can be
accomplished using a template page which I have being asked for a lot on the
forums (NukeSupport). I cannot take any credit for this as it is all thanks to
Chris_AU as he was the person who sent me a copy of this template page a long
while ago when I was first starting out as a PHPNuker (or PHPNukist?).
Click on LICENSE up above and you will be taken to the license agreement.
<?php
if (!isset($mainfile)) { include("mainfile.php"); }
If there is no bar at the top; please email me immediately as this site is illegally
hosting my guide and I am receiving no money for it. If you see it on my site then I include("header.php");
get money because there is a popup add - anyway, the money is used to pay for OpenTable();
domain fees and hosting fees.
include("phpnuke.htm");
These guides are free for you to use and the most updated one and the now official CloseTable();
host is located on Nuke-Hosting. The URL for this site is
www.nuketutorials.com. For the latest guide, be sure to go to this page.
include("footer.php");
?>
The script above is the most basic incarnation of the template page. All the other
template pages are related to it. Actually, I meant that if someone were to make
Updates another template page, it would include all of the stuff above. Also note that the
template file must be placed in the root of the directory.
I started this guide today. Hope to finish it soon. I'll probably upload
7th January
it as a quick preview of whats to come. Also note I haven't bothered Now the explaining starts;
2002
to include a contents page yet so you'll have to wait for that :)
Line 1 - <?php
That is the command to start a PHP file and is understood by most servers.
PLEASE SIGN!! Remember how PHP is just another language which uses the server to generate
HTML from other information and variable (and the MySQL database too). It is
Please - If you found this guide helpful or not helpful, or have any comments or usually used to open a PHP file - by 'open' I mean start. When you are using a PHP
suggestions, please sign my guest book as it would mean a lot to me (I've never command in a HTML file, you have to start the PHP section with this command.
had a guest book with more than 10 entries) - also note it might be a bit slow but
please sign it.. Line 2 - if (!isset($mainfile)) { include("mainfile.php"); }
This is the line where if PHPNuke is already running, to 'include' the
Also note, do not put your problems into the guestbook, keep the comments mainfile.php file. This file contains a lot of information relevant to PHPNuke details
short :) If you have any problems with Nuke (or anything else on my site), email such as user details and theme settings. Sure they are saved in a cookie file on
me at seremify@phpnuked.com . On a positive note, I have now got more than 55 your computer somewhere (presumably the cookies folder if you want to hunt them
signings (woah...). down), but mainfile.php is the main file which loads details into PHPNuke.
into the original file. In this case it is asking to include the header.php file which if line. Thus making the script look like this;
you cannot tell by the filename, contains header information such as the logo,
search, and everything else found near the top of your PHPNuke site. Note that the <?php
left and right menus are part of header.php but can be removed. Also note, the if (!isset($mainfile)) { include("mainfile.php"); }
header.php relies on theme information to know what to load which is gathered $index = 0; //or 1 if you like
from cookies or server in the mainfile.php file included above. include("header.php");
OpenTable();
Line 4 - OpenTable();
This is a PHP command which is used in a similar way to tables are used in HTML. include("phpnuke.htm");
They are just 'there' and information is contained inside them. Just like in HTML. CloseTable();
The thing to note is that this is required to ensure that the HTML file (or whatever include("footer.php");
file you choose to include later on) does not go all over the place and require ?>
scrolling. Instead it is kept inside the table boundaries which will not resize.
USING A VARIABLE INSTEAD OF PHPNUKE.HTM
Line 5 - <blank> Coming Soon...
This is just blank to make it look neat and tidy. This is probably the only line which
you should not expect to see in other files. I like it neat as it is easier to see and Hey to all who read this; Well, I'm not sure whether or not anyone really cares much
read at a glance and to know where the different sections are. A neat and tidy about the completion of this guide so therefore I think I'll probably leave it as that. If
programmer is a good programmer (a very nice quote I just made up on the anyone has any ideas or wants me to complete the guide, email me and I'll reconsider
spot...) my options. At the moment (18/1/2002) I'm kind of taking a Nuke-break.
Line 6 - include("phpnuke.htm");
This is obviously the most important part of the file but still relies on other parts to 4. Recommended Sites
run. It uses the 'include' statement and you change the phpnuke.htm part to
whatever file you want included. It can be of any file as long as the server supports
http://www.phpnuke.org/ - The official site which also has information on
the usage of it. Since its using the 'include' statement, I don't think I need to
development of user made addons.
explain it again. Make sure to include a path to the file if the file is not in the root.
The reason why I say the file must be placed in the root is so that it can easily find
the header.php, mainfile.php and the footer.php files without the need for http://www.nukesupport.com/ - An excellent forum (I visit there often) to get help
paths. with many things relating to PHPnuke. This site tends to have more 'newbies' and
'installation' interest.
Line 7 - CloseTable();
This line follows the OpenTable command and closes that table. Kind of like ending http://www.nukeforums.com/ - Another excellent forum to get help with many
the PHP file with the ?> line, except for tables. PHPnuke-related things. This site tends to have more 'programming' interest.
Line 8 - include("footer.php"); http://www.thebix.com/ - An excellent site which is frequently updated with news
This is another 'include' line where all it does is include the footer. This uses from all-over relating to PHPNuke.
information gathered from the mainfile.php loaded earlier.
http://www.nukeresources.com/ - A site which has news on development of
Line 9 - ?> PHPnuke Resources.
The command to end the PHP commands, and usually end the PHP file. This goes
along with the <?PHP .
5. Credits
3. Basic Variations To anyone who is hosting this guide especially Nuke-Hosting for hosting these
guides for me for free.
If you want to add a variation of your own, email me here. If you wish to use a
variation, simply insert the line to your template file and watch the magic. A LOT of help was given to me by the users of NukeSupport Message Boards -
http://www.nukesupport.com/
THE LEFT BAR + THE RIGHT BAR
The left bar is loaded by default when you run the template page but the right bar Another thanks goes to of course Francisco Burzi, the guy who created PHPnuke.
isn't. The right bar usually only appears on index.php but to include it, simple add As well as to his team of people who help him. Then of course to Mandrakesoft for
this line to your script. sponsoring them.
$index = 0; .. and Me :)
Email any issues, problems, illegal hosting or anything about this guide or PHPnuke
It should go in line 3 (move line 3 down one) right after the include mainfile.php
to seremify@phpnuked.com .
Contact Details :
Guest Book
Sign Guestbook View Guestbook
mhtml:file://C:\Temp\Syscomsrl\software\Template%20Guide.mht 22/12/2002