Raam Dev’s Weblog

Avatar

It’s rather easy to overcome the urge to keep junk. However it’s very difficult to determine what things you genuinely have a need for, before actually accumulating them.

Replaced Akismet plugin with Challenge 1.1

I’m sick of scanning through the list of comments caught by Akismet to see if there are any false-positives — I have had a few false-positives, namely from DJT.

So I’ve deactivated Akismet and installed Challenge 1.1. It works by asking the commenter a question. If the correct answer is provided, the comment is posted. I can customize Challenge to ask any question, however I’m currently using a simple, random math problem. Hopefully this plugin will save me from scanning through hundreds of spam comment posts.

One thing I would like to fix, though I don’t think it will be an easy fix, is to save the contents of the users comment in case he enters the wrong answer. Right now, if you enter the wrong answer and click Post, it gives you a message saying you entered the wrong answer. However, when you press the Back button in your browser, you have to retype your comment. So get the answer right the first time!

Go ahead and leave a comment to try out the new system.

EDIT: After deactivating Akismet, I started getting a lot of TrackBack spam. Since Akismet doesn’t have any option to only filter TrackBack’s, I’ve decided to disable link notifications altogether.

SimplrRaam - Modified Simplr Theme

As you can see, I am now using a modified version of the Wordpress Simplr theme by Scott. It took me a good 4 1/2 hours to modify and to make sure everything was working the way I wanted it to.

Changes:

  • The sidebar has been moved from the bottom to the right.
  • Single post pages are shown without any sidebar to make room for actual post content when you’re reading the post.
  • Each of the pages (About, Contact, Archives, etc) also do not show the sidebar.
  • From the main page, when you click one of the categories from the sidebar to browse the posts in that category, you will be provided with a sidebar to further navigate via categories while you’re reading posts.
  • The theme is designed to stretch with the browser window, so it should work on many different resolutions (even 640×480, though that wouldn’t be very usable)
  • Moved the title of the blog into the top left corner, on the same line as the page links
  • Moved the tagline (my quote) to the right corner, under the page links

Important Installation Notes:

  • You can no longer use the Simplr Layout Width or Sidebar Layout options.
  • You MUST change Layout Width to 95% once you have activated the theme.
  • I recommend you set the Base Font Size to 75%
  • If you change the Base Font Size option to something greater than 75%, you may need to increase the following in style.css: div.postcontainer { margin-right: 330px; }
  • The rest of the Simplr options should work.

Screenshot:

Download: simplrraam.zip (379kb)

Keep in mind that I did this in a hurry, so many of my changes to the theme files are not documented. I also plugged in extra CSS styles where I needed to get things working. Please feel free to post comments, fixes, or suggestions to this theme below.

New Theme Installed

As you may have noticed, I installed a new theme for my blog. What do you think about it? Scott over at plaintxt.org has a bunch of really nice minimalistic themes for WordPress, one of which I am now using (Simplr). I made a couple of slight modifications to the theme, such as adjusting the number of recent posts and comments that are displayed.

By default, this theme lists all the pages across the top, including any sub-pages, so I simply hid the Before I Die, Style Changer (only applies to my previous theme), and the To Do List pages. I have not decided how to make use of the pages feature in WordPress. I have been creating posts for virtually everything, including very long posts, paginated into several pages such as the Basement Project. The main reason I have been avoiding using pages is because there is no easy way to organize them. With posts, I can simply assign multiple categories to them. This isn’t possible with pages.

The other little modification I made was to the CSS file for Simplr. I really liked having the hierarchical list of categories, where sub-categories were indented below their parents. The Simplr theme did not come with support for this, even if the option was enabled using wp_list_cats, as I mentioned doing in this post. Using CSS, there are two methods of making this happen. You can either use text-indent: 25px or you can use margin-left: 25px.

I would prefer to use text-indent so that the background of each category stays the same width throughout the list. However, using text-indent means if you have any categories that are more than 2 levels deep (for example, General->Writing->Health) the text indent will stop after the first sub category; all sub-sub-categories will look as if they are just sub categories of the parent. The only way around this (that I know of) is to use margin-left. This keeps the list looking nice, however it changes the size of the background of each sub category as well, which doesn’t look too pretty. I finally decided that if I only use a 10px indent, the resizing of the background’s doesn’t look quite as bad. Here’s what I finally used:

