PHP
  Home arrow PHP arrow Page 2 - Building a Site Engine Using PHP, Part 3
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT