WP People

Tags: xfn, links, blogroll, people
Requires at least: 2.7.1
Tested up to: 2.8.4
Stable tag / Version: 3.4.0
Plugin Download
Support Forum : Hacks and Scripts / wp-people Thread

This hack plug-in will search a post and find names that match database records of people maked with the WP Category in the XFN Links. When it finds a match, it will replace the name with a link to the person. There is a administration screen for adding people and their bios to the database and viewing the current people marked for the filter. More than one person can be linked on a post. A individual name will only be linked once per post.

The original author of the hack stopped supporting it a while ago. I took his original idea and used another hack (acronymit) as a guide to make this work. The original worked with the my-hacks script used in WordPress 1.0.1, so this is beyond the functionality of the original.

If you were using the version 2 of Word Press People, then you will be able to see any current people in WP People. As of version 3.1.0, you can Copy records from the WP People table into the XFN Links databse.

Installation

  1. Upload `wp-people` to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to the WP People administration page under the Tools section. The first time there will create the “WP People” Category
  4. Go to the Links administration page. Add new Links or add the WP Category to those people who you want to be included in WP People.
  5. Optionally Install the ‘WordPress Force Word Wrapping‘ plugin to prevent the description text from extednig past the popup window area.

Usage

The field on the Links form match up the following way:

  • Name is the Real Name (searched name) in WP People
  • Description is the Nick Name (displayed name) in WP People
  • Web Address is the Link in WP People
  • Advanced Notes is the Description/Bio in WP People
  • Advanced Image Link is the Photo in WP People

WP Mixed Tape

Tags: mixed tape, mp3
Requires at least: 2.7.1
Tested up to: 2.7.1
Stable tag / Version: 1.1.0
Plugin Download
Support Forum : Hacks and Scripts / WP Mixed Tape Thread

This a plugin that will take shortcode for track listings and make a “Mixed Tape” by turning the mp3 file links into music players and creating a play list of the tracks. The play list is a second shortcode that can be placed anywhere in the post. The play list can also show the tracks as a single album by changing the type. This will only show one link to the artist name added to the play list. The play list icon can be changed to show the mixed tape, cd, cd box, head phones or any image. The image should be small enough to fit inside the play list.

There are no admin options for the plugin.

Usage information can be found below.

The plugin uses 1PixelOut‘s standalone WordPress MP3 player, but should not conflict with other plugins using the player.

The plugin creates a search link to MusicBrainz music database for the artist of the track.

Installation

  1. Upload `wp-mixedtape` to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Usage

Adding tracks

[ track title="{track title}" artist="{track artist}" url="{track url}" alt="{alt text}" ]

  • track title is the title for the song. This does not change what is displayed in the mp3 player as the title information is taken from the mp3 file.
  • track artist is the artist for the song. This does not change what is displayed in the mp3 player as the title information is taken from the mp3 file.
  • track url is the full url for the song.
  • alt text is the alternate text shown if the player is not displayed. If left empty, it will show the track title.

Adding the mixed tape play list

[ mixedtape title="{mixed tape title}" style="{override styles}" class="{override class}" type="{play list type}" icon="{override icon}" cover="{image url}" artist="{single album artist name}" ]

  • mixed tape title is the title for the mixed tape to be shown at the top of the play list
  • override styles is any extra style attributes to add to the overall play list
  • override class is class name given to override play list for class style
    The style class should be part of the div classes. (ie. div.myMixTapeClass )
  • play list type is the type of play list either MIXEDTAPE or SINGLEALBUM. MIXEDTAPE is the default and will list each artist with the song.
  • override icon is the option to change the icon, choices are TAPE, CD, CDBOX, HEADPHONES.
  • image url is the url for a custom image to override the icon, ALBUMCOVER must be used as the icon value.
  • single album artist name is the name of the artist for the SINGLEALBUM type. It is ingored on the MIXEDTAPE or default type.

Things to do

  • Playing one player shuts off the other one. This was fine with version 1 of the payer, but version 2 doesn’t seem to work.
  • Code clean up – just need to make sure everything is in it’s proper place and such
  • Language translation – not many words in the plugin, so hopefully this won’t take too much time

Change Log

Version 1.1.1

  • Didn’t have the SVN directory properly setup. The audio files were missing.

Version 1.1.0

  • Added the ability to change play list `type` (MIXEDTAPE, SINGLEABLUM)
  • Single album type allows for `artist` value to be added to play list, ignored for mixed tape type
  • Added the ability to change the play list `icon` (TAPE, CD, CDCASE, HEADPHONES, ALBUMCOVER)
  • Added the ability to add change the icon to an defined url image with the `cover` option

Version 1.0.0

  • Inital release.

AHP Sitewide Recent Posts – hack 2.1ish

It’s funny how things happen to fall into place. Jacob over at 912Candidates.org was lamenting over the issue of not keeping the main page up-to-date. A few of the state sites have been posting updates, but Jacob has been a little busy and didn’t have anything to put on his front page. If only, he thought, there was a way to show the posts from the other sites. Well, what do you know, I was just playing around with a plug-in that did that. After pointing Jacob to the example on NC Freedom, he came back with some changes. The biggest change that he wanted was to use the flag icon I was using for each site instead of the avatar for the user.

When I created the one off Gold List plug-in for the 912Candidate site, I used avatar images that depict state flags. I decided to be a little creative and spice up the list with these flags and it turned out really well. Initially I had some issues getting the flags to work, because I needed an easy way to get the file name based off of the site. Each state site used the state abbreviation and the file names used the full name of the state. I didn’t want to rename all the image files, so I created an array to hold the values.

// state list
$stateList = array( 'AL' => 'Alabama', 'AK' => 'Alaska', 'AZ' => 'Arizona', 'AR' => 'Arkansas', 'CA' => 'California',
'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'DC' => 'District of Columbia', 'FL' => 'Florida',
'GA' => 'Georgia', 'HI' => 'Hawaii', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'IA' => 'Iowa',
'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'ME' => 'Maine', 'MD' => 'Maryland', 'MA' => 'Massachusetts',
'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NE' => 'Nebraska',
'NV' => 'Nevada', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NY' => 'New York', 'NC' => 'North Carolina',
'ND' => 'North Dakota', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island',
'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VT' => 'Vermont',
'VA' => 'Virginia', 'WA' => 'Washington', 'WV' => 'West Virginia', 'WI' => 'Wisconsin',  'WY' => 'Wyoming'	);

By having the array, I could always add more values or use either the initial to get the name or the name to get the initial.
I updated the code to search through the array and match up a substring of the blog link to the state abbreviations. If an abbreviation matched, then the code for adding the image is added to the variable. I replaced the avatar variable value with this new variable. It makes for a nice effect on the main page of 912Candidates.

foreach ($stateList as $abbr => $stateName){
if($abbr == strtoupper(substr($blog_link,strpos($blog_link,'org') + 4, 2))){
$this_blog_image = '<img src="/resources/flags/' .
$stateName .
'.gif" height="55" width="55" border="0" align="left" style="padding-right: 5pt;" />';
}
}

Testing the syntax highlighter

So, I added this awesome plugin called SyntaxHighlighter Evolved that converts code into a pretty look on the blog. The reason for using this is obvious to any developer. It’s a real pain in the butt to convert code so that it will display in HTML. And you want to display code every now and then to show off your geek fu or just to complain about some code that was bugging you.

Let’s see if my new buttons work. Basically, I am using WP-Quicktag to easily add QuickTags to a post. For the SyntaxHighlighter I decided to add two QuickTag buttons. One for ActionScript 3 and one for JavaScript, since they are the code types I use most in my custom development. The buttons place the QuickTags around the text I want to show as code.

This is an ActionScript 3 code example

1

:

public function initApp():void
        {
			oneMinuteTimer.addEventListener(TimerEvent.TIMER, oneMinuteTick);
			oneMinuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, resetOneMinute);
			oneMinuteTimer.start();

			twoMinuteTimer.addEventListener(TimerEvent.TIMER, twoMinuteTick);
			twoMinuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, resetTwoMinute);
			twoMinuteTimer.start();

			fiveMinuteTimer.addEventListener(TimerEvent.TIMER, fiveMinuteTick);
			fiveMinuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, resetFiveMinute);
			fiveMinuteTimer.start()
        }

And this is a JavaScript code example

1

:

function findPlayListItem(fileTitle) {
		var outItemId = 0;

		playlist = player.getPlaylist();
		if(playlist) {
			var thisTitle = '';
			for(var listItem in playlist) {
				thisTitle = playlist[listItem].title;
				if(thisTitle == fileTitle) {
					outItemId = listItem;
				}
			}
		}
		return outItemId;
	}

The simplicity of adding these little blocks around the code to save a ton of time is one of the great things about WordPress. Now if I can only find a quick way to update any old posts with code in it.

Updates and updates

WordPress has been making more updates lately than a backstage of a Las Vegas review.  Since the automatic update hasn’t worked in a few attempts, I have been forced to update manually by finding the files that are updated and uploading them to the site.  Hopefully I am finding all the files and doing all the updates.  I guess when they do their next big release, I’ll do a complete update of all of the files just to be on the safe side.

One issue with the updates is that if you create plugins, like I do, then you have to verify that your plugin works with the new update.  This usually isn’t a difficult task when you have a demo page on your site.  Just go to the page and see if it still works.  That was the step I took with my Mixed Tape plugin. However, as a plugin creator, you aren’t done there.  In order for someone to feel a little more comfortable about your plugin, you have to keep the “Tested up to:” version up-to-date.  Updating this information on your plugin requires an update to the “readme.txt” file and then a checkin to the source control database.  Apparently I’m getting better at it, because I am not reloading the files up multiple times.

What prompted me to make my plugins compliant with the new version of WP was a suggestion in my forum about a change to the WP People plugin.  The user wanted to customize the title or hover text on the link to the WP People bio.  I thought that was a great idea and now I found a little time to tackle the request.  While I was coding away, I changed the code around to work a little more like a plugin I made for 9/12 Candidates.  And, I also removed the table html that creates the layout for the form.  The changes aren’t major, but they weren’t minor either.  Hopefully it will allow me to do updates to that plugin much easier in the future.

But of course, my two little plugins are free, so I don’t see myself making a living off of WordPress plugins, even though a few developers get some money.

svn causing me heartburn

Arrrghh!!

So, the Plugin Directory finally pushed the 1.1.0 version of my Mixed Tape plugin to the repository to download. After I upgraded the plugin through the admin Dashboard, I noticed that the players were not showing in the test page. Well, apparently the svn check in blew up when I tried to add the 1.1.0 version and never put the audio files up to the site. I copied the audio directory from the trunk, which is apparently a no no. So, from now on I will have to remember to copy it from my working directory, which happens to be my local directory of my site.

I know some people have demo sites of their blogs. I really never thought I would have to worry about that, until now. I really don’t want to go through the hassle of setting up a duplicate blog just for testing, but it might come to that. My blog doesn’t get much traffic, but who knows, with the plugins and the Meetup Organizer Tool, it might just start.

Anyway, I’ve released 1.1.1 of the Mixed Tape and I see that the audio directory is under that version. I guess this will also be a good test to see how the tags/revisions work. Since the audio folder wasn’t in 1.1.0, then there will be a definite change between the two version. Of course, I will have to wait until it gets pushed through the repository, however long that will take.

An ah ha! moment

So, I apparently didn’t get enough sleep last night and my brain isn’t working on all cylinders. Anyway, it hasn’t stopped me from some side brain storming. Since I finally got my Mixed Tape plugin to show up on the plugin directory, I guess I was thinking about the type of people who might use it. I shared it with one of the guys over at Music Brainz, who plans to do a little write-up about the plugin. I guess that was in the back of my head, because it came to me that people who review music could use the plugin. Of course, that might have nothing to do with a music database, but it might. I bet there are plenty of people who write-up reviews about the latest album from their favorite artist, before they submit it to Music Brainz.

Since the plugin basically just takes the tracks and makes a playlist a reviewer could discuss each of the tracks on the album and link to the track as the review goes along. So, when they are done, someone could listen to the track and see if they have the same impression as the reviewer.

So, this means I probably need to make some small enhancements. I can probably add an option to the playlist to show either the mixed tape or a cd or maybe just an album. Or maybe I could show do a thumbnail of the album art, if the reviewer had that. Then I guess there would be an option as to whether or not the page contained a mixed tape or single album.

