Categories
technology

Best-Of Comments

Have you ever wanted to share your favorite comments on the front page of your site? I’m not talking about the most recent comments, or the most frequent contributors, but the best comments (most funny, most thoughtful, most appropriate, most rash – whatever your criteria may be). Now you can.

Best-Of Comments allows anyone with the ability to edit comments to mark a comment as “featured” and then featured comments will be randomly selected and displayed anywhere you choose to place the php call to best_of_comments(). You can select how comments are displayed, how many to display, and how much of a comment to display (if comments are longer than the specified word length they contain a link back to the original comment). In the future you will have the ability to limit how far in the past to look for featured comments.

Latest Version 1.2 (December 15, 2009)

Discovered a function call that allowed other plugins which alter the content to possibly interfere with the display of featured comments.

Categories
life technology

WordPress, the OpenID Plugin, and Blogger Comments

I’m a fan of the idea of OpenID which is why I use the OpenID plugin accept OpenID authentication for comments on this site and others that I run. I am under no illusions that it serves as an anti-spam measure which is why OpenID authenticated comments undergo all the same spam filtering that any other comment receives. One of the reasons that I use the OpenID plugin is that it allows me to use my blog as an OpenID identity server so I can use my own domain to authenticate me on other sites that accept OpenID – including (especially) Blogger. When I leave comments I  like to be able to leave general comments that are authenticated by this site and have political comments authenticated by my political blog, Pursuit of Liberty (so that the comments point back to the most applicable site for the content of the comment). That worked for quite a while, but a few weeks ago I began getting an error when trying to use my OpenID’s on Blogger blogs.

I did a lot of searching but got no answers for the bug (I would leave the bug here so that others can find it, but Google changed the error code in that time to read “Your OpenID could not be verified”). Eventually I figured out that it was only happening when trying to leave comments authenticated through Pursuit of Liberty, but since the setup there is identical to the setup here that was not very helpful. Finally today I figured out the solution – I was authenticating through www.davidjmiller.org and pursuit-of-liberty.com – both are set up as www.{domain-name} and Google apparently decided to get strict on their authentication. When I leave comments from www.pursuit-of-liberty.com it worked fine. If anyone else finds this problem with Blogger and the OpenID plugin just remember to authenticate with or without the “www.” depending on how your site is set up (in other words make it match exactly).

Categories
life Local pictures politics State technology

Voting Record

Voting Record will allow recording of votes cast for display and reference purposes. Elected officials can record and display their votes and citizens can track and display the votes of an elected official they follow.

Latest Version: 2.0 (March 16, 2009)

Display templates are introduced here giving you total flexibility in deciding what to display. There is one set of template settings for recent votes and another for search results. Each template is made up of a header, a footer, and an item template. Template tags are used to display the variables specific to each recorded vote such as the vote cast or the vote description. There is also a setting for what to display when no votes are returned in the recent votes and another setting for when no votes are returned in a search.

Votes are entered on a dashboard widget:

Vote Record Dashboard Widget

A vote management page is available from the posts menu:

Manage Recorded Votes

Recent votes are shown by adding <?php recent_votes(); ?> in your theme templates. You can show a search votes form by using the shortcode [ SEARCH-VOTES ] on a page or post. Options for Voting Record include:

  • The option to specify a primary voter (if most or all of the votes being tracked are from one person).
  • The option to specify header text/code for the recent vote list.
  • How many recent votes to show – limited by number of votes or number of days.
  • What to show before a list of recent votes and what to show before a list of search results.
  • What to display at the end of a list of recent votes and what to display at the end of a list of search results.
  • The format for displaying your recent votes or search results lists, including which pieces of information to show.
  • What to display when no recent votes are returned or when a search comes up empty.

To install it simply unzip the file linked above and save it in your plugins directory under wp-content. In the plugin manager activate the plugin. Settings for the plugin may be altered under the Voting Record page of the Options menu (version 2.3) or Settings menu (version 2.5 or later).

Categories
life meta pictures technology

Kiva

For those who wish to help others but who have limited means to do so Kiva provides an opportunity to give a little (as little as $25) and help people around the world who have business plans to lift themselves up economically. Loans from individuals get pooled as necessary to fund people. I have been very impressed with this system that allows people to help others by using small means to make great things happen.

I was very happy to take the opportunity to take the code written by Connor Boyack and turn it into the Kiva plugin for WordPress so that people can raise the visibility of Kiva by displaying loans in the fundraising stage with a link to donate.

version 1.1 (2/10/2009)
More options over which loans to show

Latest Version 1.2 (2/27/2009)
You can now use a text widget with the shortcode SHOW-KIVA (enclosed in square brackets – []) to display the Kiva plugin in a widgetized sidebar.

Options include:

  • Number of posts to show.
  • Display format for loan list – Image only displays the image for each loan linked to the donation page, Both displays the image and text information, Text only displays name(linked to the donation page), business, country, and fundraising level/goal for the loan.
  • Gender – you can restrict to only show loans for men or loans for women.
  • Region – you can show loans only in one of 7 geographic regions.
  • Sector – you can only show certain types of loans such as retail or agriculture.

To install it simply unzip the file linked above and save it in your plugins directory under wp-content. In the plugin manager activate the plugin. Settings for the plugin may be altered under the Kiva page of the Options menu (version 2.3) or Settings menu (version 2.5 or later). Place the call show_kiva(); anywhere in your page templates or use [ SHOW-KIVA] in a text widget.

Categories
life Local meta politics

Cleaning Up

I’ve been working on a blog for Becky Edwards, my state representative, that she wants to use to communicate with constituents. As part of that I have been looking at themes and plugins to help implement the features she is looking for. That led me to Subscribe2 which offers email subscription functionality through the blog. I have decided to try that out in place of feedblitz and see how it works. I figure it will be easier to tend on my own site.

I’m hoping that it is a positive experience for my few subscribers.

Categories
life meta politics

Surprise Benefit

When Congress passed the measure to extend daylight savings time I thought it was a silly move. I still do. They claimed that it would save some great amount of energy while I argued that the amount of energy saved was insignificant. Honestly it is an issue  that is not worth much of a fight either way. I only bring it up now because I discovered a benefit to the extended daylight savings time – it is not dark by 6:30 on Halloween night which means that walking the neighborhood with young children is much more pleasant than it was before that change.

I forgot to mention that in my Halloween post but that is another reason that I was able to enjoy Halloween more this year. I remembered it today when I realized that I had to adjust my blog for daylight savings – I can’t wait for WordPress to fix that bug.

Categories
meta pictures technology

Similarity

I have been using Darren’s Related Posts plugin (DRPP) for a long time. For my purposes it was the best plugin for showing related posts that I had encountered. After a while I decided that I was not completely satisfied with the way that it seemed to favor more recent posts. I developed a new algorithm that I felt would not give preference to newer posts unless they were actually more related.

When I learned that WordPress would be adding native tag support in version 2.3 I decided that I would create my plugin to work with tags after they arrived. Life got busy so I never worked on the plugin until version 2.5 came out (partly because I wanted to convert the post_meta “keywords” from DRPP to tags). I finally buckled down and created my Similarity plugin this week. I have tested it on version 2.3.3 and version 2.5 (I assume it will work with any version of 2.3). I will continue to test it on new versions of WordPress as they are made public. (Przeczytaj opis wtyczki po polsku)

Latest Version 2.13.1 (September 9, 2009)

New options make it possible to layout and style the php function generated lists (for sidebars) independent of the auto-generated list. – Version 2.13 was released with an incomplete development copy of the plugin so it did not have the promised functionality. (In other words, “Pay attention Miller.”)

To install it simply unzip the file linked above and save it in your plugins directory under wp-content. In the plugin manager activate the plugin. Settings for the plugin may be altered under the Similarity page of the Options menu (version 2.3) or Settings menu (version 2.5 or later).

