Sunday, July 18, 2010

PHP/MySQL based Content Management System (CMS)

I have just finished the development of a PHP/MySQL based Content Management System (CMS). Below is a low-resolution screen-shot of the system.

Details about this system can be viewed on my website at http://www.vibhumishra.com/index.php?projects&cms_1

There are two versions of this system, one with an ordering component which will let one do business online and the other without this component, some of the other features (common to both versions) include:
  • Display web-based advertisements such as Google AdSense ads.
  • Ability to publish pages straight away, save drafts and archive pages.
  • Flash and other multimedia integrated.
  • Tracking individual page hits, user browsing trends and other information.
  • Full-featured password-protected administrator side, including with Secured HTTP (https://) support (server feature).
  • 3-customizable colour themes (customizable by site visitors).
  • Multiple font support (not restricted to standard web fonts).
A screen shot of the CMS, (populated with dummy data):

Friday, July 16, 2010

Enabling PHP on stock Mac OS X 10.6 Snow Leopard

A quick way of enabling the stock installation of PHP on Mac OS X 10.6 "Snow Leopard". You may use either the Terminal or the user interface of the Finder.

1. Go to "/etc/apache2"

2. Use either of the options:

2.a. If using Finder: Give yourself access privileges (read-write access) to file "httpd.conf" and open the file using your favourite text editor

2.b. If using Terminal: Using your favourite text editor (vi, pico etc), using sudo open the "httpd.conf" file.

3. Uncomment (remove the #) in front of line:
LoadModule php5_module libexec/apache2/libphp5.so
4. Add the following lines (preferably at the end of the document so that it is easier to debug later if required):
#IfModule php5_module$
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>
In the above, replace # with an "<" and the $ with an ">"

5. Try by running a test php page.

<?php phpinfo(); ?>

In the above, replace # with an "<" and the $ with an ">"

Tuesday, February 23, 2010

Object Oriented Programming and Polymorphism in PHP

Introduction:

One of the greatest strengths of any programming language is its Object Orientation and from this comes Polymorphism, way back when I was in college, I studied this section of programming with immense interest and while at first, avenues for its implementation were very limited this is growing day by day.

Following are some examples and implementation of these concepts.

Example:

All Object Oriented Programming languages (OOP languages) offer some form of polymorphism. Following is an example of implementation of polymorphism using PHP:


interface vehicle{
function getType();
function getCapacity();
}

abstract class baseVehicle implements vehicle{
protected type = $type;
}

function getType(){
return ($this->type);
}
}

class motorbike extends baseVehicle{
function getCapacity(){
return ("2 people");
}
}

class car extends baseVehicle{
function getCapacity(){
return ("5 people and 400 litres of boot space");
}
}

class truck extends baseVehicle{
function getCapacity(){
return ("3 people and 10 tonnes of cargo space");
}
}

$vehicleArray = array(
new motorbike("Enfiled Bullet Motorcycle"),
new car("Tata Indigo Station-wagon"),
new truck("Leyland Flatbed Truck")
);

foreach ($vehicleArray as $vehicleData) {
echo $vehicleData->getType() . " - " . $vehicleData->getCapacity() . "\n";
}

Output:

Enfiled Bullet Motorcycle - 2 people
Tata Indigo Station-wagon - 5 people and 400 litres of boot space
Leyland Flatbed Truck - 3 people and 10 tonnes of cargo space

If there are any questions or feedback regarding this, please post in the comments box!

Monday, November 23, 2009

Examples of Flash Charts and Graphs soon

I will try to upload some examples and screen-shots of some graphs and charts generated through Flash which gets in the data from databases or XML files.

Check in soon!

Monday, October 12, 2009

Implementation of PHP-Flash-XML - Realtime Graphs!

Hi all,

One great implementation I have of PHP-Flash-XML project is for generating real time graphs. I already have this working for Pie Charts, Bar Graphs and Line Graphs. Now I am working on Line Graphs with 2 or more variables and scatter plots.

For more details about this project, see my website, http://www.vibhumishra.com/index.php?php-flash-xml.

More updates soon...