- . ,
, - ,
. - PHP,
, , PHP Nuke.
, , ,
, , "" ,
, web-,
,
.
, ,
PHP Nuke ,
PHP, , .
, "", :
, index.php.
, , $module, ,
- . index.php
: <?
include "config.php";
if (!$module || !file_exists("modules/$module.inc.php")) {
$module="default";
}
include "modules/$module.inc.php";
?>
"" : <?
if (!eregi("index.php", $PHP_SELF)) { die ("Access denied"); }
$page_title="..."; //
include "includes/header.php"; //
// <a href="/php">php</a> - ,
include "includes/footer.php"; //
?>
, :
- include -
<title> .
-
if (!eregi("index.php", $PHP_SELF)) { die ("Access denied"); }
-
,
, , include ..
config.php. , ,
.htaccess: <files *.php>
deny from all
</files>
- include -
, .1
-
: , , ,
.. ,
, ,
HTML- ,
:
<?
PageNavigation(module params);
PageLeftMenu(module params);
// PHP-,
PageRelatedLinks(module params);
PageNewsLinks(module params);
PageVotes(module params);
PageBanner(module params);
?>
- ,
,
, .
,
-
(- )
, PHP .
- Web-,
, : class WebPage
{
// ,
// -,
function WebPage()
{
$this->page_title="-";
}
function PageHeader()
{
include "includes/header.inc.php";
// <?=$page_title;?> <?=$this->page_title;?>
}
function PageFooter()
{
include "includes/footer.inc.php";
}
function PageNavigation()
{
//
}
function PageLeftMenu()
{
//
}
function PageContent()
{
// ,
}
function PageRelatedLinks()
{
// ,
}
function PageNewsLinks()
{
// ,
}
function PageVotes()
{
// ,
}
function PageBanner()
{
// ,
}
function Run()
// - Run
// WebPage
{
$this->PageNavigation();
$this->PageLeftMenu();
$this->PageContent();
$this->PageRelatedLinks();
$this->PageNewsLinks();
$this->PageVotes();
$this->PageBanner();
}
}
?>
, , , ,
,
, WebPage: class CoolPage extends WebPage
{
// ,
function CoolPage()
{
// - - ? ;)
parent::WebPage();
$this->page_title=" ";
}
function PageContent()
{
//
}
}
,
: class CoolPageWithoutNews extends CoolPage
{
// CoolPageWithoutNews
// PHP
// " "
function PageNewsLinks()
{
// ,
}
}
.
, ,
,
, ,
, , PHP ,
.
index.php,
" ": <?
include "config.php";
include "base_classes.php";
if ($module && file_exists($file="modules/$module.inc.php")) {
// , ""
include $file;
}
if (!class_exists($module)) {
// ,
$module="WebPage";
}
$page=new $module; //
$page->Run(); //
}
?>
: ,
, , ,
, ,
, - dmitry.rsl.ru