Options include:

  • Number of posts to show – this is a maximum, it won’t invent connections that don’t exist, set it to 0 (or less) and it will display all matches.
  • Minimum match strength – enter a number between zero and one (one being a perfect match) and items related weaker than the number indicated will not be included – this limit is ignored for the one extra if that option is used.
  • Default Display if no matches – if there are no matches this is what will be displayed, this is not displayed if there are matches, but fewer than the set maximum.
  • Text and Codes before the list – assuming you want to do a list this is where you would place the <ul> or <ol> You may also place any other code you would like to have preceeding the list. (There are two boxes here – one for function calls in your template and one for auto-generated lists.)
  • Text and Codes after the list – this would be the place for </ul> or </ol> You may also place any other code you would like to have following the list.(There are two boxes here – one for function calls in your template and one for auto-generated lists.)
  • Output template – this would be where you place the <li> tags. (There are two boxes here – one for function calls in your template and one for auto-generated lists.) There are also 4 template tags you may use (in any configuration you can imagine) to define how the results are displayed
    • {link} – provides a link – equivelent to <a href=”{url}”>{title}</a>
    • {strength} – outputs the calculated degree of relatedness
    • {url} is the permalink for the related post
    • {title} is the title for the related post
  • Display format for similarity strength – Value displays the {strength} in a decimal format (0.873), Percent displays the {strength} in a percentage format (87.3%), Text displays {strength} as a word (Strong, Mild, Weak, and Tenuous are the defaults), and Visual displays a color block (Green for 100% fading to Yellow and then to Red for weak connections)
  • Relative mixing weights – these values determine the ratio given to the weight of tags vs categories when using the sim_by_mix function. Invalid ratios are treated as a 1 to 1 balance.
  • Custom text for strength – allows you to insert custom text (including markup) for the strength indicator when using the text display format. (Hint: using markup allows for the possibility of showing custom images.)
  • Show one more random related post – dig deeper into the related post list with one random selection (you can set a minimum strength for these random items).
  • Auto-display a Similarity list at the end of a single post – without modifying any templates.

The plugin allows for three function calls anywhere in your page templates or their shortcodes in text widgets (all use the same options):

  • <?php sim_by_tag(); ?> – determines similarity based on the tags applied to the posts (shortcode: SIM-BY-TAG)
  • <?php sim_by_cat(); ?> – determines similarity based on the categories assigned to the posts (shortcode: SIM-BY-CAT)
  • <?php sim_by_mix(); ?> – determines similarity based on the tags and the categories with the relative weights determined by the relative mixing weights setting (shortcode: SIM-BY-MIX)

Alternately you may choose to auto-display any of the similarity lists at the end of posts on single-post pages without getting into the php by selecting the function you wish to auto-display on the Similarity options page.

Categories
meta technology

Archive Menu

I have created a new theme for my site (more like what I was unable to create before) which should render correctly in any browser. I know that the old theme was quirky in Internet Explorer. As part of creating this new theme I had to make a new plugin for WordPress. It’s called Archive Menu and it displays the archives as a two layer list of years and months. I took most of the code from Compact Archive by Rob Marsh (http://rmarsh.com/plugins/compact-archives/). I loved that plugin in my last theme, but it displayed in a very abbreviated format which would not work for the menu I was trying to create. This plugin displays the menus more like the standard monthly archive function of WordPress broken up in to years.

Once I have fully polished my theme I will release the code I used to implement the Archive Menu but I want to make the plugin available before then. Download the plugin here.

Categories
technology

Posting Rich Text Email

I have created a hack for wp-mail.php that allows rich text emails to be processed. I call it wp-mail-rich. To use it you simply copy the wp-mail-rich.php file in the folder where WordPress is installed (where the wp-mail.php
file is) and use wp-mail-rich.php in place of wp-mail.php. If you have a cron job, just point it to the new file. To rollback just point it back to the old file.

I have also included some files that I used to test and develop this – in case anyone wanted to make further modifications. Instructions are in the readme.txt file.

Download wp-mail-rich.

I have only tested this with Gmail so it is possible that other rich text emails might not be exactly right coming from Yahoo, Hotmail, or your company mail server. Let me know if this is the case.

Categories
technology

Behind The Caucus

Random wanderings took me to the code view of the New York Times political blog – The Caucus. Like the Library of Congress blog, it is based on WordPress. They have modified it enough to make it difficult to detect, but they have left some small clues and they use a very popular WordPress plugin – Ultimate Tag Warrior.