A friday in my newsreader: Febuary 22.

Occasionally, so many wonderful posts appear in the lull between the Thursday doldrums and the Friday excitation (pun much?) that I have to “link it up…er…mott”.

  1. It turns out that you can see the effects of trawling for fish from space. Do we need any more evidence against it?
  2. Uncertain Principles posts about the backlash from the Virginia Tech shootings: turns out stage plays with fake wooden weapons endanger students…according to some college administrators.
  3. Uncertain principles also wonders if there is any realistic nanotechnology in SciFi writing.
  4. That encrypted hard drive you might have? Worthless now that the encryption can be broken…easily.

Oh and as a side note, anyone else watch one of my favorite video blogs: http://tv.winelibrary.com/?

Creative Commons License image credit: Pulpolux !!!

Multi-plugin Plugin

Multi-plugin is a very simple script that allows you to add small bits of PHP scripts, such as WordPress filters, without having to make a plugin for them.

Download Multi-plugin

Installation is as simple as renaming the file to .php, uploading it to your server, activating it, and adding some script to the textbox (for example, I use the following code to remove the nofollow attribute from comments.)

<?php
add_filter('get_comment_author_link', 'aoi_follow');
add_filter('comment_text', 'aoi_follow');
function aoi_follow($link){
   return preg_replace('/(<a.*?rel[^>]*)nofollow(.*?)/','${1}${2}',$link);
}

?>

You can also use the following to add the trailing slash back onto feeds, categories, pages, etc. in WordPress 2.2+.

<?php
add_filter('user_trailingslashit', 'aoi_slashit',10,2);
function aoi_slashit($string, $type=''){
  if($type == 'page' || $type == 'category'|| $type == 'month'|| $type == 'day'|| $type == 'paged'|| $type == 'feed'){
    return trailingslashit($string);
  }else{
   return $string;
  }
}
?>

WordPress Code Escape

Here is another small modified plugin that auto-escapes your code, nicely displays line numbers and uses valid XHTML. This plugin is based off of SemCodeFix, and adds many of the features I wanted in my code plugin.

Download:
WordPress Code Escape

Directions:
Download the file and save it as a .php file.
Upload to your plugins directory.
Activate it.
You may optionally choose to add the following style information to your theme’s style.css.

.code_child {
	font-family:"Courier New", Courier, monospace;
	white-space:pre;
	width:90%;
	background-color: #F4F4F4 !important;
	overflow:auto;
	border:1px inset;
 	margin:10px;
}
ol.code_child li{
 	margin:0;
 	padding:0 !important;
 	line-height:100% !important;
 	margin-bottom: -8px;
 	margin-bottom: expression(5 +"px");
 	margin-left:  expression(35 + "px");
}

Spreadsheet to Table Plugin

This was an extremely quick project to turn spreadsheet data into an XHTML table. The plugin is quite simple to use, just copy some data from a spreadsheet ( or the visible part of an XHTML table) and paste it into a blog post between the tags [table] and [/table] (make sure that columns are tab separated and rows are on their own line). This is a no frills plugin. The first row is used as the column names and is added to a thead tag. Anything can be added to the [table] tag after “table” and it will become the table’s caption. EX [table "This is an example table"]

So this:

[table "This is an example table"]
gf	sfg	sfcx	dfg
asd	sd	dsfs	
xcv	fds		sgdf
dfg		dfg	dfg
	dfg	dfg	dfg
[/table]

Becomes:

“This is an example table”
gf sfg sfcx dfg
asd sd dsfs
xcv fds sgdf
dfg dfg dfg
dfg dfg dfg

Installation:

  1. Copy and Paste the contents of the texbox below into a .php file.
  2. Upload and activate.

<?php
/*
Plugin Name: Tabeler
Plugin URI:  http://anthologyoi.com/plugins/
Description: This plugin allows you to copy data directly from a spreadsheet and paste it into your blog, and will automatically create a table for it.
Version: 0.1
Author: Aaron Harun. 
Author URI: http://anthologyoi.com
*/

add_filter('the_content','tabler_find',1);
add_filter('the_excerpt','tabler_find',1);

function tabler_find($content) {
	return preg_replace_callback('!\[table([^]]*)\](?:\r\n|\n|\r|)([\S\s]*?\t[\S\s]*?)(?:\r\n|\n|\r|)\[/table\]!ims', 'tabler_callback', $content);
}


function tabler_callback($matches) {

	$pos_table = $matches[2];

	if(strpos($pos_table,chr(13)) !== FALSE){
		$rows = explode(chr(13),$pos_table);
	}else{
		$rows = explode("\n",$pos_table);
	}

	if(is_array($rows)){
		if($rows > 1){
			$table .= '<table>';

		foreach($rows as $row){
		$i++;
			$cols = explode("\t",$row);

			if($i==1)
				$table .= '<thead>';

			$table .= '<tr>';

			foreach($cols as $col){
				$table .= '<td>'.$col.'</td>';
			}

			$table .= '</tr>';

			if($i==1){
				$table .= '</thead>';

				$table .= '<tbody>';
			}
		}
			$table .= '</tbody>';

			$table .= '</table>';
			
			return $table;
		}
	}
}

?>

WordPress Access Keys Plugin

The WordPress Access Keys Plugin a allows you to add access keys to pages and categories to improve accessibility of your WordPress website. This works with any page or category list that is called with wp_list pages and wp_list_categories respectively. This plugin works in all WordPRess versions from 2.1 – 2.5.

Screenshot of Admin Panel:
Screenshot of Access Keys Version 0.1

Demo:
The About page on this site has an access key of 6 and the site map has an access key of 3.

Download:
Access Keys version 1.0

Installation:

  1. Download the zip file, unzip it and upload to your wp-content/plugins folder
  2. Upload to your plugin directory.
  3. Activate.
  4. Go to the Admin Menu under Manage named Access Keys.
  5. Read the instructions.

Use:
Use of this plugin is simple. On the Admin panel it lists pages and categories with a current access key, and in a separate list it lists the pages and categories without access keys. Just add an access key just type an access key in a text box and then click the save button. The categories or posts will now move to the top list.

How do I use Access Keys
Different browsers implement Access Key shortcuts differently. The following is a list of browser access key key combinations.

  • On Windows and Linux. Firefox 2.0+: Hold down the Alt Key and the Shift key, and press the access key.
  • On Windows. Internet Explorer 5+: Hold down the Alt key, and press the number or letter of the access key. Release both keys and press Enter.
  • On Windows. Internet Explorer 4, Firefox 1.0, Mozilla and Netscape 7+: Hold down the Alt key and press the number or letter of the access key.
  • On Mac OS X. Firefox, Mozilla, Netscape 7+, Internet Explorer 5+, Safari and Omniweb: Hold down the Ctrl key and press the number or letter of the access key.
  • Konqueror: Press and release the Ctrl key, then press the number or letter of the access key.
  • On the Mac Internet Explorer 4.5 and on all platforms Netscape version 6 and earlier: Access keys are unsupported.