PHP
  Home arrow PHP arrow Page 4 - Building a Site Engine with PHP, Part 5
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? 
Google.com  
PHP

Building a Site Engine with PHP, Part 5
By: James Murray
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 32
    2004-07-19


    Table of Contents:
  • Building a Site Engine with PHP, Part 5
  • Plug it in, Plug it in!
  • All your Modules Belong to MySQL
  • Improve your Blocking Skills
  • Build your very own Theme Park!

  • 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 with PHP, Part 5 - Improve your Blocking Skills
    ( Page 4 of 5 )

    Installing the blocks is where that paper that you should have been writing the plug-in and module ID’s down will come in handy. If you didn’t make a list of them, now would be a good time to do so. The blocks and block_location tables are where you’ll spend most of the time installing components because most blocks will share the same plug-in and module. In fact I have one plug-in that runs 27 blocks in my set up.

    Blocks Table -- Five Fields

    The blocks table is where you need to start. This table contains five fields that you need to fill in.

    The first is block_title, which contains the title of the block. The block_title can be whatever you want it to be; this is where you’ll put the title that will show up on the top of your blocks (each one is different). You can even put tags in here that will get replaced at runtime.

    Then you need to fill in the block_file field, which works just like the module_file field. Just put in the name of the actual PHP file that contains your block data.

    Then you have the group_ID field which corresponds with the group_ID in groups table. This enables the engine know if it should load a block depending on who’s logged in.

    Following that is the plugin_ID and the mod_ID, which you should fill in with the ID of the plug-in and module that the block is dependant on. This step is really important, because if a plug-in or module fails to load, the block will not load, therefore you won’t get any errors due to the missing information provided by the plug-in or module.

    Block_location Table -- Four Fields

    Now in the block_location table there are four fields to fill in. The block_ID contains the ID for the block in the blocks table that is generated by an auto increment field when you install a new block. The block_col tells the engine what column the block loads in. You simply put the number of the column you want it to load in; for example if you want a block to load in column2, you just put in a 2. After that is block_row which is the number in line that the block loads from top down. If a block is the top block you just put in a 1, if it’s the last in a column with 5 blocks, you’d put in a 5. And finally the blocks page. This field is rather important; it tells the engine what page to load specific block to load on. If you have a block that should show up when a person looks at the page with the URL that looks like this www.yoursite.com/?page=news_details, then you’d want your news details block to load on the news details page and not on the news summary page. For this field just put in the word that would be shown after the page= in the URL.

    Not too complicated but it can get confusing after you get in the area of fifty blocks.



     
     
    >>> More PHP Articles          >>> More By James Murray
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - 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





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek