Monthly Archives: October 2013

SimpleBlog Work Post

Last time, I put together the basic HTML of the simple blog. Today I’m going to work out the interchanges.

When a user first comes to the simpleblog index page, they’ll be presented with a list of the ten most recent entries, a login form, and buttons to display the next ten or previous ten entries chronologically.

So the first thing that has to happen is that the page must ask the controller for the ten most recent blog entries. This means the controller must ask the model for the ten most recent blog entries, to share them with the view, the page.

If the user enters data in the login form and presses the login button, the page must give that data to the controller to compare it with the login data in the MySQL database. I’ll enter that data directly, since it’s a one person blog. So there’ll need to be a model for the login database as well, and functions to access it.

When a user successfully logs into the blog, a persistant field will be created so that the user stays logged in. The sidebar will also be changed to include post and logout buttons via a script, and hide the login form.

When a user is logged in, each post will include edit and delete buttons. Edit will bring up a version of the post page with the data from that post. Delete will bring up a dialog box to confirm, then on confirmation will delete the post.

The post button will bring the user to the post page to allow them to post a new entry.

The Post Page itself will be a simple form with a post button. If the post page is shown in edit mode, it will say confirm edit instead. The post button will create a new post in post mode, or save the changes to a post in edit mode.

In edit mode, the Post page will load a previous post, so there will need to be a function for that in the controller and model, and a function to save over the post.

That should be everything. If I’m missing anything it’ll be discovered along the way.

Now I’m going to bed. It’s been a long day but I’m glad I found time to work on this.

Simple Blog

So I’ve given some thought to the WebMUCK Project and I’ve decided to put it on the back burner. It’s more complicated than I had anticipated, and it’s not going to be done for a while. I need to pump out some good, short projects for my portfolio, so I’m going to do what most of my class did back in school and write a simple blog. Well, I’ll do it a bit fancier than they did. I’m going to use all my HTML5, CSS3, JQuery, AJAX, PHP and MySQL skills. Well, as many of them as I can squeeze in there at least.

Now I’m going to do a rough inventory of what I’ll need to create to do this.

Viewing Page
Post/Edit Page

Just three pages. Lots of scripts though.

The Viewing Page will need to access a PHP Script that will show blog entries. It’ll need to be able to tell which entries it’s showing, so that it can show pages of ten entries at a time. There’ll also be a login box for the blog owner to log in and make and edit posts. That means it’ll also need to keep persistant login data.

The post/edit page will be simple by comparison. All it has to do is send form data to a PHP script that will push the data into the database. In the case of editing, it’ll first load a post, but that shouldn’t be much more complex.

I’ll try to keep to the MVC format, so there’ll be a controller_Blog.php script that the pages make RESTful calls to, and a model_Blog.php script that models the database and permits interaction with it.

I think I’ll start by making the basic HTML of the pages, then plan out the functions and methods for the scripts and how they interact, before implementing them. I find it helps to have something to look at to put everything in perspective.

—–

Alright, the HTML and CSS for the basic index page are done. I’ll have to edit them once I start actually programming, but this gives me something to start with. Next I’ll do up a form for posting/editing entries.

—–

And that’s a nice little post page. I think that’s enough for one update. I’ll share the github repo later.