Popular Articles
List of Useful jQuery Plugins
jQuery Makes Parsing XML Easy
Installing Subversion on Apache
SVN Authentication and Auto Update
jQuery Plugin Actions vs Utilities
Create a Blog from Scratch
Interviewed by Google
Tags
Create a Blog from Scratch
PHP, Development
Without much prior PHP knowledge, I managed to program this blog in less than a week. Here is how I did it. Note: This is an overview and not actual code examples.
First, I went through Code Grrl's Build a Blog Tutorials
Sure, I could have stopped there but I really didn't like how the blog was programmed. I like this tutorial though because I dug through the code and learned basic PHP, but I wanted much more functionality.
I wanted clean URLs so I found Making "clean" URLs with Apache
I customized the url so I can add keywords inside it if I want. I love these clean URLs. Apache also has documentation on mod_rewrite.
Then I added user authentication
This was the most basic, yet effective login script I found. Of course I modded it to make it a little more secure.
I rewrote the code to use Object Oriented PHP
My blog was basically built but I didn't like how the code looked. I thought PHP looked horrible until I ran into some object oriented code. Makes things look much nicer.
Created Tag Cloud Navigation
I started with ByteMyCode's Tag Cloud code and then moved to selecting from the database with the "LIKE" MySQL commmand.
$sql = "SELECT * FROM php_blog WHERE tags LIKE '%$tag%' ORDER BY timestamp DESC";I also had to count the tags so I used the array_count_values PHP function.
$tags = array_count_values($DBtags); // a very useful function to count the tags!Wow gotta love those tags!
Added More Features
I added an image uploader to my admin page, RSS 2.0 and many minor tweaks until I had my very own customized blog built from scratch!
Some functions I found very useful on php.net:
list()
split()
htmlspecialchars()
str_replace()
explode()
include(dirname(__FILE__)
Without knowing much PHP I now have my own custom blog! You can too! I heavily modified each example and made them my own. It feels so nice to have a custom blog!
#1. leo on Mar 23 2008
mind to give out your source code?
#2. radman on Apr 07 2008
Thank you Marc,
This article really helping for me.
I think we don't need to know the source code, to build our own blog.
With this instruction, we can do it without have to know the source code.