Welcome To myPHPNuke.com

  Create An Account Home  ·  Topics  ·  Stats  ·  Your Account  ·  Submit News  ·  Top 10 May 20, 2013  

  Main Menu

  Just SOME MPN Driven Sites!!

  What Is myPHPNuke?
myPHPNuke Introduction
Would you like to contribute to our website or software?

Just Click Here and tell us about yourself.
Printer Friendly Page   Printer Friendly Page Send this Story to a Friend  Send this story to a friend

Adding custom html pages to myPHPNuke
01 January 1995

If you've been wondering how to add custom html based pages to myPHPNuke, this is where you'll find the answer.

There are two main kinds of html page that we place into myPHPNuke. The biggest things to remember when placing html pages into
myPHPNuke is that their headers and footers already exist, through myPHPNuke.
So all you will be supplying is the code for the “body” of the page. Also remember this, you will need to make a PHP page to "call" your html page.
myPHPNuke is made with PHP, so we will basically be "wrapping" your new html within a PHP page in order to display it within myPHPNuke.
If your html page is called example.htm, you might want to call your php page example.php. Also, your .php page must be in the main directory but your html pages can be in sub directories like this sub1/example.htm


1. Here is our first example.
As you can see it is quite simple and is comprised of mostly “include” statements.

!!! CODE !!!

include("extention.inc");
include("mainfile.$phpEx");
include("header.$phpEx");
//include the html file here
include("example.htm");
//end including the html file
include("footer.$phpEx");
?>

The above code is the code that you would use to make your example.php page work.
The html page that you call on (i.e. example.htm) can be any html page,
remembering that it is just regular html, without head or footer.

2. Our second example. This page is quite a bit more complicated than the first.
The PHP was supplied by our friends over at the German myPHPNuke support site.
Basically the difference with this script is that it leaves the rest of the site, entirely intact.
The other script left a lot of stuff out, for the sake of simplicity.

!!! CODE !!!

/************************************************************/
/************************************************************/
include("extention.inc");
if(!isSet($mainfile)) {
include ("mainfile.$phpEx");
}
$index = 1;
automatednews();
function theindex() {
global $storyhome, $httpref, $httprefmax, $topicname, $topicimage, $topictext, $datetime, $user, $cookie, $nuke_url;
global $banners, $nobanner, $mpnTables, $phpEx;
include("header.$phpEx");
/* if ($banners && !$nobanner) {
include("banners.$phpEx");
} */
if (isset($cookie[3])) {
$storynum = $cookie[3];
} else {
$storynum = $storyhome;
}
/******************************************************************************/
/* HTML-Code wird in Form einer Datei eingebunden - Name ist beliebig wählbar */
/******************************************************************************/
include("example.htm");
/************************************************************/
include("footer.$phpEx");
}

switch ($op) {
case "whatsnew":
whatsnew();
break;

default:
theindex();
break;
}

?>

Once again, The above code is the code that you would make your example.php page work.
Back to Main


[ Back to MPN 1.8.8 Tutorials | Sections Index ]



  ChatBox II
smartvicky >  
sailwell >  hi
sailwell >  any body in?
sailwell >  i have instalation problem
sailwell >  any one help me
duke-leto >  kiril are you on here?
santeriablooms29 >  hello good day....



Click here to open the chatbox...
0 people chatting right now.