Entries from May 2005 ↓

Another Minor Plugin

Well, I developed another plugin, this one being very minor, as it just utilizes a built in functionality. Simply, I wanted a quick way to enable or disable the showing of the calendar in my WordPress theme, so I created a plugin to do this.

Like my Recent Posts plugin, it requires a hook to be added to sidebar.php. My hook is like so:

<?php do_action('cp_sidebar_showcalendar', ''); ?>

Next you will need to download the ShowCalendar.php plugin which is accessible via my Stripper program. Enjoy!

First WordPress Plugin!

Okay, I have been fascinated with WordPress ever since I started to use it and I must admit, it has turned out nicely. Considering my fascination, I just had to write a plugin. Since I am showing a single post per page, I decided a ‘Recent Posts’ would be an acceptable plugin.

To get the ball rolling, I quickly learned that there is no ‘hook’ for the sidebar.php template. So I added the code:

<?php do_action('cp_sidebar_recentposts', ''); ?>

Now to get this to work properly, you will want to add it above the closing </ul> symbol. This way, when the recent posts section gets added, it is thrown in the navigation menu just like the others.

Next you need to ‘Save’ this file to your wp-content/plugins directory. Click on the ‘Save As…’ link to download the file. Finally, upload the file and your modified sidebar.php file and then activate the plugin via your Site Admin> Plugins section. Enjoy!

Media Center Improvements!

Well, I am now working hard at making my Media Center do a whole lot more. Due to my laziness, I made my media center controllable via SSH by running key commands through bash scripts I wrote. To fed you with an example, here is the bash script that starts one of my DVDs:

#!/bin/bash
export DISPLAY=:0.0
shopt -s expand_aliases
sudo mount -t iso9660 -o loop,blocksize=512 "$1/Disk 01.iso" /media/isoimage
kaffeine -f -p -d /media/isoimage DVD
exit 0

I also have one that stops the DVD and unloads it from the mount as well. To increase my laziness, I am using the ALSA sound drivers so I can run alsamixer from the command line to increase or decrease the volume to my listening pleasure. All that is missing is finding easy ways to pause and play again the DVD and tell it to make a menu selection. When I get my wireless keyboard and mouse, this will all become unnecessary, but it was a fun challenge to try and I am glad it is working out.

I now have all of my movie DVDs on my media center and am working on putting Monk Season 1 and 2 on it as I write this. Also on my agenda is setting up my media center to accept web input so a passing visitor can control what movie is playing and possibly see a streaming video of it on the website. That is my goal, but I do not know how close it is at this moment.