Using Rodin?

May 22nd, 2005

The Set Up
You’ve just written a terrible blog post. It’s so bad that you don’t ever want the public to see it. You consider whether or not you should simply stop writing for fear of another creation like this word-ladden monstrosity, a verbal Frankenstein’s monster–only not as smart. You even eye the knives with a notion to chop off your–no, too extreme. It’s really bad, though. Your mother would blush and your best friend would be embarrassed to say she knows the author. It’s trash, really, and you want it gone forever, with not so much as a hint of it around. But you’re not using WordPress; you’re using Rodin, a small but functional CMS that worked perfectly for your little side project. So now what?

The History
While dealing with another blog I’m writing, I’ve decided to work with Rodin, a blogging system not entirely unlike a stripped-down version of WordPress. Rodin allows me to figure things out and I like to know what I’m doing. Because of Rodin, I can’t write any cool WordPress plug-ins, but I understand how most of them work. It’s pretty geeky to code the stuff yourself when WordPress will do it for you, huh? I know, but what can I say? By creating the code myself, my Rodin blog is more powerful that originally downloaded and my comfort level with PHP and SQL soars. It’s also given me ideas of how to alter WordPress (another other software) code.

The Problem
Because of the way Rodin is written, deleted posts cause troubles; the only option the software gives you is to simply delete all the post content, leaving you a blank page visible to the public. The page doesn’t go away, it just doesn’t have the content anymore. Clearly, this option sucks. That horrible post needs to just die and go away entirely.

The Solution: Part 1
By logging into phpMyAdmin, you can delete the entry in the appropriate table. Simply enough, it’s just a matter of clicking on the “delete” option for that row. Or, if phpMyAdmin is not an option, the SQL is as follows:

DELETE FROM tablename WHERE ID='idnumber' LIMIT 1

Just change “tablename” and “idnumber” as appropriate and you’re all set. You’ll need to know the ID number of the post you want to get rid of, but that’s not difficult to do. Just look at the URL (let’s not get into the difference between URL and URI, please), which ends with the ID number.

The Stolen Number
Now you’ve done completely away with that nasty, horrible example of a blog post. It’s gone, not even a scrape of it left behind the scenes! With one exception: the ID number that bad post took. Ah! That number will chase you down in your dreams unless you are able to place a decent post in its place! Relax; a good night’s sleep is on the way.

Rodin is written so that entries take on an ID that is set to auto-increment. When a row is deleted, that auto-incremented number doesn’t drop down to the old number. So, that horrible post you have has kept the ID number; the next post will just skip over the number. Are you OK with that? Are you sure?

You’ll be looking through all of your posts one day, smiling at some and frowning at others, moving from ID number to ID number to navigate through, when suddenly you say, “Whoa! Where’s #15–? Oh yeah, that was the worst writing I’d ever done. I’m so ashamed.” The disappointment of that day will all come back and a black cloud will follow you for the rest of the week. Who wants that kind of thing hanging over their head? The missing auto-increment number will be a painful reminder of your bad post. We can fix that.

The Solution: Part 2
It may be a small thing, but I like to keep things organized and I hate to see an entry out of sequence. Plus, if I write something awful, I don’t like to be reminded of it. I’ve written lost of awful things, so I keep on having to hunt down the code to change that auto-increment number. Here it is:

ALTER TABLE tablename AUTO_INCREMENT=number

Once again, change “tablename” and “number” as appropriate and you’re all set. If you ever need to change the autoindex in your WordPress database, that same code works just fine.

This all assumes that you are dealing with deleting the last post you wrote. If it’s a post you wrote a few weeks ago, that’s just a matter of altering each row to change the ID numbers in order to fill in the blank created by the deleted row. But really, that’s far too technical a task, rather tedious, and your own damned fault for not critically evaluating your work the day it’s published. Actually, it’s none of those things (except the last one). It’s just not something I’ll worry about here because I wrote this for myself, so I’ll remember how I did a few things to Rodin. If it helps you, terrific. If it leaves you confused, post a comment, bub.

2 comments on “Using Rodin?”

  1. oscar estrada Says:

    excellent article, you wrote exactly what I was looking for. thank you very much!

  2. oscar estrada Says:

    Hi, I wrote you before on this same post,giving you thanks. Then you told me that you changed your cms because of the comment spam. Well I just had that problem too (3,300 spam comments). So what I did is to make a fake picture displaying a “code” and if the people got it right, the commment was uploaded. Its real simple to implement, just like 4 lines of code. :)

Have your say...

Comment Preview: