A-  A  A+ RSS Feed

Deep Thoughts by Robert Felty

thoughts on wordpress, latex, cooking et alia

Archive for 2010

Wednesday, August 4th, 2010

New WordPress plugin – Image Browser

Screenshot of image browser plugin in action

Screenshot of image browser plugin in action

Today I released my 8th wordpress plugin. This one is quite a bit different from all the other plugins I have written. A friend of mine was looking for a way to create a gallery on his family blog. “No problem!”, I told him, “there are lots of plugins for that”. But I then quickly realized that no plugins were available for what he was looking for. All of the other image gallery plugins for wordpress function by creating galleries manually, say a gallery of wedding photos, or a gallery of a trip to the zoo. My friend was looking for an easy way to browse all pictures he has ever posted on his blog. That is what the Image Browser plugin does. It allows you to browse through all of your pictures on your blog, and also allows you to restrict by year, month, category, and by caption text. It is easy to install and use. Simply install it, then create a new page, and insert the [imagebrowser] shortcode. That’s it. Options can be set either in the settings page, or by using shortcode parameters. If you would like a demo, please take a spin at my family blog gallery, or the image browser page on this site.

Tuesday, June 22nd, 2010

New wordpress plugin – Image Meta

Image meta options

Image meta options

I just released my 7th wordpress plugin, Image Meta. This one has to do with image handling. Before wordpress 3.0, when you uploaded an image, the filename of the image was set as the title, and if you had given the image a caption (e.g. with Picasa), then the IPTC caption would be used as the caption for the image. In wordpress 3.0, the default is now to use the caption for the title of the image. I don’t like this, mostly because I had set up my theme’s image handling based on the old way. So I decided to write a little plugin which hooks into the image uploading process, and sets all four image fields at once – the title, alt text, caption, and description. The plugin allows you to select between setting each field to either the filename, the IPTC caption, or leaving it blank. I hope some others find it useful.

Friday, April 9th, 2010

Showing total number of replies in bbpress

showing total number of replies on a bbpress profile page

showing total number of replies on a bbpress profile page

For awhile now I have been wanting to show the total number of topics started and replies in a bbpress forum on the profile page. Today I finally figured out how. I like bbpress quite a bit, as it integrates very nicely into wordpress. The main downside of bbpress right now is that the documentation is still basically nonexistent. Maybe someday I will help out with it.

Anyways, to get the total number of replies, simply use the following little mysql query:

<?php
global $bbdb;
$totalReplies = $bbdb->get_var("SELECT COUNT(post_id) FROM " .
$bbdb->prefix . "posts WHERE poster_id=$user->ID");
?>

To get the total number of topics started, use:

<?php
global $bbdb;
$totalTopics = $bbdb->get_var("SELECT COUNT(topic_id) FROM " .
$bbdb->prefix . "topics WHERE topic_poster=$user->ID");
?>
Thursday, April 1st, 2010

New wordpress plugin – category reminder

Category reminder screenshot

Category reminder screenshot

I recently released my sixth wordpress plugin – category reminder. I have seen several requests around for a plugin which forces users to select a category for each post they publish, so that the posts don’t just end up as uncategorized. Bloggers with multiple authors seem especially interested in this. I have wanted this requirement for myself as well, since I sometimes forget to categorize a post before publishing it. Now users can easily add this functionality via this plugin.

Thursday, March 4th, 2010

Tofu-stuffed eggplant with mushroom ragout

Tofu-stuffed eggplant with mushroom ragout

Tofu-stuffed eggplant with mushroom ragout

Tofu-stuffed eggplant with mushroom ragout in baking dish

Tofu-stuffed eggplant with mushroom ragout in baking dish

Tonight I made a new recipe. Clare had bought some mushrooms the other day, and I bought eggplant yesterday. I thought that an eggplant mushroom ragout sounded good, though I didn’t know exactly what it would entail. I googled it, and found 2 good possibilities. The first possibility, which I did not choose, was more what I would think of as stuffed eggplant. It involved slicing the eggplants in half and filling them. This particular recipe seemed to throw away most of the eggplant flesh though, which seemed strange to me. The second choice, which I did make, instead called for rolling up thin slices of eggplant. I decided that the eggplant would taste better this way, so I went with it.

Even though it took several hours, the result was very tasty, and worth the effort. I followed the recipe almost verbatim, except that I substituted dried tarragon for fresh basil in the stuffing, since my basil plant is pretty much dead. Clare enjoyed it too, though as I predicted, she wasn’t too wild about the sun-dried tomatoes. She couldn’t put her finger on it until I told her the ingredients though. She also mentioned that I should have put more olive oil on the eggplant, which is correct.