PHP
  Home arrow PHP arrow Page 2 - Building a Site Engine Using PHP, Part...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Building a Site Engine Using PHP, Part 3
By: James Murray
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 48
    2004-06-28

    Table of Contents:
  • Building a Site Engine Using PHP, Part 3
  • Wanna Go Out on a Data?
  • Stop Blocking Me
  • Insert Username Here

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a Site Engine Using PHP, Part 3 - Wanna Go Out on a Data?


    (Page 2 of 4 )

    The database is just as easy and logical as the file system -- actually it’s a lot easier. The first thing I’d like to show you is all the different tables, and what they're used for.

    Block_location: This table contains all the data that directs the blocks on where to load, when to load, and what site to load on.

    Blocks: This table contains all the data for the block’s title, filename, plug-in dependence, module dependence, authentication level, and verification of what site to load on.

    Group_users: This table contains all the data that specifies what groups a user belongs to and on which site.

    Groups: This table contains all the data that defines the group’s names.

    Module_status: This table contains all the data that regulates what modules are initialized and for which site.

    Modules: This table contains all the data that specifies a module’s name, filename, directory, author name, version number, module type, and plug-in dependence.

    Plugin_status: This table contains all the data that regulates what plug-ins are initialized and for which site.

    Plugins: This table contains all the data that specifies a plug-in’s name, filename, directory, author name, version number, plug-in type, and loading priority.

    Sites: This table contains all the data that defines each site’s name and host.

    Template_users: This table contains all the data that specifies what template is currently being used, and by what user (if users are set up to change their template).

    Templates: This table contains all the data that defines each template’s name, site, file, and status.

    Users: This table contains all the data that defines each user’s name, password, and what site it is registered on.

    Here is the actual SQL dump of the site engine’s database. If you would like to, can load this into a query and set up your database instantly. For more reference on MySQL tables, definitions, and query syntax please visit www.mysql.com.

    # Table: 'block_location'
    #
    CREATE TABLE `block_location` (

      `bl_ID` int(11) NOT NULL auto_increment,

      `block_ID` int(11) default '0',

      `block_row` int(11) default '0',

      `block_col` int(11) default '0',

      `block_page` varchar(255) default 'all',

      `site_ID` int(11) default '1',

      `user_ID` int(11) default '0',

      PRIMARY KEY  (`bl_ID`),

      UNIQUE KEY `bl_ID` (`bl_ID`),

      KEY `bl_ID_2` (`bl_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'blocks'
    #
    CREATE TABLE `blocks` (

      `block_ID` int(11) NOT NULL auto_increment,

      `block_title` varchar(255) default 'Block Title',

      `block_file` varchar(255) default '0',

      `plugin_ID` int(11) default '0',

      `group_ID` int(11) default '0',

      `site_ID` int(11) default NULL,

      `mod_ID` int(11) default NULL,

      PRIMARY KEY  (`block_ID`),

      UNIQUE KEY `block_ID` (`block_ID`),

      KEY `block_ID_2` (`block_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'group_users'
    #
    CREATE TABLE `group_users` (

      `gu_ID` int(11) NOT NULL auto_increment,

      `group_ID` int(11) default '0',

      `user_ID` int(11) default '0',

      `site_ID` int(11) default '0',

      PRIMARY KEY  (`gu_ID`),

      UNIQUE KEY `gu_ID` (`gu_ID`),

      KEY `gu_ID_2` (`gu_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'groups'
    #
    CREATE TABLE `groups` (

      `group_ID` int(11) NOT NULL auto_increment,

      `group_name` varchar(255) default NULL,

      PRIMARY KEY  (`group_ID`),

      UNIQUE KEY `group_ID` (`group_ID`),

      KEY `group_ID_2` (`group_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'module_status'
    #
    CREATE TABLE `module_status` (

      `ms_ID` int(11) NOT NULL auto_increment,

      `mod_ID` int(11) default '0',

      `mod_status` varchar(255) default 'not_initialized',

      `site_ID` int(11) default '0',

      PRIMARY KEY  (`ms_ID`),

      UNIQUE KEY `ms_ID` (`ms_ID`),

      KEY `ms_ID_2` (`ms_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'modules'
    #
    CREATE TABLE `modules` (

      `mod_ID` int(11) NOT NULL auto_increment,

      `mod_name` varchar(255) default NULL,

      `mod_dir` varchar(255) default NULL,

      `mod_file` varchar(255) default NULL,

      `mod_author` varchar(255) default NULL,

      `mod_version` varchar(255) default '1.0',

      `mod_type` varchar(255) default 'public',

      `plugin_ID` int(11) default NULL,

      PRIMARY KEY  (`mod_ID`),

      UNIQUE KEY `mod_ID` (`mod_ID`),

      KEY `mod_ID_2` (`mod_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'plugin_status'
    #
    CREATE TABLE `plugin_status` (

      `ps_ID` int(11) NOT NULL auto_increment,

      `plugin_ID` int(11) default '0',

      `plugin_status` varchar(255) default 'not_initialized',

      `site_ID` int(11) default '0',

      PRIMARY KEY  (`ps_ID`),

      UNIQUE KEY `ps_ID` (`ps_ID`),

      KEY `ps_ID_2` (`ps_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'plugins'
    #
    CREATE TABLE `plugins` (

      `plugin_ID` int(11) NOT NULL auto_increment,

      `plugin_name` varchar(255) default '0',

      `plugin_dir` varchar(255) default 'plugins',

      `plugin_file` varchar(255) default '0',

      `plugin_author` varchar(255) default '0',

      `plugin_version` varchar(255) default '0',

      `plugin_type` varchar(255) default 'private',

      `plugin_priority` int(11) default '0',

      PRIMARY KEY  (`plugin_ID`),

      UNIQUE KEY `plugin_ID` (`plugin_ID`),

      KEY `plugin_ID_2` (`plugin_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'sites'
    #
    CREATE TABLE `sites` (

      `site_ID` int(11) NOT NULL auto_increment,

      `site_name` varchar(255) NOT NULL default '0',

      `site_host` varchar(255) default '0',

      PRIMARY KEY  (`site_ID`),

      UNIQUE KEY `site_ID` (`site_ID`),

      KEY `site_ID_2` (`site_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'template_users'
    #
    CREATE TABLE `template_users` (

      `tu_ID` int(11) NOT NULL auto_increment,

      `user_ID` int(11) default '0',

      `t_ID` int(11) default '0',

      `site_ID` int(11) default '0',

      PRIMARY KEY  (`tu_ID`),

      UNIQUE KEY `tu_ID` (`tu_ID`),

      KEY `tu_ID_2` (`tu_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'templates'
    #
    CREATE TABLE `templates` (

      `t_ID` int(11) NOT NULL auto_increment,

      `t_name` varchar(255) default NULL,

      `t_file` varchar(255) default NULL,

      `t_status` varchar(255) default '0',

      `site_ID` int(11) default NULL,

      PRIMARY KEY  (`t_ID`),

      UNIQUE KEY `t_ID` (`t_ID`),

      KEY `t_ID_2` (`t_ID`)

    ) TYPE=MyISAM;

     

    # Table: 'users'
    #
    CREATE TABLE `users` (

      `user_ID` int(11) NOT NULL auto_increment,

      `user_name` varchar(255) default NULL,

      `user_pass` varchar(255) default NULL,

      `site_ID` int(11) default '1',

      PRIMARY KEY  (`user_ID`),

      UNIQUE KEY `user_ID` (`user_ID`,`user_name`),

      KEY `user_ID_2` (`user_ID`)

    ) TYPE=MyISAM;

    More PHP Articles
    More By James Murray


     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT