A Lightweight PHP / MySQL Content Management For Developers: sNews

There are situations when a PHP developer looks for a lightweight platform with built in content management system capabilities. Having only 230 KB, sNews content management system is a suitable alternative for small or medium websites. This application is built with PHP and stores data in a MySQL database.

The default functionality allows you to rapidly create blogs or news websites. It also allows the implementation of supplementary functions through modules or add-ons.

As compared with other content management system platforms, sNews is not bundled with unnecessary or complex functions. Its main structure contains only four files: index.php, snews.php, style.css and the .htaccess file.

The index.php file integrates the HTML directives that define the website template (layout). The content appearance is styled through the code existing in the style.css file ( the default layout can be easily customized by altering the CSS code without affecting the content). The default .htaccess file will only determine the creation of search engine friendly URLs, if the Apache web server has mod_rewrite enabled.

The snews.php file is included into the index.php via PHP include ( ) function. It controls the dynamic behavior of the content management system elements through the execution of custom corresponding functions.

As a consequence, inside the index.php file, the dynamic properties of response of a HTML element are defined based on simple tags that calls a predefined function from snews.php.

For example, if we are referring to the default index file, the next code adds to a div element a search form. When the user performs a search query, the corresponding PHP code will be executed and the search results will be displayed:

<div id=”search”>

<?php searchform(); ?>

</div>

The templates design can be made from the ground or by introducing the predefined PHP functions from snews.php file into a ready made template. There is also provided a set of over thirty free XHTML / CSS templates suitable to be adapted for a sNews powered website. Also, a considerable number of ready made templates are available on the sNews forum.

The installation of sNews content management system takes only a few minutes: the .sql file existing into the SQL directory contained in the sNews distribution archive must be imported into a MySQL database using command line directives or a database management utility, like phpMyAdmin.

Then, the snews.php file must be updated with the information corresponding to the MySQL database connection parameters such as: MySQL server address, database name, user name and password.

By having a clean and easy to customize code and a lightweight structure, sNews could be used as standalone content management system or as a reference point for the rapid transformation of a static website into a dynamic one with HTML content served from a database on the server side.

sNews code is very well commented, such as the beginners in PHP programming will be able to experience a better understanding of the optimal MySQL data manipulation techniques through specific directives.

http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/digg_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/reddit_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/dzone_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/delicious_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/blinklist_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/furl_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/technorati_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/magnolia_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/google_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/facebook_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/mixx_48.png http://www.downloadtube.com/blog/wp-content/plugins/sociofluid/images/twitter_48.png
Tags:

Related Articles

Leave a Reply