PHP
  Home arrow PHP arrow Page 4 - Building a Site Engine with 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 with PHP, Part 4
By: James Murray
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 24
    2004-07-12

    Table of Contents:
  • Building a Site Engine with PHP, Part 4
  • You’ve been Tagged
  • Give it a Little Class:
  • The Final Words

  • 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 with PHP, Part 4 - The Final Words


    (Page 4 of 4 )

    It’s not hard to create your own tags; all you have to do is send them to the array of tags. Here’s a small example, if you wanted tags that will show the date and time -- all you’d have to do is put in the following code, after you’ve declared the template class.

    $template->tags['date']=date("l F, j Y");

    $template->tags['time']=date("g:i:sa");

    Then anywhere you have the tag that looks like <!date>, it will show the date like this: Thursday June, 10 2004, and the <!time> tag will show the time like this: 2:17:04pm. On top of that a tag can show anything -- a tag can be an include, a string, even an image. For example, if you do this $template->tags['test']="foo"; the tag <!test> will show the word “Foo”. It’s pretty cool if you ask me.

    To add columns to your layout, all you have to do is add them to the template file named column4, column5 and so on.

    Well that’s about it for this article. In the fifth and final article I’ll show you what you need to do to add plug-ins , modules, and blocks to the engine.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Suddenly the code is no longer indented. Is there a whitespace issue with PHP5 that...
       · I agree, this part 4 was really a disappointment.Hope the finale is a...
       · I must agree with the above commments.Since part 3 the quality of the articles has...
       · I hope things gets easier to understand when I've read the full article.As posted...
       · in article 3: where do I have to put the blocks and authentification plug-ins?in...
       · IN article 3:You have code for two different plugins, "auth" and "blocks".Now...
       · what about the replace() function? where do i have to put it? ... and that...
       · the load_template() function tells you exactly where your xml file...
       · I plan on rewriting this article due to the fact that it's a new writing style...
       · >AND yes, if you read all the articles with attention, you'd know what to do with...
       · First off, I don't consider myself an extremely knowledgeable user of PHP. That...
       · "What are the file names of the Templates and XML plug-ins?""... and XML class...
       · It's like trying to plug an episode of Jerry Springerinto Oprah show, they might...
       · Has anyone tried this yet? I know some are dissapointed, but I think that it's...
       · Ok, well Im treating this article as a guide to how to do it. I dont run PHP5 so I...
       · I agree that a download of the sample code would be FANTASTIC. I think that would...
       · Yeah thats pretty much it really, not the hardest thing I'll have done this month...
       · this IS a guide on how to do it, this isn't a "heres the source code for a finished...
       · I would like to thank you for writing these articles, the quality is going down a...
       · I'll say that- it got me thinking. Overall this has been a big eye-opener to me, as...
       · That is great that you the system up and running. Would it be possible for you to...
       · why would the sql function (inside sql.inc.php) not have any arrguments. I couldn't...
       · To get the sql function to work declare $config global in the function sql()...
       · This is my current core.inc.php, shows the changes made to support the sql inc...
       · So maybe you can add source to download ? with all files and mysql dump?
       · Thanks a bunch Simon. That seems to clear it all up. It’s nice to see some progress...
       · Well I made some progress on the parser today, it seems to do what the simpleXML...
       · simon ...wow... only 3 weeks... could you share with us what tutorials/books you've...
       · I'd really like to see a completed source package also.
       · as would I!
       · Well I dont have any PHP books, the online suport at php.net is very good as it is,...
       · a complete working package would be very helpful to understand how it works
       · The author made a comment saying he didn't want this to be a "heres a site download...
       · you read my mind :)
       · I'm studying this articles for a couple of hours and i have a question. You...
       · Any thoughts on the above comment?
       · I don't think that these articles should be always targeted toward beginners. If you...
       · Exactly, this is a guide, a tutorial. If you just want to download a working CMS,...
       · you can make them yourself in your core.inc.phpthis is my...
       · you can write small modules which creates an instance of the pluginLets look at...
       · Hi Simon,Ive been having some problems getting your PHP4 simple xml parser...
     

       

    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