Program, sleep, program, repeat

It’s been a while since I’ve had a big software challenge as most of my time of energy have been focused on BOB. Because of this, I’ve decided to make a CMS using Perl.

Thats right, the first useful thing I’m programming in Perl is yet another blogging and content management system. I decided to use Perl because it’s become the second best thing in the world, pulling in right behind Python, and because Irecently got this new web server (thanks to the parents and birthdays), I have a public place to show off my Perl. Also, Perl’s ease of use with MySQL databases, and it’s ability to handle text in a neat fashion makes it a good choice for this.

The first hint that this might happen was a few posts back, in my Perl and MySQL database. I wrote that how to as a simple launching pad for others, but ended up using it for myself. Now it’s grown into a full time project. I introduce to you… minPost. A “minimal*” and simple to use CMS. * – Minimal meaning it doesn’t have all the bells and whistles that something like WordPress has. Minimal also in this case refers to the interface, where there isn’t a full fledged administration center, instead it is dispersed throughout the pages.

Heres what I have done so far:

I’ve gotten an index page that displays all the posts, and offers a login area for the admin; if the admin is logged in, the header image text changes a little, and the index page has a quick post function that the admin can use to quickly add a new post. I also have an admin panel somewhat built; it allows for a quick concise viewing, editing and deletion of posts, along with a new post function. The pages have individual pages (one page that grabs the post from the database), with individual comments for each post. The title, and links for the navigation bar are grabbed from the MySQL database also.

CGI::Session takes care of the cookies to make sure the admin stays logged in through their time on the site, and to make sure unwanted admins unable to copy the cookies. the username, password(encrypted in md5) and the session id are stored in the cookie, and change every time. The only problem is that the password and username are transmitted through the url at the moment.

The themeing is a little different because I haven’t put too much time into this feature. The header image that is used is in the Resources/Header file, named header1.jpg. the title.css file holds the css code for the header image, and the text that is displayed over it. bubble.png is the picture file for the background for the overlaid text. I’ll have better documentation on themeing (and hopefully a system worked out) soon. In the mean time, please take a look at, and along with the Resources/Style.css and Resources/Header/title.css.

There is a scripted called included in the source but this file hasn’t been tested. Basically you must edit your file’s username, and password, then navigagte to the will then use your username and password (and host, port, etc) to log into your MySQL server and create the database, and tables that are needed. I haven’t tested this script yet so I do not know if it works, if anyone tries it please post your results and possible work around’s in the comments.

The admin center’s new post option uses the TinyMCE editior, but for some reason whether it’s Perl, MySQL or TinyMCE, tags are not formated as < and > but instead the in the &gt fashion. This happens even if you use the html option. For this reason, all formating buttons are removed from the TinyMCE menu bar for the time being.

What I still should add for my own sake:

  • A picture gallery script
  • Better themeing engine
  • Security (there is non besides the session id (if that even counts)

The source is in my github repos and a working demo can be seen on my robots site.

Please note, the code is released under the Creative Commons Non-Commercial License and Copywrited Joshua Ashby, 2009.