- PHP



, -! 2003-09-08
: dmitry : [1]

- . , , - , . - 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"; //   
?>
, :
  1. include - <title> .
  2. if (!eregi("index.php", $PHP_SELF)) { die ("Access denied"); }
    - , , , include .. config.php. , , .htaccess:
    <files *.php>
    deny from all
    </files>
    
  3. include - , .1
  4. : , , , .. , , , HTML- , :
    <?
     PageNavigation(module params);
     PageLeftMenu(module params);
     // PHP-,  
     PageRelatedLinks(module params);
     PageNewsLinks(module params);
     PageVotes(module params);
     PageBanner(module params);
    ?>
    
  5. ,
, , .

, - (- ) , 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


:
https://dmitry.rsl.ru/



, , ( , + ). !

: www.wr-script.ru, 2004-2024.

. WR-Script.ru!

WEB-

WR-Счётчик