Development Projects

WordPress Plugins

Categories

Blogroll

Buy Me a Beer

Have you found these plugins or this site useful? Programmers need fuel.
$

SmugPress - Documentation

Inserting a smugmug image

Inserting images is a snap using the post plugin button. Simply click the SmugMug picture button, , and fill out the form. The only required fields are Gallery, Image, and Size. This is an AJAX enabled for so javascript is required. Once you click insert a SmugMug QuickTag block will be inserted in the code and you will see the image selected in the post editor.

Currently the post plugin only supports public galleries and photos. This is because SmugMug has put a hold on issuing API keys so I have to use RSS feeds to get the information. Hopefully they will start issuing API Keys again soon! You can still insert private images, but you will need to manually include the QuickTag using the key field.

Picture QuickTag

QuickTags can either be inserted manually in post code or using the method listed above. Below is an example QuickTag block. The example lists all available fields, however, only Image and Size are required.

<!-- SmugMugPicture Gallery => 1 Image => 1 Key => 1 Size => Th Description => Align => Style => Width => Height => Link => No HSpace => VSpace => -->

QuickTag Fields

Gallery Gallery ID. This can be gleaned from the gallery URI, in the example below the gallery id is 4298051.
Image Image ID. This can be found in either the gallery or picture URI, in the example below the picture id is 251911845.
Key Image Key. This can be found in the photo URI, in the example below the key is VvyWs. This field is only required if you are viewing images from an unlisted gallery
Size This is the size of the image you would like to pull from smugmug. Valid options are Th, S, M, L, XL, X2, X3, and D. Th is the smallest moving all the way up to D which is the original image size.
Description This is an image description. This field sets the ALT and TITLE of the outputed image tag.
Align Set the image alignment, valid options are left, right, top, texttop, middle, absmiddle, baseline, bottom, and absbottom
Style Set the style attribute of the image tag. Any CSS style for an IMG tag is valid.
Width Set the display width of the image.
Height Set the display height of the image.
Link Should the generated image tag also link back to the referenced SmugMug gallery. If link is No or not set then the link will not be added.
HSpace Set the HSPACE attribute for the image.
VSpace Set the VSPACE attribute for the image.

Example URIs:

The gallery URL can be found by browsing to any of you SmugMug galleries. In this URL the SmugMug nickname is french, the gallery id is 4298051, the gallery key is DoMyq, and the image id is 251911845

http://french.smugmug.com/gallery/4298051_DoMyq#251911845

The photo URI is a little harder to find, but you only need it for unlisted galleries. Browse to a gallery and mouse over one of the images. The sidebar should popup with a Save Image link. That link is the Photo URI. All we need out of this link is the image key. In this example the image key is VvyWs.

http://french.smugmug.com/photos/251911845_VvyWs-D.jpg

Widget

Make sure you have set you smugmug nickname in the Smugpress options panel, then enable the widget through the Presentation -> Widget screen.

Widget Feed Type
Currently there are only two feed types, RSS Galleries and RSS.

RSS Galleries: Gets gallery information from SmugMug rss gallery feeds. The feed urls are dynamically generated using the nickname set in the admin option. If you use this option, using the widget option you can limit the images to only the X most recently updated galleries. If this option is left blank then all galleries are used.

RSS: Gets photo information from Atom or RSS feeds. Using this feed type you MUST specify one or more full feed urls using the widget option. The rss feed urls should be comma delimited.

Administration Options

There are a few options that need to be set in the Administration Panel. Go to Administration -> SmugPress.

SmugMug Nickname
The nickname used for your smugmug account. Note this may be different from the username you login to smugmug with. The nickname is the first part of the URL you use when visiting your gallery. In the URI examples above french was my smugmug nickname.

Add smugmug buttons
If this option is set then the Insert SmugMug Picture and Insert SmugMug Gallery will be added to the post editor.

Use Feed Cache
Should RSS feed information be cached in the database? This is a very good option to set because it should signifigantly improve performance. If this option is set then RSS feeds will be read, parsed, then the digested information will be stored in the database. Therefore to get a random image if the cache is still fresh all we have to do is query the database.

Cache Expiration
How long is the cache valid? The default is 3600, which is 1 hour. However, on my blog I have this set much higher, because I generally only update my galleries weekly. Then when I update the galleries I manually force a cache update.

Widget Gallery Type
Define what feed type to use for the sidebar. See the Widget section for definitions of the types.