Welp, guess I better add that to the “to do” list.

Patiently waiting

Arrghhh!!
So, I got approval and the “go ahead” e-mail for my Mixed Tape plugin. I did the checkout using TortoiseSVN and it created the folders for the plugin. But, after adding files to the trunk, creating a tag folder and committing the files back up to svn, nothing. The files are up on svn, but the download page has yet to update. The page still shows my login as the author and doesn’t have any of the other information that my WP People plugin download page has. Very frustrating.

I know I’m not the only one who has gotten frustrated with creating plugins. Just check out The Agony and Ecstasy – Creating a WordPress Plugin. I even found a guy who posted a video series called How to Host a Plugin on WordPress in a four part series. The only thing I learned from the series is that it would be nice to have a new computer and maybe I would use a free open source IDE called Aptana.

I think I’ll let it set for a day and hopefully it will magically fix itself. Until then, I manually reloaded the plugin so that the demo page would still work.

My new Mixed Tape plugin

Mixed Tape

Mixed Tape

I am about to release a new plugin for WordPress. I am calling it WordPress Mixed Tape (WP Mixed Tape). If you have no idea what a mixed tape (mix tape) is, well, take a little trip back in time with me. Back in the day (let’s say the 1980′s), [W:cassette tapes] where the way taking your music with you. The [W:8-track tape] had gone the way of the [W:Dodo] and record [W:albums] were not portable. If those terms seem foreign to you, I included Wikipedia links to help you understand a little better. The great thing about tapes were that you could copy them to another tape. And, if you didn’t particularly like all the songs on a tape, you could copy tracks or part of tracks off of one tape and put it on another. You could even put your own voice recording or other recordings on to the tape.

Of course, this lead to people making their own full tapes for different purposes. One of the best or worst purposes for mixed tapes was for wooing someone. If you had a crush on someone or had been dating them for a period of time, you could show your love by copying a bunch of different songs that related to your emotional attachment to the other person onto a mixed tape. You could also be creative and add your own commentary in between tracks to show how that particular song meant so much to you about the current situation. For better or for worse, mixed tapes either helped or hurt the lovelorn and their situation. In today’s digital age, mixed tapes are now replaced by CDs (if you are legally allowed to make them now). But, even CDs are going away, since people can download music directly. So, what is a person supposed to do now to make a mixed tape? Well, you write a blog post as a mixed tape.

You are probably wondering how I came up with this idea. Well, Dean Logic is always all over the place, but there was a focus for this.

I was reading a coupe of posts on Gizmodo about the Windows PC commercial where “Lauren” buys a laptop for under $1000 and keeps the change. The Apple Fan Boys on Gizmodo didn’t appreciate Lauren’s selection. Not really caring about what her selection was, I was thinking I could write her an open letter stating that I didn’t care what she bought, because she’s cute. Then I started thinking that it would be great it I could make the post into a Mixed Tape. And that’s how this came about.

Basically, you add tracks to your post as you write. The idea would be that the tracks correspond to that particular part of the post. And then you add a tag to add the play list to the post with the name of your mixed tape, because very good mixed tape has a label. The code goes through and converts the track and play list tags and presto! You have a post that is also a mixed tape.

Now, to work on my open letter/mixed tape post for Lauren.

99.9999% done with WP People

Well, I figured out how not to only add buttons for my WP People plugin but to have it popup with a window to select from the WP People list and then select a person and have it insert back into the Page or Post. And, I got it to work with both the tinyMCE (the pretty WYSIWYG editor) and basic editors. Yippee!!! Of course, IE is a piece of junk, so it doesn’t work 100% with IE. A couple of errors appear when it loads the list popup, but you can just click through those and the insert still works.

On top of getting this to work, I reduce the number of pages used in another example I saw. In the other examples, it looked like they had to create one popup page for each of the editors. I managed to make it work with just one page (i.e. regardless of what IE says). I also eliminated some other side files that the examples were using. However, my plugin is much simpler and didn’t need a lot of other things.

Of course, as I sit here writing this, I realize that I didn’t restrict the WP People list to the owner, so I guess I’ll be making a quick change. A geek’s work is never done.