div.sidebar ul.children li {
    margin-left: 10px;
}

Let me know what you think of this theme. By default only the newest post is shown on the front page. This can be changed, however if the list of posts is very long the categories list would appear way at the bottom, requiring you to scroll all the way down to view the categories, links, recent posts, and recent comments.

I also installed WP-Cache. It’s supposed to speed up the browsing of my blog by caching static copies of each page once it has been viewed and serving the cached version to new visitors instead of querying the database. Let me know if you notice any speed increases.

Lastly, I installed Search Pages, a WordPress plugin that enables searching not only the titles of posts, but also the post content. This is very useful if you’re looking for a previous post you read and only remember something from within the post and not the post title. I think this should be the default for searches in WordPress, but I guess it’s not.

Coding a style changer for WordPress 2.0

I’m sure there are plugin’s that take care of this function, however I decided to hardcode this right into my WordPress theme. Why? Because I don’t plan to use any other themes. All style changes I make will be done through changing the CSS style sheet. I coded this so that I could work on a new style sheet offline, and when I’m finished, upload the file to my styles directory. It will then automatically show up in the drop down box on the Style Changer page.

So here is what I did. First I created a new WordPress page and called it Style Changer. On this page I put the following PHP code: [Read more]

Modifying the WordPress (more…) link

I found the more feature of WordPress to be very useful, however I wanted to change the link that was displayed. The default is “(more…)”, and I wanted it to say something more useful, such as “Continued…”. After doing some Googling and finding nothing, I dug through all the PHP files included with WordPress. Finally I found the following in template-functions-post.php, located in the /wp-includes/ directory: [Read more]

Blogging from a Text Only Web Browser (Lynx)

I’m laying in bed using my IBM Thinkpad 600e laptop running Debian Linux, connected to the internet using a WiFi connection, logged into my WordPress dashboard using a text-only web browser (Lynx). Lynx allows me to open my favorite console text editor, which happens to be vi, and once I’m done typing my post, I just quit vi, and it returns me to Lynx with my whole post entered in the form. Blogging couldn’t get any more geeky than this!

The fact that the WordPress administration pages are even usable via a text-only browser is awesome. I also setup a plugin for WordPress that allows me to submit posts via email. I setup a secret email account which I send an email to containing the title of the post in the subject and the content of the post in the message body. I have a cron job setup to run a script every 5 minutes that checks the secret email account for any emails. Once it finds one in the mailbox, it adds a post to my site containing the contents of the email! This allows me to submit posts right from my Blackberry, no matter where I am. I could even attach pictures, if my Blackberry had a digital camera.

Giving In

I have always been against using someone else’s code for my personal site. I told myself it made more sense to design everything from scratch, programming and all, so that I’d be able to easily add new features while having a clear understanding of how everything works. I thought it made more sense to do all the programming myself because I would gain valuable programming experience in the process. Well, gaining experience to create this site from scratch also means I end up rewriting previous programming code to implement new features. This puts me in an endless loop of redoing the site over and over. I have come across dozens of different free blogging applications in the past, but they were either too bloated or didn’t contain the flexibility I was looking for.

Well today I found what I’ve been looking for. It’s called WordPress. It uses the exact two things I was planning to use for my blogging software: PHP and MySQL. What makes WordPress perfect for my site is that the features are setup almost exactly the way I planned for my site. This makes programming new features in building onto the site a breeze. All of the software is Open Source, so it’s licensed under the GPL. This means that I can freely add, delete, and modify to my heart’s content, any part of this software.

OK, enough justification. I just wanted to announce that I’ve finally given in to using blogging software that has been prewritten. I will still be working on new features to add to the site, as well as designing new themes to keep things looking fresh. Most importantly, you can look forward to a lot of new content and more frequent blog posts. Please feel free to post comments using the commenting feature.