Utility to wait for a process - Wait.exe

As I mentioned in this post, I spent a bunch of time looking for a command line utility that would wait until a specific process has completed.  I was dumbfounded that I couldn’t find one, so I set out to write one.  I chose C# because all the tools are available.  Here is the usage text:

wait <process_name> [-t:secs] [-v]
wait -p[id] <process_id> [-t:secs] [-v]
wait -m[odule] <moduleFileName> [-t:secs] [-v]
wait -t secs

Wait for a process to exit or for a specified amount of time.

where:
  process_name   - Name of the process to wait for.
  process_id     - ID of the process to wait for.
  moduleFileName - File name of the module (i.e. image file) running in the
                   process to wait for.  The first process that matches will
                   be the one that is waited for.  If no extension is
                   specified, .exe will be used.
  secs           - Maximum number of seconds to wait.
  -v             - Display information about the process before waiting.

It’s pretty straightforward.  It uses several techniques to find the right process using the System.Threading.Process class.

  • If a process ID is specified, there is exactly one process that will match.  The Process.GetProcessById() static method is used to find the process in this case.
  • If a process name is specified, the Process.GetProcessByName() static method is used.  This method can return multiple processes, in which case an error is returned.
  • If a module (e.g. executable image file name) is specified, Wait.exe loops through all processes until it finds a process that matches.  The first one that is found is considered a match.

Once the process is found, the WaitForExit() method is called on the Process object.  An optional timeout value can also be specified for the maximum number of seconds to wait.  Finally, if only a timeout value is specified, Wait.exe will simply call the System.Threading.Thread.Sleep() static method and then return, allowing timed waits to be added to command scripts.

Room for improvement

This utility is far from perfect, but I don’t have a reason at the moment to address its deficiencies.  Here are some wishlist items.  Please add a comment if you’d like me to address any of these.

  • Detect multiple processes that have the same module loaded.
  • Allow multiple processes to be waited on.
  • Sign the assembly image so that it can be run across a network.
  • Convert to C++ to produce a smaller image (it’s currently 24Kb).
Resources

Comments (1)

Launching apps & games from Vista Media Center (VMC), Part 2

In my previous post on this topic, I discussed the basics of extending Media Center to add entries to the menus, specifically Beyond TV from SnapStream Media.  Click here to see that post.

Once I had that figured out and working, I figured I’d venture to another application used quite a bit by my family - particularly by my boys - on the HTPC:  World of Warcraft (or WoW) by Blizzard Entertainment (I’ll talk about WoW specifically in a later post).  As a stated in my earlier post, I’d really like to use VMC as the center launching point for all applications and media.  With my successes with Beyond TV, I thought surely I could duplicate that technique to launch World of Warcraft from Media Center.

The first thing I did was to modify the Beyond TV XML file and various scripts.  It kind of worked, but not really.  The biggest problem with this solution for WoW is that when you launch it, you are actually launching a launcher program which checks to see if there are updates that need to be applied.  You then click Play which launches another application and then exits.  The other application sticks around until you exit from the game.  The problem is that Media Center doesn’t know anything about the other application.  It only knows about the first one.  When that exits, it attempts to reassume control which causes fits for the real WoW application.

So how do we solve this?  What if we run a command script that waits for the second application to complete before returning?  That sounds like a simple enough solution, so I set out to find a tool that would wait for a Windows process to complete.  I was dumbfounded when I couldn’t find anything after searching on the Internet for an hour or more.  Oh well.  I have the tools.  I can rebuild it…oh wait, wrong decade smile_regular.

I decided to write a tool that would find a process based on criteria specified on the command line and then wait until it exited or for a specified amount of time had elapsed.  I decided to add support for waiting without specifying a process as well, which would allow me to put a sleep in my scripts (e.g. wait for 2 seconds before doing anything else).  I also decided that the fastest way for me to write this was to use C#.  It would have produced a much smaller application had I written it in C++, but I didn’t want to spend a bunch of time doing it.  The result is Wait.exe.  See the details of this command line utility in this post.  You can also download the application from the Downloads page.

So did this work?  Nope.  Why not?  Because VMC wouldn’t release the DirectX surface (I’m guessing).  I did find something that did work, however - EMUCenter.  EMUCenter is intended for providing a central place in Media Center for emulating games from consoles such as SNES, Sega Genesis, Nintendo 64, etc.  However, it has all the infrastructure in place to launch any application.  It basically puts Media Center on hold while the application launches, which works really well for preventing it from interfering with the application.  I’ve found that it works really well for World of Warcraft (using Wait.exe), Internet Explorer, and Beyond TV.  The one gotcha is that because Media Center is waiting for the application that was launched to complete, if you Alt-Tab back to Media Center the screen will be rather blank.  The trick to using it, then, is don’t launch things that you want to leave running.

There’s a lot more to EMUCenter than I have tried.  The author is also quite responsive to change and feature requests made on the EMUCenter thread on TheGreenButton.com.

Resources

Comments (1)

inlineRSS - WordPress Plugin Review

I’ve been thinking lately that my top-level blog site (dpotter.net) should display a list of posts from the blogs they front. I finally got a bee in my bonnet about it and did a search for plugins that would do the trick. I found two that said they’d do it but only one of them actually worked - inlineRSS by Cal Demaine.

Overall Grade: A
Plugin Name: inlineRSS
Version: 1.1
Plugin URI: http://www.iconophobia.com/wordpress/?page_id=55
Description: Allows inline RSS feeds from any source in any format (hopefully). Usage in templates: inlineRSS('feedname'); Usage in posts / pages !inlineRSS:feedname. This flavour uses multiple processing engines.
Author: Cal Demaine
Author URI: http://www.iconophobia.com/
Installation

This plugin requires a few more steps than most of the plugins I’ve been testing lately.

  1. Make sure you have the XSL PHP extension installed.
  2. Copy the files to the inlineRSS folder below wp-content\plugins.
  3. Activate the plugin.
  4. Edit the inlineRSS.txt file to add your feeds.
  5. Copy your inlineRSS.txt and inlineRSS.xslt files to the plugins folder (more about this later).
  6. Give your web server write access to the wp-content\plugins folder (more about this later).
  7. Add either !inline : feedname (with no spaces) in posts or pages or add inlineRSS(’feedname’) in page templates.

I didn’t realize I needed to check for the first step until I had spent a bunch of time and tried to debug through the code (good ol’ echo). It would have been helpful if the author had included that step in the installation instructions somewhere in a requirements section.

The default location for all files is the plugin folder. I didn’t like that very much, so I modified the code in the following ways:

  • Moved the location to look for inlineRSS.txt and for XSLT files to be the plugin folder itself. I’m not completely happy with my solution as it hardcodes the name of the plugin folder. I seem to remember there being a way to find the plugin folder generically, but I could be remembering that for themes.
  • Moved the location for cached feeds to be wp-content\cache. I didn’t like the idea of opening up my entire plugins folder.

The changes are pretty simple.  At the top of the inlineRSSparser function, modify the $path variable and add the $cachepath variable, like so:

$path      = ‘wp-content/plugins/inlineRSS/’; // Where to look for all config files
$cachepath = ‘wp-content/cache/’;             // Where to look for cache files

Then on line 93 change the definition of $casualpathname from this:

$casualpathname = ABSPATH . “wp-content/” . $fileprefix . $casualname . “.xml”;

to this:

$casualpathname = ABSPATH . $cachepath . $fileprefix . $casualname . “.xml”;

To specify which feeds to read, modify the inlineRSS.txt configuration file.  The file that comes with the plugin is very well commented. Each line represents one feed and contains a comma-separated list with the following fields:

  • Friendly name for the feed. The code refers to this as the casual name.
  • URI for the feed.
  • Number of minutes before the cached for the feed is discarded. The default is 30 minutes.
  • Name of the XSLT file.  The default is inlineRSS.xslt. I wasn’t sure if the file extension was required, so I tried it both ways and encountered an error when I didn’t add the extension.

