Simple Machines Blogs > Developers' Blog
How this blog was created
Thantos:
I figured I'd kick off the Developer's blog by explaining how I actually created it.
Now I'm well aware that there is a ton of blogging software out there. But if we look at the essence of a blog you'll find that it is basically a post with a bunch of comments following it. Put them together and you get a blog. This strangely enough is similar to a topic with the first post being the article and all following posts being comments, and they are all stored in a board.
Following that logic I created a category to store all the blogs in and made each blog a board in that category. That provided all the grouping I needed, I was now ready to begin creating the actual software. It turns out that I really only needed four files to make this work. The first one is a PHP file that does all the heavy lifting, the second is a CSS file that makes things pretty, and the third one is simply a graphics file for use with the RSS feeds. Now the forth file is a htaccess file that isn't really needed but it provides a nice effect for us. It allows me to use a url like http://blogs.simplemachines.org/dev/all. What’s the big deal you ask? Well first off there is no directory called dev under the blogs directory. Without the htaccess file I would have to do something like http://blogs.simplemachines.org/index.php/dev/all which isn't nearly as pretty is it?
Now after I set up how I wanted things to look I was ready to code.
The first thing I needed to do was to declare what blogs I had. This was done as a simple array
--- Code: ---$blogs = array(
'team' => 128,
'dev' => 129,
);
--- End code ---
The next step I took was to parse the request URI and see what they user was asking for (if anything at all). This was done by using a regular expression that broke up the various parts into it's component pieces.
From there it was just a matter of loading the correct content. If they didn't ask for anything it will show them the main page, after loading the required information. If they asked for a particular blog then it'll show them the most recent entry for that blog. If they asked for a particular entry then it shows them that one. Its all a matter of querying the right tables out of the SMF database.
Now to create an actual entry all I have to do is create a topic in the blog's board and it shows up automatically. I mean how cool is that?
Now I would like to end this by saying that this entire blog is powered by the SMF software and uses nothing other then what you get using SSI.
So remember, SMF is more then just a forum software, its a pretty kick butt framework.
Daniel15:
--- Quote ---Now the forth file is a htaccess file that isn't really needed but it provides a nice effect for us. It allows me to use a url like http://blogs.simplemachines.org/dev/all. What’s the big deal you ask? Well first off there is no directory called dev under the blogs directory. Without the htaccess file I would have to do something like http://blogs.simplemachines.org/index.php/dev/all which isn't nearly as pretty is it?
--- End quote ---
You should reword that slightly, to something like:
--- Quote ---Now the forth file is a htaccess file that isn't really needed but it provides a nice effect for us. Using an Apache module called 'mod_rewrite', I am able to use URL's like http://blogs.simplemachines.org/dev/all. What’s the big deal you ask? Well first off there is no directory called dev under the blogs directory. Without the htaccess file I would have to do something like http://blogs.simplemachines.org/index.php/dev/all which isn't nearly as pretty is it?
--- End quote ---
Anyways, it's nice to see what you can come up with using SMF as a framework. Indeed, it's more versatile than any other forum system I've used :)
Neol:
May we have the files you used to create this?
Gary:
It's called SSI.php :P
-AwwLilMaggie
Webby:
I get an error when I want to see the comments on the blogs, example :
http://blogs.simplemachines.org/dev/131110/comments.html
Navigation
[0] Message Index
[#] Next page
Go to full version