May 14th, 2008 at 1:08 am by David Potter

NextGEN Gallery Review - Displaying Images - Album

Galleries can be organized into albums to present multiple groups of images to your visitors.

[ album=id,mode ]

id = the ID of the album (e.g. 1).

mode (extend or compact) = options for how tod display the gallery; extend displays each gallery in the album on its own row with its description; compact displays multiple galleries per row without descriptions.  This parameter is optional.

The album shortcode displays the galleries in an album on the page.  Galleries appear in the order in which they are placed on the album admin page.  There are two album views available.  In both views the image selected for the gallery on the gallery’s admin page is displayed.  If none is selected, no image is displayed.

Extended view

In the extended view (mode = extend), galleries are displayed on separate rows.  Each row consists of the title listed above, the gallery image selected on the admin page for the gallery, the description of the gallery specified on the admin page for the gallery, and the number of photos in the gallery.

[ album=#,extend ]

Salamanca, Spain

Photos taken by my daughter Bethany when she was in Salamanca, Spain on a study abroad program.

56 Photos

Compact view

In the compact view (mode = compact), multiple galleries are displayed on each row in the style of Flickr.  Each row consists of as many galleries as will fit.  Each gallery is displayed as a column with the gallery image on top, the gallery title in the middle, and the count of photos below that.

[ album=#,compact ]

Salamanca, Spain

56 Photos

Displaying Contents of a Gallery

To display the contents of a gallery, simply click on the gallery title or on the gallery image.  If the Deactivate gallery page link option on the Gallery options page is checked, the contents of the gallery will be displayed on the same page.

If the option is unchecked, make sure you have selected a page that displays the gallery (i.e. specifies the gallery shortcode with the ID of the gallery) or the page will simply refresh.

Wishlist / Caveats

  • It would be nice to have a default image displayed if no image is specified on the gallery’s admin page.
  • If the gallery is not associated with a page and the Deactivate gallery page link option on the Gallery options page is unchecked, the page refreshes and the contents of the gallery is not displayed.  It would be preferable to behave as if the checkbox is actually checked.
  • It would be nice if gallery parameters could be specified to albums.  You’ll notice on this page that when you click on the gallery in one album that both are expanded.
  • It would be nice if the number of galleries displayed horizontally could be specified when using compact mode rather than just relying on HTML formatting.

Resources

All images © 2008 Bethany Potter.  All rights reserved.

Related Posts
May 14th, 2008 at 12:50 am by David Potter

NextGEN Gallery Review - Displaying Images - ImageBrowser

The ImageBrowser viewer is a nice way to view one image at a time from a gallery and cycle through each one.

[ imagebrowser=id ]

id = the ID of the gallery (e.g. 1).

The imagebrowser shortcode displays images in a gallery one at a time in a large format.  You can move to another image in the gallery by clicking on the Back or Next links below the image.  Click on the image to view a larger version.  The Alt / Title text for each image is displayed above it and the picture number in the gallery is displayed between the Back and Next buttons.

Examples

[ imagebrowser=# ]

img_0617.jpg

Picture 1 from 56

Wishlist / Caveats

  • It would be nice if the size of the images could optionally be specified rather than just filling up the space.

Resources

All images © 2008 Bethany Potter.  All rights reserved.

Related Posts
May 14th, 2008 at 12:30 am by David Potter

NextGEN Gallery Review - Displaying Images - Gallery

To display all images in a single gallery, specify the gallery shortcode on a post or page.

[ gallery=id ]

id = the ID of the gallery (e.g. 1).

The gallery shortcode displays the thumbnails for the images in a single gallery on the post or page.  The following options can be configured on the Gallery options page:

  • Number of images per page.  The default is 20.  If 0 is specified all the images in the gallery will be displayed.
  • Whether a slideshow link is included.
  • Whether to show a description or the alternate title text with each image.
  • Whether to display the gallery using the ImageBrowser viewer instead.
    • Note that the ImageBrowser viewer can be specified explicitly so it is unnecessary to set that option.
  • How to sort images.

These options can also be specified as custom fields on the post or page.

  • ngg_gal_ShowOrder
    • gallery - Show the gallery first
    • slide - Show the slideshow first
  • ngg_gal_Images
    • 0-xxx - (integer) Number of images per page
  • ngg_gal_Sort
    • pid - Sort thumbnails by image ID
    • filename - Sort thumbnails by file name
    • alttext - Sort thumbnails by Alt / Title text
  • ngg_gal_SortDirection
    • ASC - Sort in ascending order
    • DESC - Sort in descending order
  • ngg_gal_ShowDescription
    • none - Don’t show a description
    • desc - Show the description text
    • alttext - Show the Alt / Title text
  • ngg_gal_ShowSlide
    • 0 - Don’t show a slideshow link
    • 1 - Show a slideshow link
  • ngg_gal_ImageBrowser
    • 0 - Show images directly
    • 1 - Show images using the ImageBrowser viewer

Examples

[ gallery=# ]

Wishlist / Caveats

  • It would be nice if the above options (e.g. number of images, whether to show a description, etc.) could be specified as parameters.
  • It would be nice if thumbnail size could be specified.

Resources

All images © 2008 Bethany Potter.  All rights reserved.

Related Posts
May 13th, 2008 at 11:43 pm by David Potter

NextGEN Gallery Review - Displaying Images - Singlepic

To display a single image from any gallery, specify the singlepic shortcode on a post or page.

[ singlepic=id,width,height,mode,float ]

id = the ID of the image (e.g. 1).

width, height = width and height in pixels to scale the image to.  These are maximums; the aspect ratio will be maintained.

mode (web20 or watermark) = options for displaying the image; web20 displays the image with a mirror-like effect with a reflection; watermark to add a watermark to the image.  This parameter is optional.

float (right, center, or left) = type of float CSS style to add to the image. This parameter is optional.

The singlepic shortcode displays a single picture from any gallery.  Clicking on the image displays the image as you have specified on the Effects options page.  With the default Thickbox effect, the background goes gray and a larger version of the image (if available) is displayed.

Examples

[ singlepic=#,400,300 ]

img_0782.jpg
Mode = web20

The web20 mode displays the image with a mirror-like effect with a reflection.

[ singlepic=#,400,300,web20 ]

img_0782.jpg
Mode = watermark

The watermark mode adds a text or image overlay on the image based on what you have specified on the Watermark options page.

[ singlepic=#,400,300,watermark ]

img_0782.jpg
Float

The float parameter indicates how to place the image with respect to the rest of the content around it.  It causes a float style to be added to the image HTML. Options include left, center, and right.

[ singlepic=#,300,300,,right ]

img_0782.jpg

This text is displayed to the left of the image.


Wishlist / Caveats

  • It would be nice if the width and height parameters were optional and the values were taken from the image in the gallery.  This wouldn’t be as useful for large images, but for smaller inline images this would be very useful.
  • It would be nice if the image could be displayed with no link so that a custom link could be specified instead.  For example, I would like to be able to display an image and have it link to another web page or web site rather than bring up the “full size” image.
  • It appears that the full-size image is downloaded to the visitor’s machine which is less than ideal.  I’d prefer to have the option to download the thumbnail and scale that instead.

Resources

All images © 2008 Bethany Potter.  All rights reserved.

Related Posts
May 13th, 2008 at 9:37 pm by David Potter

NextGEN Gallery Review - Displaying Images

Once you’ve created a gallery, added images to it, and added the gallery to an album, you’re ready to display them on your site.  Of course, you don’t have to go through all those steps just to display images as there are several ways to display them.

The plugin uses shortcodes - also known as keywords or tags - in pages and posts to display images.  NextGEN Gallery shortcodes are specified as a word enclosed in square brackets - [ and ] - followed by parameters describing what and how to display the images.  Note that the shortcodes are formatted differently than shortcodes in WordPress 2.5.

The documentation on Alex’s web site is pretty good, but there are a few things that aren’t described in full detail.  I’ll try to include the tidbits I’ve learned here, and the title for each section is also a link to Alex’s page on that particular shortcode.

These shortcodes are built in to the NextGEN Gallery plugin:

  • singlepic - Display a single image with options for displaying a reflection, a watermark, and for placing the image horizontally on the post/page.
  • gallery - Display the images in a gallery.
  • imagebrowser - Display the images in a gallery one at a time.
  • slideshow - Display the images in a gallery one at a time with automatic advance.
  • album - Display multiple galleries in a list.
  • tags - Display images which have been tagged with specific tag values.
  • albumtags - Display images in album format which have been tagged with specific tag values.

A number of others have provided additional shortcodes for viewing images.

  • polaroid - Display images from a gallery as a stack of polaroid images.
  • simpleviewer - Displays images from a gallery in a viewer from Airtight Interactive that shows thumbnails of the other images in the gallery below the image being displayed.
  • tiltviewer - Displays images from a gallery in a viewer from Airtight Interactive that displays thumbnails tilted allowing zooming and flipping.

You will find more details on each shortcode in a separate article for each one (coming soon).

Related Posts
March 29th, 2008 at 12:19 pm by David Potter

PowerShell Community Extensions

I’m working little-by-little towards using PowerShell as my primary command shell instead of cmd.exe.  I’m still a ways away, but PowerShell Community Extensions takes me a bit closer to my goal.  Here’s a description from their web site:

PowerShell Community Extensions (PSCX) is aimed at providing a widely useful set of additional cmdlets, providers, aliases, filters, functions and scripts for Windows PowerShell that members of the community have expressed interest in.

PSCX contains quite a collection of useful extensions, but the one extension that pushed me over the edge to install it was a cd history - a feature available on the mini-computer systems I used in the 80’s (VMS from DEC).  If you perform all your calls to Set-Location through PSCX’s cd function, you can go backward and forward between all the locations you visited.

There is a lot to learn in PSCX, so I’ll try to write about the various features over time.

March 7th, 2008 at 6:05 pm by David Potter

Easy Gravatars version 1.2.1

Dougal Campbell upgraded his Easy Gravatars plugin to version 1.2 to use the new get_avatars function in WordPress 2.5.  He hasn’t integrated my changes into his plugin so I’m releasing mine as a dot-release of his.

My changes to his v1.2 release are the same as my changes to his previous releases:

  • Improved admin page layout with verbose descriptions of the options.
  • Added an option to display a border around the image.
  • Don’t include styles or attributes to specify the width.  Without this change, if the comment author doesn’t have a gravatar, the default image is blank, and a border width greater than 0 will cause an empty box to be displayed.

My blogs have now been updated to use this version.

Resources

Related Posts
March 6th, 2008 at 4:38 am by David Potter

Steps to add a domain to Exchange

I host several domains on my server, including dpotter.net.  Recently I added another domain for a friend who is starting her own business.  I thought I remembered all the steps to provide both web site service and email service, but there was one I missed that I don’t remember being a requirement before.

For background, I’m running Microsoft Small Business Server 2003 with IIS 6 and Exchange Server 2003.  My box is also a domain controller, a DHCP server, a DNS server, an RRAS server, and a few other servers to boot.

First let me describe what I ran into and then I’ll list the steps I use to add a domain.  I added the domain so that Exchange could recognize it, added a user with a mailbox for my friend, and set up my spam filter (Exchange Hosted Services, aka Frontbridge) to allow traffic to the new domain to pass through it successfully.  However, whenever I tried to send email to the new user from an outside mailbox, I would get the following non-delivery report:

Unable to relay for (in reply to RCPT TO command)

After much hair-pulling and Internet searching, I ran across an article titled Multiple Email Domains on Exchange 2K3 - Relay Access Denied by James Montgomery.  It spelled out the extra step I had to take - update the IIS Metabase.  Huh?  I’d never had to do that before.  But it worked, so I’m a happy camper again.

Note that to modify the IIS Metabase you’ll have to download and install the IIS 6 Resource Kit.

Adding a domain
  1. Add the domain to Active Directory as a UPN suffix.  This will allow you to add users that can log in using the new domain.
    1. Run the Active Directory Domains and Trusts management tool from Administrative Tools (domain.msc).
    2. View properties of the root node in the console (titled Active Directory Domains and Trusts).
    3. Add the new domain and click the Add button.
  2. Add a new domain to the set of Internet message formats in Exchange System Manager.
    1. Run the Exchange System Manager tool from Administrative Tools.
    2. Open Global Settings.
    3. Right-click on Internet Message Formats, click New, then click Domain.
    4. Type the name of the domain in both the Name and SMTP domain fields.
    5. Click OK.
  3. Add a recipient policy for the new domain.
    1. Run the Exchange System Manager tool from Administrative Tools.
    2. Open Recipients.
    3. Right-click on Recipient Policies, click New, then click Recipient Policy.
    4. Select E-Mail Addresses and click OK.
    5. Type the name of the new domain in the Name field.
    6. Switch to the E-Mail Addresses (Policy) tab.
    7. Create a new smtp policy for the new domain.
      1. Click New and select SMTP Address.
      2. Type the name of the new domain with an at-sign before it (e.g. @mydomain.com) and click OK.
  4. Add the domain to the IIS Metabase.
    1. You may want to perform a backup of your metabase before proceeding.
    2. Open MBExplorer from the IIS 5 Resource Kit.
    3. Navigate to LM\SmtpSvc\1\Domain\.
    4. If the new domain is not in the list (which is probably will not be), add a key for the new domain.
      1. Right-click one of the other domains and click Copy.
      2. Right-click Domain and click Paste.
      3. Select Copy to a new key.
      4. Type the new domain name and click OK.
    5. Run the iisreset tool to reset IIS (click Start » Run, type iisreset, and press Enter).

Now you can create users that use the new domain in Active Directory Users and Computers and you can create web sites that use the new domain in IIS Manager.

March 5th, 2008 at 9:59 pm by David Potter

Configuring SQL Server after a rename

I’m in the process of moving to a two-machine development environment so my SQL Server processing will occur on one machine and my application will run on another machine.  I’m making this change since I’ve found that a single machine with 4GB can’t handle both processing 4 million records AND running an application that processes those 4 million records.

Anyway, this article isn’t about that.  It’s about how to configure SQL Server when you have to rename a machine.  I received my new machine which I made my development machine and moved my previous development machine over to be my database server.  The thought didn’t even cross my mind that I might need to do something special with SQL Server.  I already have a procedure that I know works every time for renaming a domain-joined machine:

  1. Leave the domain (aka join a workgroup).
  2. Rename the machine.
  3. Re-join the machine.

For the most part the machine seemed to do really well after performing those steps.  However, once I finally got my new development machine configured and attempted to connect to SQL Server, the real trouble began.

It turns out there that SQL Server doesn’t like it when you change the name of the machine.  I’ve run into this with other server software (e.g. Server Clusters, aka Wolfpack) so it’s not too surprising.  I found some articles on the Internet that seemed to claim that you can recover a SQL Server installation in this state (see Renaming a SQL Server by Brian Knight, written on 4/11/2001) but those steps didn’t work for me.  The article basically says to run the installation procedure to repair it, reboot, then run a couple stored procedures to change permissions (or something like that).  As I read through the article again to write this one, it appears that those steps are only necessary for SQL Server 7.0; I’m running SQL Server 2005!  Oh well.  What I found is that the repair option found some errors with ASP.NET.  Further trials revealed that I was unable to fix them by uninstalling and reinstalling IIS as simply uninstalling IIS 7 failed.

Fine.  I’ll do it the hard way.  I uninstalled SQL Server and reinstalled.  After a few reboots, ignoring warnings about SQL Server not working on Vista, and installing SP2, I finally got it up and running.

But my development machine still couldn’t connect to my database server.  Ugh!

sql-server-connection-error.jpg

Here’s the trick.  You have to enable remote access to the server.  I found a great article called SQL Server 2005 Remote Connectivity Issue TroubleShoot by Ming Lu on the SQL Server Protocols team at Microsoft.  Here’s how you do it.

Server Side
  1. Enable remote named pipes and/or TCP/IP.  This is done by running the SQL Server Surface Area Configuration tool which you can find under Microsoft SQL Server 2005 » Configuration Tools.  Click the Surface Area Configuration for Services and Connections link near the bottom of the window and you will be presented with another window where you can specify which services run, whether to start them automatically or not, and whether to support local connections only or local and remote connections.  While you’re here, set the SQL Server Browser service to start automatically.
    sql-server-surface-area-configuration.jpg
  2. Restart the SQL server instance.
  3. If you enabled TCP/IP:
    1. Find the port SQL Server is listening on.  To do this, go to the Application event log and find a 26022 event that looks like this:

      Server is listening on [ 'any' <ipv4> 1433].

    2. Verify the server is listening on the correct port (1433 in my case).  Do this by running the following command in a command prompt window:

      netstat -ano | findstr 1433

  4. Make sure the SQL Server Browser service (aka SQLBrowser) is running.
  5. Firewall configuration:
    1. Enable File and Printer Sharing in the Firewall exception list.
    2. Either add the TCP port or sqlserver.exe (e.g. C:\Program Files\Microsoft SQL Server\MSSQL.1\Binn\sqlserver.exe) to the exception list in the firewall.
    3. Either add the TCP port 1434 or the SQL Browser service (e.g. C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe) to the firewall exception list.  Note that if you are running on a 64-bit platform this image is located below the Program Files (x86) folder.
Client Side

The article gives some steps to perform on the client side, although once I performed the server-side steps my problem was steps.  I’ll reproduce the steps here in case they are useful to someone.

  1. Verify your connection to the server (call it MYSERVER.
    1. Verify the client gets the correct IP address:

      ping MYSERVER

    2. Verify the connection on the port the SQL Server instance is listening on:

      telnet MYSERVER 1433

    3. Verify the client can access file shares on the server:

      \\MYSERVER

  2. Verify the SQL Native Client is configured to use the same protocols the server is listening on.
    1. Go to SQL Server Configuration Manager » SQL Native Client Configuration » Client Protocols.
    2. Make sure named pipes and/or TCP/IP are enabled to match the server.  It is recommended that you set TCP/IP above named pipes.
      sql-server-configuration-manager-client-protocols.jpg
  3. If you are using MDAC (Drive={SQL Server} or SQLOLEDB.x) in your client application, you will want to run the cliconfg.exe program to enable TCP/IP and named pipes and to set the order so that TCP/IP is above named pipes.
    sql-server-client-network-utility-general.jpg
  4. Use sqlcmd.exe to see whether connections work.

    sqlcmd -S MYSERVER -E

Hopefully my experiences will be helpful to others that run into this problem.  All this seems to be a lot more complicated than it should be - both renaming servers and enabling remote support.  Hopefully SQL Server 2008 will address these issues.

March 4th, 2008 at 5:08 am by David Potter

NextGEN Gallery Review - Image Management

Image management is perhaps one of the strongest features of the NextGEN Gallery plugin compared with other image plugins, although until you learn a few concepts it can be a little difficult to use.

Definitions
  • Gallery - A collection of images.  Think of a gallery as a collection of images that are related, e.g. vacation photos or photos taken on a particular day.
  • Album - A collection of galleries.  An album is a good way to present multiple collections of related images together, such as photos taken on different days of your vacation.

Once you get these concepts straight, the user interface will fall into place.

Add Gallery

The first thing you will want to do is upload some images.  Before you can do that, you have to create a gallery.  You do that on the Add Gallery page.  Galleries are created below the path specified on the General Options page, typically wp-content/gallery/.  Creating a gallery actually creates a new folder on the server to store the images.

Choose the name of your gallery very carefully as once it’s been created it is very difficult to change it.  You’ll have to rename the folder on the server’s disk and then modify the gallery record in the database - not for the faint of heart.  I’d like to see the plugin modified to support this feature from the admin UI.

Adding Images

Once you’ve created a gallery you can add images to it.  There are four different ways to add images to a gallery, two by uploading them and two by copying them to a location accessible by WordPress and then scanning the directory.

Note that when uploading images, check that the php.ini file for your sever sets the maximum file upload size high enough.  Alex (the author of the plugin) recommends at least 16MB.  I set mine to 20MB.

  1. Upload images one or more at a time.  This is done from the Upload Images tab on the Add Gallery page.  (It seems like there should be a separate page for uploading images rather than on the Add Gallery page.)  From this page you can select which gallery and also whether to add metadata stored in images to the alt/title text field of each image.  With the latest versions of the plugin, you can select multiple files to upload and see progress of each image as it is being uploaded.  This is a huge improvement over previous versions which could even timeout if it took took long to upload.
  2. Upload a zip file of images.  This is done from the Upload a Zip-File tab on the Add Gallery page.  This can be useful when the link to your site is slow.
  3. Import a folder already on your web site.  This is done from the Import image folder tab on the Add Gallery page.
  4. Import images already in your gallery folder.  This is similar to the previous method but the images are already in the gallery folder.  To do this:
    1. Go to the Manage Gallery page.
    2. Click on the Edit link for your gallery.
    3. Click the Scan Folder for New Images button.
Managing Images

Once you get images into a gallery, you can perform a number of different operations on them.  Probably the first thing you’ll want to do is to annotate them.  While you’re at it you may as well add a description to your gallery.

The Manage Gallery page provides a lot of flexibility and allows you to make a lot of changes at once.  One thing you’ll want to be careful of, however, is to avoid doing to many operations that take a lot of time, such as regenerating thumbnails.  Doing so can cause the operation to timeout.

Here is a summary of the operations that can be performed on images on the Manage Gallery page.

  • Specify a description for each image.  This text can be displayed under thumbnails as well as in slideshows.
  • Specify alternate title text for each image.  This text can be displayed under thumbnails as well as in slideshows.
  • Exclude images from being displayed on gallery pages.
  • Specify tags for images.  Specifying a tag allows it to be displayed as a related image for posts that use the same value for its category or tag.
  • Delete an image.  The image file itself will only be deleted if the Delete image files option is enabled on the General Options page.
  • Set a watermark on selected images.
  • Generate (create) new thumbnails for selected images.  This is especially useful when you change the thumbnail options.
  • Resize images.  This is useful when you set resize parameters on the Images option page.
    • It would be nice if resize parameters could be specified at the time that images are resized or as part of the gallery rather than in one place for all images.
  • Import metadata (e.g. EXIF, IPTC, or XMP data) from images and set it in the alternate title text field.
  • Scan the folder for new images as described above.

Here is a summary of the operations that can be performed on the gallery on the Manage Gallery page.

  • Edit the name and description of the gallery.
  • Edit the path (although this only changes the path, it doesn’t rename it).
  • Link the gallery to a page which can be displayed when the gallery is clicked on when viewing an album.  I mistakenly linked the gallery to the page displaying the album.  The correct thing to do is to link it to a different page than the page displaying the album.
    • Note that this page is only used if the Deactivate gallery page link checkbox is unchecked on the Gallery Options page.
    • In order to display the contents of the gallery on the page you specify, you need to specify a [gallery] shortcode, like this:
      [gallery=#] where # is the ID of the gallery.
  • Specify a preview image that will be displayed when albums to which the gallery belongs are displayed.  By default no image is displayed.  You can select one of the images in the gallery.
  • Create a new page for displaying the gallery.
  • Delete the gallery.
Albums

An album is a nice way to display a list of galleries.  To create an album

  1. Go to the Album page.
  2. Type the name of your new album.
  3. Click the Update button.

Note that there isn’t any way to rename an album through the UI once you’ve created one, which is unfortunate, although I haven’t seen any place where the name of the album is actually displayed.

Once you’ve created an album, you can drag galleries from the Select Gallery box to the Album Page box.  The UI also allows you to rearrange galleries in the album by dragging and dropping.  This is a very nice interface and easy to use once you figure out that you can drag and drop.  Yes, there is some text describing that, but every time I teach someone how to use it I end up having to show them how to use this page.

Related Posts