There’s an example in the file pointing to Cal’s feed so you can easily test it out before spending any time adding your own feeds.

Usage

The plugin provides both a function and a filter - a very nice touch for adding feeds to pages and posts. To display feed items for Cal’s site on a post or a page, write the following:

!inlineRSS : iconophobia

(without the spaces, of course).  To display the same feeds when using a page template, make the following call:

inlineRSS('iconophobia');

The plugin page contains an FAQ with references to alternate XSLT files for different purposes. One that looked interesting said it would display only the top 5 feed items. Unfortunately I couldn’t get that one to work. I did make one change to the standard XSLT file to add a title attribute to the <a> tag.

Wishlist

There are a number of feature that would make this plugin even more useful, which I might tackle over time:

  1. Provide an admin interface. Modifying the text file is a little clunky.
  2. Store the configuration in the database, either in the wp_options table or in a table specific to this plugin. This is an almost obvious follow-on to providing an admin interface.
  3. Store cached feeds in the database, e.g. in a table named wp_rsscache. This would obviate the need to modify permissions on file system folders and close up a security hole.
  4. Allow the number of feed items to be specified as an option. Since all the heavy lifting is done by an XSLT script, I’m not sure this is even possible.
Conclusion

I’m pretty pleased with the simplicity and ease of deployment of this plugin. It isn’t as feature rich as others, but it works (unlike the getRSS plugin which uses the built-in Magpie RSS functions - I couldn’t get that to work on my installation, probably because I’m missing another PHP extension). It’s also very flexible, allowing you to completely customize the resulting HTML code that is generated. I’ll be using this plugin. You can see it in action at dpotter.net.

Leave a Comment

My FallSeason Theme Modifications

I’ve spent a bunch of time tweaking the FallSeason WordPress Theme by Sadish Bala to work for me, and I’m pretty happy with the results.  I’ve left all the identifying information virtually intact, but I have changed the version number and added my name as a modifier so that the resulting theme can be distinguished from the original.  Here are the changes I’ve made.

Style Changes
  1. Added a style for the h2 tag for the sidebar so that category names aren’t displayed in a very large font.  Instead they are displayed smaller than the Links widget title but still larger than the links themselves.
  2. Modified the h5 tag style so that it would be bolded again.  I use the h5 style a lot in my posts as a header so I need it to stand out.
  3. Changed the blockquotes style so that the double-quote image is not displayed and a border is displayed on the left.  This also required the text padding to be reduced.
  4. Adding an a:visited style so that visited and unvisited links will show up differently.  Visited links are displayed without any border on the bottom, while unvisited links are displayed with a dashed line on the bottom.
  5. Removed img tag style so that the border and extra padding would no longer be added for images.  This allows smiley images to be displayed with less extra space around them and allows the text to flow better.
  6. Added some table styles to mimic Microsoft Word 7.  See styll.css for details.  (v1.1.drp.1 - 10/2/2007)
  7. Added a table cell style so that text is padded from cell borders.  (v1.1.drp.1 - 10/2/2007)
  8. Added code and example formatting so that they stand out more.  Code and examples can be indented and shaded with a border surrounding them with the use of a simple div tag.  Use id=”code” and id=”example”.  See style.css for details.  (v1.1.drp.1 - 10/2/2007)
  9. Added a td style to vertically align data in tables at the top of cells.  (v1.1.drp.1 - 10/2/2007)
  10. Added a separate style for ordered lists so that the numbers for double-digit list items will be fully displayed.  (v1.2.drp.1 - 10/30/2007)
Sidebar ‘About’ Section Changes
  1. Allow any category that doesn’t have links or has posts to be selected as the Asides category.  This allows you to create the category and then immediately configure the theme to use that category before you’ve written any posts that use it.
  2. Added support for specifying a profile (aka user) to be used in the ‘About Me’ section so that clicking in that section will take the visitor to a page with info from your profile along with a list of posts.
  3. Display the first and last name from the specified profile in the About Me section.
  4. Allow profile info to be specified which would be displayed under the name in the About Me section.  You can also specify a keyword:
    1. [AboutYourself] - Will display the About Yourself text from the profile (requires a profile to be specified).
    2. [Tagline] - Will display the web sites tagline.
  5. Allow the picture displayed in the About Me section to be specified in the UI.  A drop-down will be filled with each image that has been uploaded to the site.
Intro Section Changes
  1. Moved the intro text to the database.  (v1.2.drp.1 - 10/30/2007)
  2. Allow the intro text to be edited online without having to touch any files.  This has the added benefit that files can be copied to other blogs or can be shared without content going with it.  All content is stored in the database.  (v1.2.drp.1 - 10/30/2007)
  3. Allow the intro section to be displayed on every page.  (v1.2.drp.1 - 10/30/2007)
Plugin Support
  1. Added support for the WP-Email plugin from Lester ‘GaMerZ’ Chan.
  2. Added support for the WP-Print plugin from Lester ‘GaMerZ’ Chan.
  3. Added support for the WP-PostViews plugin from Lester ‘GaMerZ’ Chan.
  4. Added support for the WP-PostNav plugin from Lester ‘GaMerZ’ Chan.  (v1.1.drp.1 - 10/2/2007)
  5. Added support for the cross-references plugin from Francesc Hervada-Sala.  (v1.2.drp.1 - 10/30/2007)
  6. Fixed support for the WP-Email plugin.  (v1.2.drp.2 - 10/31/2007)
Miscellaneous Changes
  1. Minor grammatical fixes to the 404 page.
  2. Added the WordPress version to the footer.
  3. Added controls to the theme page to allow the sidebar to be displayed either at the top with the sidebar underneath (the default) or to the left with the sidebar on the right.
  4. Added navigation to the previous and next post to the top of single posts (like in the default theme).  (v1.1.drp.1 - 10/2/2007)
  5. Formatted boxes evenly on the admin page.  (v1.2.drp.1 - 10/30/2007)
  6. Display the comment number instead of the pound sign (#).  (v1.2.drp.1 - 10/30/2007)
  7. Integrated Sadish’s changes for WordPress 2.3 compatibility.  (v1.2.drp.1 - 10/30/2007)
Still Investigating/Working On

Problems I’m still working on:

  1. Gravatars in comments extend below the bottom of the comment shading in some cases.

Features I’m still working on:

  1. Include links in the profile info which can link to an About page.
  2. Include the About page on the author page for the primary profile.
  3. Use the nicetitle feature from the Scattered 1.5 theme to display popup titles.
  4. Allow blog admin to enable the WP-Email, WP-Print, and WP-PostViews plugins selectively.
Resources

Note that I only tested this with IE7 against WordPress 2.2.3 and 2.3.1 and PHP 5.2.4.

Leave a Comment

FallSeason - WordPress Theme Review

This is a very attractive theme, one I will likely switch one or more of my blogs to.  The author did a very nice job with the banner image - it looks like it expands naturally with a very well blended break.

EDIT:  As of today (9/20), I’m currently using an incarnation of the FallSeason theme on this site.  Stay tuned for an article on what I’ve changed.

Overall Grade: A
Theme URI: http://wpthemepark.com/themes/fallseason/
Version: 1.1
Description: Zenlike by nodethirtythree , FallSeason WordPress Theme by WP ThemePark
Author: Sadish
Author URI: http://wpthempark.com/
Widget-aware: Yes
Shows tagline: Yes
Shows counts: Yes
Hierarchical categories: Yes
Forum: http://forums.wpthemes.info/
Things I like:
  • Very clean look.
  • Post headers have a box next to them to show where a post begins.
  • Comments are supported on pages when enabled.
  • Comments are displayed distinctly with alternating color.
  • Category counts are displayed by default.
  • Lists are displayed with markers properly.
  • Blogroll links in subcategories are displayed in a separate list (although I don’t like how it is done - see below).
  • Links to pages are displayed at the top.
  • Blockquotes are displayed in a different color (although not shaded) and with a thick vertical border on the left.
  • Outstanding photo banner that grows as the page width is increased.  It is very difficult to see where the edge of the image actually is.
  • Nice RSS section on the sidebar when no widgets are added.  It displays the RSS icon next to each entry in the section.
  • Author with link is displayed for each post and a nice author page is displayed when the visitor clicks on the link.  Beware, however, that you properly fill in the profile info for each user.
Problems:
  • Number in front of comment header is pound sign (#) instead of number.
  • The Asides drop-down doesn’t include categories without posts.  This means you have to create the first aside before you can select that category.  This took me a little bit to figure out.  I just figured that asides were broken.
    • I fixed this by replacing this text in functions.php:
      SELECT  * from $wpdb->categories WHERE category_count > 0
      with this:
      SELECT * from $wpdb->categories WHERE category(_count <> 0) OR (link_count = 0)
  • RSS widget has both a title box and an RSS icon to the left of the title.
Things I don’t like:
  • Could use better separation between posts.
  • Comments aren’t distinguished from each other very well.  I would prefer alternating color shading or a border on the left of each.
  • Blogroll entries are displayed in a single box titled Links with categories in a larger font.  I would prefer to see each set of links in its own box with the category as the title (i.e. with no Links title).
    • I fixed this by adding a style for the h2 tag in the sidebar.
  • Blockquotes are displayed with a double-quote image at the left and then simply indented.  I would prefer to see a border or, even better, shading.
    • I fixed this by modifying the style for blockquote to not refer to the image to to display a border on the left.
  • No distinction between visited and unvisited links.
    • I fixed this by adding an a:visited section the css file to show no bottom border on visited links.
  • Images are displayed with a 3px margin and a border, which causes things like smilies to be displayed with a border and to take up too much space in the text when using the Smilies Themer plugin.
    • This was very easy to fix.  I commented out the img style and added the contents of that style to the other 3 img styles (img.left, img.right, and img.profile).
  • You lose the nice RSS section on the sidebar when using widgets.
Wishlist:
  • Highlight author comments so they stand out from the rest.
  • Option to select image shown in the About section on the sidebar.
    • I added this feature.
  • Use the nicetitle feature from the scattered 1.5 theme to display popup titles.

Leave a Comment

Converting wildcard to regular expression

I needed to build wildcard support into a C# app I am building.  The user needs to be able to enter a string with wildcards that represent SQL table names.  It’s pretty handy that the .NET Framework includes a regular expression parser in the System.Text.RegularExpressions namespace.  However I couldn’t find a simple wildcard parser anywhere - you know, one that could handle the simple file system wildcards asterisk and question mark?  I searched high and low but nothing turned up in my searches.

I’ve used regular expressions on occasion, so I needed to do a little bit of research to learn how to use them.  I found a pretty nice article up on CodeProject that provides a nice introduction - Chapter 3 from the book Microsoft Visual C# .NET 2003 Developer’s Cookbook called Strings and Regular Expressions.  Based on that I implemented an iterative solution.

The routine I wrote simply loops through the source string and processes each character.  If it is a character that can be part of a regular expression, it escapes it with the backslash.  If it is an asterisk, it replaces it with this string: “[\d\D]*”.  This string says to include 0 or more instances of a digit or non-digit character.  If it is a question mark it replaces it with a period:  “.”, which says to allow 0 or 1 instance of a single character.  As you can see, I am quite inexperienced with regular expressions, but this solution works great.  I had to add a caret (“^”) at the beginning and a dollar sign (“$”) at the end so that it wouldn’t match any extra characters at the ends of the string.

I wasn’t completely happy with this solution, but it worked and it was time to move on.  I decided to write about it and it’s a good thing I did.  As I was looking for the above-mentioned article again, I found a solution on CodeProject that exactly matches my needs.  It defines a class derived from the Regex class called Wildcard.  It also implements a static method to do the actual conversion work.

Here’s what I learned from this article:

  1. I was having trouble simplifying the replacement for the asterisk.  I tried [.]* but it just wouldn’t work and I didn’t know why, so I just reverted back to [\d\D]*.  The Wildcard class uses simply .* (dot asterisk).  Apparently you can only use square brackets if you have more than one character you want to modify with the asterisk.
  2. The Regex class provides a whole heck of a lot of functionality that I implemented myself.  The Wildcard class - and the WildcardToRegex method in particular - is dirt simple compared to my original take on the problem.
  3. I’m not completely stupid :-) - while this solution is a whole lot simpler, I was doing everything in my solution that it does.
  4. I need to improve my search skills :-?

Leave a Comment

WP-Email - WordPress Plugin Review

Sometimes it’s handy to be able to just send the contents of a page that you’re viewing to your inbox or to someone else you think might be interested. This plugin allows a visitor to send a post or page or just a snippet (the blog owner’s choice) from an email address of their choice to an email address of their choice. The plugin has a plethora of options allowing you to specify how much of pages and posts should be sent, how the email forms should be displayed, how the email message is formatted, and more.

Lester Chan, aka GaMerZ, has produced quite a few plugins and he has a single page from which you can download all of them. He’s also provided a documentation page for each of his plugins as well as a forum. Bravo!

Overall Grade: A
Plugin Name: WP-Email
Version: 2.11
Plugin URI: http://www.lesterchan.net/porfolio/programming.php
WordPress Plugin Page: http://wordpress.org/extend/plugins/wp-email/
Description: Allows people to recommend/send your WordPress blog’s post/page to a friend.
Author: Lester ‘GaMerZ’ Chan
Author URI: http://www.lesterchan.net/
Documentation: http://lesterchan.net/wordpress/readme/wp-email.html
Forum: http://forums.lesterchan.net/index.php?board=13.0/
Installation

Installation of the plugin itself is fairly simple.  Just copy the plugin to a folder called email and then activate it, then go to your wp-admin page and navigate to Options -> Permalinks and update your permalink structure.

However, in order to actually use the plugin without errors, you also need to make sure your PHP installation has a few extra extensions installed.  I installed the following extensions:

  • GD2 for generating a graphic image for the image verification feature.
  • IMAP, POP3, and SMTP to actually send email.  I probably only needed SMTP, but I went ahead and installed all three.
Administration

As I mentioned, there are a plethora of options available to manage this plugin.  It adds an extra top-level tab called E-Mail which contains two sub-tabs - Manage E-Mail and E-Mail Options.

The Manage E-Mail tab allows you to view a log of all the attempts to send email with a variety of sorting options.

The E-Mail Options tab is where the meat of administration occurs.  On this tab you can set the following options:

  • SMTP Settings
    Here you set the username, password, and server name for sending email via SMTP.  I think these settings are only used if method used is set to SMTP, but I didn’t try the others.
  • E-Mail Styles
    • What text to display on a page or post.
    • Whether to display text only, icon only, both text and icon, or custom display (very flexible).
    • Which icon to display (out of two).
    • Whether to present the email form in the same browser window or as a popup.
  • E-Mail Settings
    • Which fields to include in the email (it’s not clear but this might apply only to emails that only include an excerpt).
    • What type of content to include in the email (HTML or plain text)
    • Method to use to send email (PHP, SendMail, or SMTP).
    • Number of words to include.  If you specify 0, the whole page or post is included.  Anything else allows the visitor to send only an excerpt of the page or post.
    • Interval between emails.  This is a spam-prevention feature which allows you to specify how many minutes the visitor (based on IP address) must wait before sending another email.
    • Maximum number of multiple emails.  This specifies the maximum number of addresses the email can be sent to.
    • Enable image verification.  This is another spam-prevention feature requiring the visitor to type in the sequence of characters displayed in a little graphic image.  It is highly recommended that you enable this feature.  If this is enabled, the GD2 PHP extension must be installed.
  • Templates
    • E-Mail Page Templates - A series of templates for generating the email form for the visitor to fill out to send the email.
    • E-Mail Templates - A series of templates for generating the actual email to send.
    • After Sending E-Mail Templates - A series of templates for generating success and failure pages.
    • E-Mail Misc Templates - A template for generating a page for when general errors occur.
Usage

This plugin requires modifying your theme as it modifies the part of the web page that is theme specific. In any page that does this:

<?php while (have_posts()) : the_post(); ?>

add this somewhere below it:

<?php if(function_exists('email_link')) { email_link(); } ?>

This will place the text/icon (as specified in the options) at that place on the web page.  You can also simply type email_link between square brackets (’[' and ']‘) anywhere in a post or page and the configured text/icon will be displayed there - I can’t actually show you as it will get replaced on this page with the configured text if I do :-? .

The plugin also provides some statistical functions to display email totals.

Conclusion

This is a fairly complex plugin, but also quite useful once you get it configured.  I plan on installing this on all my WordPress sites.

Comments (1)

WP-Print - WordPress Plugin Review

Most blogs have so much stuff around the main body of information that you end up using up a lot more pages when you print a particular post or page. This plugin displays the post or page with all its text and formatting, a listing of all the links, a link to actually print the page, and nothing else.

Lester Chan, aka GaMerZ, has produced quite a few plugins and he has a single page from which you can download all of them. He’s also provided a documentation page for each of his plugins as well as a forum. Bravo!

Overall Grade: A
Plugin Name: WP-Print
Version: 2.11
Plugin URI: http://www.lesterchan.net/porfolio/programming.php
WordPress Plugin Page: http://wordpress.org/extend/plugins/wp-print/
Description: Displays a printable version of your WordPress blog’s post/page.
Author: Lester ‘GaMerZ’ Chan
Author URI: http://lesterchan.net/
Documentation: http://lesterchan.net/wordpress/readme/wp-print.html
Forum: http://forums.lesterchan.net/index.php?board=18.0/
Installation

To install this plugin, copy it to a folder called print, activate it, then go to your wp-admin page and navigate to Options -> Permalinks and update your permalink structure.

Administration

A Print tab is added to the Options page to allow you to manage the plugin.  The following options can be set:

  • Text that is displayed on posts.  Defaults to Print This Post.
  • Text that is displayed on pages.  Defaults to Print This Page.
  • Whether to display text only, icon only, both text and icon, or custom display.
  • Which icon (choice of two different ones) to display.
  • Wheter to include comments, links, and images in the resulting web page to be printed.
Usage

This plugin requires modifying your theme as it modifies the part of the web page that is theme specific. In any page that does this:

<?php while (have_posts()) : the_post(); ?>

add this below it:

<?php if(function_exists('print_link')) { print_link(); } ?>

This will place the specified text/icon at that place on the web page.  You can also simply type print_link between square brackets (’[' and ']‘) anywhere in a post or page and the configured text/icon will be displayed there - I can’t actually show you as it will get replaced on this page with the configured text if I do :-? .

Conclusion

This is a terrific plugin. I plan on installing this on all my WordPress sites.

Comments (3)

WP-PostViews - WordPress Plugin Review

It’s always nice to see how popular a post is when you’re visiting a blog. Maybe it’s my vanity, but especially like to see it on my own posts. This plugin makes it easy to add an indicator on a page or with a post to tell you how many non-registered members have viewed the post or page.

Lester Chan, aka GaMerZ, has produced quite a few plugins and he has a single page from which you can download all of them. He’s also provided a documentation page for each of his plugins as well as a forum. Bravo!

Overall Grade: A
Plugin Name: WP-PostViews
Version: 1.11
Plugin URI http://www.lesterchan.net/porfolio/programming.php
WordPress Plugin Page: http://wordpress.org/extend/plugins/wp-postviews/
Description: Enables you to display how many times a post/page had been viewed.  It will not count registered member views, but that can be changed easily.
Author: Lester ‘GaMerZ’ Chan
Author URI: http://lesterchan.net/
Documentation: http://lesterchan.net/wordpress/readme/wp-postviews.html
Forum: http://forums.lesterchan.net/index.php?board=16.0/
Installation

Installation is very simple.  Just copy the plugin to a folder called postviews and then activate it.

Usage

This plugin requires modifying your theme as it modifies the part of the web page that is theme specific.  In any page that does this:

<?php while (have_posts()) : the_post(); ?>

add this below it:

<?php if(function_exists('the_views')) { the_views(); } ?>

This will place text that looks like this at that place on the web page:

3 Views

To change the text, pass a string to the call to the_views, e.g.

the_views('readers')

The plugin also provides a couple functions to display the most viewed posts or pages.  Just for fun I added the following code to my test sidebar to display the first 20 characters of the top three posts on my blog and it looked pretty cool.

<?php if (function_exists('get_most_viewed')) { ?>
<li><h2>Most Viewed Posts</h2>
  <ul>
  <?php get_most_viewed('post', 3, 20); ?>
  </ul>
</li>
<?php } ?>

Room For Improvement

As simple as it is, there some things that could make this plugin more useful, and they all apply to the extra functions to display the most viewed posts or pages.

  • Provide a widget to display the most viewed posts or the most viewed posts in a category.
  • Allow the text displayed for # views on most viewed posts to be specified to the function.
  • Specify a title on the links so that title popups will be displayed when the user hovers the mouse over them.
  • Provide an admin page to display views for each post.  I’ve found that my blogs aren’t visited as often as I’d like and it just plain looks bad to see small numbers for the views.  This communicates that the posts aren’t very important and don’t need to be read - definitely not the impression I want to give :-)
Conclusion

This is a terrific plugin.  I plan on installing this on all my WordPress sites.

Comments (3)

Scattered w/ Widgets 1.5 - WordPress Theme Review

I really like this theme. I’ve been using it as my main theme for both my personal and technical blogs for most of the time I’ve been using WordPress (almost 2 weeks now :-) ). What really caught my eye right off was that title popups are displayed with transparency. It just looks cool! It isn’t really suitable for technical blogs, however, as it uses justified text alignment (although that is easily changed) and it is a little narrow.

Overall Grade: A
Theme Name: Scattered 1.5 with Widgets
Version: 1.5
Theme URI: http://dancameron.org/wordpress/scattered-theme/
WordPress Theme Page: http://themes.wordpress.net/columns/2-columns/524/scattered-10/ (for Scattered 1.0)
Description: Classic Scattered design. http://dancameron.org/wordpress/
Author: Dan Cameron
Author URI: http://dancameron.org/
Widget-aware: Yes
Shows tagline: Yes
Shows counts: Yes
Hierarchical categories: Yes
Things I like:
  • Very clean look.
  • Excellent contrast.
  • Post headers are large enough that they provide good separation between posts.
  • Comments are displayed distinctly with alternating color.
  • Category counts are displayed by default (although archive counts are not).
  • Lists are displayed with markers properly.
  • Blogroll links in subcategories are displayed in a separate list.
  • Links to pages are displayed at the top.
  • Blockquotes are displayed in a different color (although not shaded) and with a thick vertical border on the left.
  • There is a photo at the top that gives the impression of expansiveness (taken by Dan’s wife, Sara Cameron).
  • Title popups are displayed with transparency.  Very cool!
Problems:
  • Comments are not displayed on pages even if that option is enabled for a page.
  • Visited links are too light.
  • Visited links when viewing a post or a page are completely invisible.
  • The title popup produces an error on images.
Things I don’t like:
  • Unordered lists are not indented enough, so the item markers end up in the margin.
    • I was able to fix this easily.
  • Unordered and ordered lists are indented differently.
    • I can fix this, but it may not be that big of a deal.
  • All text is displayed with justified text alignment, including text enclosed in <code></code> tags.  This is good (even looks nice) for non-technical information but not for technical information
  • The main display area is a little narrow, especially for technical information (e.g. code).
  • Sidebar is not always displayed.
Wishlist:
  • Allow the page width to be specified larger, or even fluid.
  • Allow different sets of colors to be specified (although I really like the default color set)
  • Allow the top image to be selected (again, I really like the image, so I would want any choices that were offered to be as good as that one).

Leave a Comment

 Page 13 of 16  « First  ... « 11  12  13  14  15 » ...  Last »