Administration
  Home arrow Administration arrow Page 2 - Building a Barebones Content Managemen...
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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? 
ADMINISTRATION

Building a Barebones Content Management System: The Yaapi API
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2005-09-21

    Table of Contents:
  • Building a Barebones Content Management System: The Yaapi API
  • Under The Hood
  • yaapi -- Getting Started
  • yaapi -- Listing Articles
  • yaapi -- Display An Article
  • yaapi - Display List Of Categories

  • 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

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Building a Barebones Content Management System: The Yaapi API - Under The Hood
    (Page 2 of 6 )

    As I may or may not have already mentioned, yaapi is an object-oriented API. It consists of a utility article() class that is equipped with a bunch of useful properties and utility methods -- you’ve already seen its constructor in action in the first part -- that strikes the right balance. While it is not so complicated that it intimidates a novice PHP programmer, it does provide enough functionality that it will not disappoint the experts.

    Consider this: the article() class has a get_recent() method, which returns the last five items added to the database. I can conveniently invoke this method to render a "What’s New" section on my website without the need to resort to any custom programming.

    The bottom line: the object-oriented approach of yaapi allows me to update the business logic encapsulated within its API methods. For example, if I want to update the aforementioned get_recent() method to return ten items instead of five, the default value, all I need to do is tweak the core PHP script containing the definition of the articles() class, and the front-end display is updated seamlessly.

    Coming back to the introductory section (of this article): I spoke about "articles" and "categories", the two entities at the core of the yaapi application. Let me provide some insight about them and why they play such a critical role as far as my barebones CMS is concerned.

    An "article", as the name suggests, is the most basic unit in yaapi (and most CMS software packages). Each article in yaapi is associated with a bunch of attributes; these include among other things the "title", "author" (or "authoress") and his/her "email address", the "category" (more about this in a minute) and finally, we have the "content" that represents an article. I can also turn off the display of an article without having to delete it from the database, courtesy of an "approved" attribute.

    Next, I demystify the concept of a "category." In a yaapi context, this concept allows me to group "articles" logically. Let’s consider the example of the website on which you are reading this article -- DevShed. You’ll notice that the content has been organized on the basis of different technologies. So, you have categories such as "PHP" for PHP-related articles, "Perl" for Perl-related articles, "Apache" for … you get the picture!

    Yawning already, are you? Well, things begin to get interesting from here on as I demonstrate how different methods of the yaapi article() class can be used in PHP scripts. I promise.

    More Administration Articles
    More By Harish Kamath


       · I too had gone through the first two stages of your thought process (writing your...
     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway