Shashin – a WordPress plugin for displaying photos and videos from Picasa, YouTube, and Twitpic

I am currently no longer developing or supporting my WordPress plugins. I may resume development and support in the future, but I’m not sure when.

Shashin has many features for displaying photos and videos from Picasa, Youtube, and Twitpic in your WordPress posts and pages:

  • Show a gallery of all your albums, photos, and videos, with multiple options for organizing them
  • Use the Media Manager to easily create and add galleries to your posts
  • Show your photos and vidoes with your favorite image viewer. PrettyPhoto is included with Shashin, or you can use a different viewer of your choice (Fancybox 1.3.4 is also included, but I will probably remove it soon since the newer version of Fancybox does not have a license that is compatible with WordPress )
  • Pick individual photos or videos to display, in any size, including captions and EXIF data
  • Pick photos and videos from any combination of Picasa, Youtube, and Twitpic to display in groups of thumbnails
  • Show thumbnails of your newest photos and videos, from one or more albums
  • Display album thumbnails for albums you choose, or all your albums, sorted however you like. Includes links to Google Maps (for Picasa albums with location data)
  • Display any number of random photos and videos. You can also choose to exclude certain photos or albums from random display
  • Use a widget to display Shashin photos in your sidebar
  • Customize the Shashin stylesheet to suit the theme of your site.
  • Internationalization: Shashin supports translations into other languages (please contribute a translation if you’re bilingual!)
  • Schedule daily automatic synchronization of Shashin with your feeds from Picasa, Twitpic, and Youtube.

It is multi-site compatible.

Get Help

Enter a post in the support forum for Shashin, and I’ll respond there.

Give Help


See the Shashin 3 examples page to see for working examples that illustrate the many options available with Shashin shortcodes.

Usage Guide

Important note: This guide assumes you have already read the instructions in the readme for how to install Shashin and get started with adding photos and videos. That information is not repeated here.

Usage Guide

Terminology: albums, photos, and videos

In Shashin, an “album” contains photos and videos. This is the same terminology as Picasa. For consistency, Twitpic and YouTube feeds are referred to as albums in Shashin. For example, my personal Twitpic feed will show up in my Shashin Tools menu as an album titled “Twitpic: Michael Toppa.”

Synchronizing your photos and videos with Shashin

On the Shashin tools menu, you can manually synchronize with an album at any time. On the Shashin Settings Menu, you can select the option to have Shashin automatically synchronize with all your feeds once per day. What it will do is synchronize 1/24th of your albums per hour, to minimize any performance impact on your site. Note that it is using the WordPress scheduling features, which do not provide precise timing.

For Picasa, note that synchronizing will not automatically pull in new albums to Shashin. It only synchronizes albums you’ve already added to Shashin. For new albums, you need to use the “Add Albums” form on the Shashin Tools Menu. This allows you to selectively control which of your Picasa albums are added to Shashin.

⇑ top

Using the Shashin Media Browser

If you want to add photos or album thumbnails to a page or post, then click the “Add Media” button, which is above the post editor’s button bar, to launch the WordPress media menu. In the media menu sidebar, you’ll see links for “Shashin Albums” and “Shashin Photos,” which you can use to easily add albums and photos to your post. This great feature was contributed by Sune Pedersen for Shashin 2, and I’ve upgraded it for use with Shashin 3.

Here are a couple usage tips:

  • If you mouse over a thumbnail on the left hand side, then the right hand side will show you a larger version of it, and vice versa. This makes good use of the available screen real estate.
  • To select a photo, just click it once. Don’t drag it. After you click it, you’ll see it appear under the “Selected Photos” heading. If you change your mind and need to remove a photo that you selected, just click it in the “Selected” area, and it will be removed.

⇑ top

The Shashin shortcode and attributes

Shashin places photos and albums in your posts by use of a shortcode. Please review the examples page to see how the shortcode works. Below is documentation for all the options available for each shortcode attribute.

Always use a Shashin tag on a line by itself in your post or page. This is important because of how WordPress auto-formats your posts. If you put a Shashin tag on the same line as other text, then it will get wrapped in the paragraph tag that WordPress adds to the line, resulting in invalid HTML (although in most cases browsers will still display it correctly).

Shashin’s most basic usage is:


You can add the following attributes to the shortcode to control what is shown, the size, and the layout.

⇑ top


Purpose: whether to show album thumbnails or photos

Supported values:

  • photo: shows photos or videos you specify, from any albums
  • album: shows album thumbnails, and then shows the photos in an album when clicked
  • albumphotos: shows all the photos in an album (without having to click the album thumbnail first)

Default value: photo


  • Shows photos with Shashin IDs 3, 7, and 9. You can get the ID numbers by viewing an album’s photos in the Shashin Tools menu. Or if you use the Shashin media browser to create the shortcode, you don’t need to know the ID numbers at all.
    [shashin type="photo" id="3,7,9"]
  • Shows a random selection of 4 photos in a 2×2 layout.
    [shashin type="photo" limit="4" order="random" columns="2"]

⇑ top


Purpose: the IDs of the thumbnails to show. If you use “photo” for the type attribute, it will assume photo IDs. If you use “album” or “albumphotos”, it will assume album IDs.

Supported values: any Shashin album or photo ID.

Default value: none


  • Shows photos with Shashin IDs 3, 7, and 9.
    [shashin type="photo" id="3,7,9"]
  • Shows albums with IDs 4,8,9,11 in a 2×2 layout.
    [shashin type="album" id="4,8,9,11" columns="2"]

⇑ top


Purpose: the thumbnail specified will be substituted for the photo or video identified in the ID attribute. This is most useful for videos where Picasa fails to generate a thumbnail (for some videos it will show just a solid black image for the thumbnail). This means you can substitute a different photo for the missing video thumbnail, but still show the video when the thumbnail is clicked.

Supported values: same as ID.

Default value: none


  • Shows the thumbnail for photo ID 6, but plays the video with ID 7 when the thumbnail is clicked.
    [shashin type="photo" id="7" thumbnail="6"]
  • Same as above, but for the 2nd photo shown, uses the same photo for the thumbnail and the expanded view.
    [shashin type="photo" id="7,11" thumbnail="6,11"]

⇑ top


Purpose: determines the size of the thumbnails shown.

Supported values:

  • Any of these size labels: xsmall, small, medium, large, xlarge, or max. If you use “max”, Shashin will pick the largest size supported by your theme (which you can manage on the Shashin Settings menu).
  • A numeric pixel value supported by the photo/video service:
    • Picasa: 32, 48, 64, 72, 94, 104, 110, 128, 144, 150, 160, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
    • Twitpic: 75, 150, 600, 1280
    • Youtube: 120, 480

    If the photo has a landscape orientation, this will be the width; if it has a portrait orientation, it will be the height.

  • Any numeric value: if you enter a number not listed above, Shashin will scale the image accordingly, to provide the size you want. Specifically, Shashin will use the closest, larger standard size available for the image, and then scale it down to the size you’ve specified, so you’re never losing image quality.

Default value: xsmall


  • Shows photo with Shashin ID 3 at 640 pixels.
    [shashin type="photo" id="3" size="640"]
  • Shows albums with IDs 4,8,9,11 in a 2×2 layout with the maximum size that will fit in the content area.
    [shashin type="album" id="4,8,9,11" columns="2" size="max"]

⇑ top


Purpose: whether to crop a thumbnail square. Note that thumbnails will be cropped only if the photo service has the requested size available in cropped format. For Picasa these sizes are 32, 48, 64, 72, 104, 144, 150 and 160. For Twitpic they are 75 and 150. Cropped sizes are not available for YouTube.

Supported values: “y” or “n”

Default value: “n”

Example: displays albums in 3 columns, size 144, cropped square

[shashin type="album" columns="3" size="144" crop="y"]

⇑ top


Purpose: determines whether a caption is shown. For photos, it will show the caption under the thumbnail. For albums, it will show the album title under the thumbmnail, a Google Maps icon if location data is available, and the number of photos in the album.

Supported values: “y” or “n”

Default value: “n” if the type is “photo” or “albumphotos”, and “y” if the type is “album”

Example: will show the caption under the photo:

[shashin type="photo" id="3" caption="y"]

⇑ top


Purpose: determines the number of columns to use for displaying the thumbnails

Supported values: any number, or “max”. For “max”, Shashin will determine how many columns will fit in the content area, given the size of the thumbnails.

Default value: 1


  • Shows photos with Shashin ID 3,6 in 2 columns.
    [shashin type="photo" id="3,6" columns="2"]
  • Shows albums with IDs 4,8,9,11 at 160 pixels for each album thumbnail, using the maximum number of columns that will fit in the content area.
    [shashin type="album" id="4,8,9,11" size="160" columns="max"]

⇑ top


Purpose: determines the order for displaying thumbnails. The supported values vary depending on the type. “user” order means the actual order listed in the id attribute. “source” means the order of the photos at Picasa, YouTube, or Twitpic.

Supported values for type “photo” and “albumphotos”: id, date, filename, random, source, user

Supported values for type “album”: id, date, title, location, count, sync, random, source, user

Default values for type “photo” and “albumphotos”: “user” if an id was provided, and “source” otherwise (grouped by albums)

Default values for type “album”: “user” if an id was provided, and “date” otherwise

  • Shows photos from album ID 5, in 3 columns, ordered by date.
    [shashin type="albumphotos" id="5" columns="3" order="date"]
  • Shows 2 random photos.
    [shashin type="photo" limit="2" order="random"]

⇑ top


Purpose: whether to reverse the specified order

Supported values: “y” or “n”

Default value: “n”

Example: Shows photos from album ID 3, in 3 columns, in reverse order by date.

[shashin type="albumphotos" columns="3" order="date" reverse="y"]

⇑ top


Purpose: to limit the number of thumbnails displayed

Supported values: any number

Default value: can be set on the Shashin settings pages (set at 18 initially)


  • Shows the first 9 photos from album ID 5, in 3 columns, ordered by date.
    [shashin type="albumphotos" id="5" columns="3" order="date" limit="9"]
  • Shows 2 random photos.
    [shashin type="photo" limit="2" order="random"]

⇑ top


Purpose: to show a specific subset of thumbnails. Shashin does automatic photo paging but does not provide automatic album paging. This will let you do manual album paging, with one shortcode per page (you’ll need to add your own “previous” and “next” links).

Supported values: any number

Default value: none

Examples (these three together are an example of album paging):

  • Shows the first 18 albums, with the most current first.
    [shashin type="album" order="date" reverse="y" limit="18" size="160" columns="max" position="center" crop="y"]
  • Shows the next 18 albums.
    [shashin type="album" order="date" reverse="y" limit="18" offset="18" size="160" columns="max" position="center" crop="y"]
  • And the next 18.
    [shashin type="album" order="date" reverse="y" limit="18" offset="36" size="160" columns="max" position="center" crop="y"]

⇑ top


Purpose: to control the position of thumbnails in your post or page.

Supported values: any CSS float value (left, right, none, inherit), or “center”

Default value: none

  • Shows photo ID 52, large and centered
    [shashin type="photo" id="52" size="large" position="center"]
  • Shows photo IDs 5,9,42, in a single column, floated left.
    [shashin type="photo" id="5,9,42" columns="1" position="left"]

⇑ top


Purpose: specifies which sides to disallow floating elements around Shashin thumbnails

Supported values: any CSS clear value (left, right, both, none, inherit)

Default value: none


[shashin type="photo" id="52" size="large" clear="left"]

⇑ top

Understanding the “max” value for “size” and “columns”

“max” helps you not have to think too hard with your Shashin shortcodes. If you specify “max” as the size, Shashin will use the size specified in your Shashin settings for “Content width (in pixels) for your theme.” If your theme has a responsive design, pick the largest size you would want to display thumbnails (starting with Shashin 3.4, Shashin will then scale it down as needed for smaller displays). This is also helpful if you ever change themes in the future – you can just update this settings rather than have to edit a bunch of previously created shortcodes.

“max” can also be used with columns. So if you know, for example, you want the thumbnails size to be 150, Shashin will do the math to figure out how many columns to display (by referring to the content width setting).

Note that you cannot specify “max” for the size and the columns in the same shortcode.

⇑ top

Using the Shashin Widget

The input fields in the form for the Shashin widget are the same as the shortcode attributes, so please review that section of the documentation to understand the options. Note the only type supported currently is “photo” (as it’s not practical to show all the photos for an album in the sidebar, which is very narrow in most themes).

Here are some tips:

  • The title will appear above the Shashin images, in an H2 heading tag.
  • For the widget, there is no photo picker to get the photo IDs for you, if there are specific images you want to show. I recommend going to the post editor, and generating a Shashin shortcode in a post, using the Shashin media browser to pick the photos you want. Then copy-and-paste the photo IDs from the shortcode into the widget (you can then go ahead and delete the shortcode from the post).
  • If you want random images, select “Random” for the “Order by,” and leave the photo IDs field blank. Then under “Limit” put in how many random images you want.

⇑ top

Using Shashin with prettyPhoto

Shashin comes bundled with prettyPhoto. After installing Shashin, review the settings for prettyPhoto in the Shashin settings menu, and update them as desired.

If you already have prettyPhoto installed on your site, there is an option in the Shashin settings menu to prevent Shashin from loading its own copy of prettyPhoto. Use this option to prevent possible problems with running multiple instances of prettyPhoto at the same time.

Note that Fancybox is also included, but may be removed in future versions of Shashin. It’s an older version of Fancybox, as the newest version does not have a license that is compatible with WordPress. It’s currently included only for legacy support.

⇑ top

Using Shashin with other image viewers

If you wish to use a viewer other than prettyPhoto or Fancybox, go to the Shashin settings menu, and select the option to use your own viewer. This is an “experts only” option. Then fill out the fields to configure the “id”, “class”, and “title” attributes of Shashin’s image tags and anchor tags. You will need to know how to structure the values for these attributes for your viewer.

The ability to click an album thumbnails and view its photos may not work “out of the box” with viewers other than prettyPhoto and Fancybox. If you run into any trouble, post a question in the support forum – we may need to add some custom javascript for the viewer you want to use.

⇑ top

The Shashin and prettyPhoto stylesheets

The CSS for styling Shashin is in your plugin directory at shashin/public/display/shashin.css. If you want to customize it, copy it to your active theme folder, and edit it there. Shashin automatically looks for a copy of shashin.css in your active theme folder first. This way you won’t lose your customizations the next time you upgrade Shashin.

There’s also a stylesheet for prettyPhoto, at shashin/public/display/prettyphoto/prettyPhoto.css. Like shashin.css, you can put a customized version of it in your active theme directory.

⇑ top

Common problems and solutions

  1. Album syncing problems: There are four possible causes of the error “Failed to retrieve album feed at [your album’s json url].”
    1. A server security limitation: Shashin uses WordPress’ HTTP API to retrieve album feeds. The HTTP API will try using PHP’s curl, fopen, and fsockopen functions to retrieve your album feeds before it gives up. If all three are disabled on your server, then you should ask your hosting provider if they can enable at least one of them for you, so you can use Shashin.
    2. A temporary connection problem: a temporary internet connection problem between your site and the feed server is the most common cause (note that just because you can get to the feed url from your browser doesn’t mean your web hosting server can connect). Wait a few minutes and try again to see if the problem goes away.
    3. A data load problem: if you are trying to use “Sync All”, and you have hundreds of albums, or dozens of albums with several hundred photos per album, your web server may timeout re-loading the Shashin Tools page before the syncing can complete. In this case you will need to add or sync albums one at a time. Or, if you are comfortable editing code, you can try adding the following line of code at the beginning of Shashin’s start.php file:

      Your server might not honor this setting, but if it does, then it will allow more time for Shashin to process all your albums’ feeds.

    4. A private album: Shashin supports public and “limited” visibility Picasa/Google+ albums. It does not work with private albums.
  2. Undesired styling for Shashin thumbnails: if you are seeing off-center image borders, extra borders, or incorrect thumbnail positioning, it is being caused by a conflict between the Shashin stylesheet and your WordPress theme’s stylesheet. The major browser’s have tools which let you fairly easily analyze these problems (such as Firebug for Firefox). Once you find the conflict you can then alter Shashin’s stylsheet or your theme’s stylesheet to resolve it. For thumbnails not floating to the left or right in the Twenty Ten and Twenty Eleven themes, please see this comment for a solution.
  3. Album links going to Picasa instead of showing photos on your site: there are several WordPress plugins for Google Analytics, some or all of which conflict with Shashin. They add “onClick” code to the album links, causing the Shashin code to not function properly. If you’re using one of these plugins, see if it has an option where you can tell it to ignore links to certain domains. If so, tell it to not track links to “” (that’s the Picasa/Google+ domain where the images are served).

⇑ top

Calling Shashin directly in PHP code

Calling Shashin directly in your PHP code is easy. The static method ShashinWp::display() accepts an associative array as an argument, which works exactly like the Shashin shortcode. Here is an example, for showing two random photos in a single column:

$shortcode = array(
    'type' => 'photo',
    'limit' => 2,
    'order' => 'random',
    'size' => 160,
    'crop' => 'y',
    'caption' => 'y',
    'columns' => 1
echo ShashinWp::display($shortcode);

⇑ top

Planned new features

I maintain a list of planned new features at GitHub. If there’s a feature you’d like to see that is not already listed, post a message in the support forum to let me know.

Note that my time for development work on Shashin is very limited (as I don’t get paid anything for it), so please be patient.

⇑ top

What “Shashin” means

I released the first version of Shashin while Post to Post Links II error: Unrecognized type: cat_slug. Shashin is the Japanese word for photograph, so it seemed fitting.

⇑ top

77 thoughts on “Shashin – a WordPress plugin for displaying photos and videos from Picasa, YouTube, and Twitpic

  • Hi Michael,
    I’ve just had a chance to try your latest version. It has installed and activated correctly, but when I try to add an album url I get an error message: “That is not a valid Picasa album URL”.
    I can provide more details of site link and album url if required.

  • John and I exchanged a few emails. Turns out the problem was he’s using Picasa at I hadn’t considered addresses for Picasa other than I should be able to fix this by making the web server address a configuration option. In the meantime, for anyone else in John’s situation, if you open Shashin.php, look in the series of “define” statements near the top, and change SHASHIN_USER_RSS and SHASHIN_ALBUM_RSS to use the Google address. That should take care of it for now.

  • I had to make one other change as well.
    Line 246 (or thereabouts):
    $pieces[2] != “”
    Also change to or whatever.
    It now seems to be working. Just got to play with it more fully now.
    Many thanks.

  • Hi Peter – I took the liberty of adding your album to my installation, and it worked fine (I then deleted it). So the problem doesn’t have to do with your album. I noticed your path starts with D:, which means you’re running on a Windows server. I haven’t yet had the opportunity to test Shashin on Windows. Could you tell me what version of Windows you’re running, what version of PHP, and what version of WordPress?

  • [Peter emailed me his configuration info]

    Hi Peter – I did some Googling and found reports of similar problems with other WordPress plugins. I didn’t find a definitive answer, but it sounds like the cause can be one or more of the following:

    1. error appears after upgrading WordPress, especially if the plugin wasn’t deactivated prior to upgrading
    2. caused by wp-cache or another code cacher installed on the server
    3. plugin code inadvertently uploaded to two different subdirectories of the plugins directory
    4. some unknown weirdness with WordPress plugins in a Windows environment

    Let me know if 1, 2, or 3 might apply in your case. If not, then it’s probably 4. In that case, please try the following and let me know if it fixes the problem:

    Open Shashin.php. and in the line right before “class Shashin” put:

    if (!class_exists(“Shashin”)) {

    and then, towards the end of the file add another closing brace


    right after the last closing brace, but before the Shashin::bootstrap() line.

    Mike T

  • Now I don’t get an error message.. But the album still isn’t added..

    It’s a new domain, and a fresh installed WP. I tried to disable Exec-PHP (the only active plug in..) But without luck..

    The structure is like this:


  • Do you mean you weren’t able to successfully deactivate the exec-php plugin? If so, it sounds like there’s a problem with your WP installation and/or that plugin. I’d recommend deactivating Shashin and then try to figure out what’s going on with exec-php. From what I know about it, it’s a fairly powerful plugin and I could see it causing problems elsewhere if it’s not working right.

  • Hi Mike,
    I am having same issue as John0’s, my web picasa url is “”, so I followed your suggestion change the SHASHIN_USER_RSS to use, however, when I tried to add a new album, it said invalid url. Can you help me with this? thank you.

  • Hi Pei – You’ll want to see JohnO’s comment #3 above as well. I plan to have a new version out next week that takes care of this problem.

  • oh! thank you, I didn’t see that comment, that works. I copy the code to my sidebar, but nothing happened. Is it possible that one day you can include a widget for picasa badge? That will be great! [the code i put in the sidebar: picasa
    $photo = new ShashinPhoto();
    echo $photo->getRandomMarkup(array(null,’any’,144,’n’,’left’,’none’));


    I also tested using [srandom=any,288,y,left,none], the result is almost good, but somehow interrupted the original div tag.
    I don’t really mind this, but maybe there’s a way to avoid this happen?
    thank you so much! looking forward to the new update release.

  • Hi Mike,
    after I typed some texts next to [srandom=any,144,y,left,none], it seemed working without interrupting the template now. I noticed that pictures with caption becomes “???”, I believe that it is because the language setting is not UTF-8, where can i change this setting?

  • I notice that this plugin only seems to work for albums that are publicly shared on Picasa; attempting to link into a couple albums that I use strictly for friends produces the following error:


    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘0,name,last_updated_timestamp,include_in_random) VALUES (‘Array’,’AlbumName?a’ at line 1]
    INSERT INTO wp_shashin_album (0,name,last_updated_timestamp,include_in_random) VALUES (‘Array’,’AlbumName?authkey=(removed)’,’1189287596′,’Y’);


    I’ve edited the code slightly here to hide the album name & auth key, but it looks to me as though the plugin is breaking when the URL includes the auth key. A similar error appears when you attempt to remove the auth key entirely from the URL –


    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘0,name,last_updated_timestamp,include_in_random) VALUES (‘Array’,’AlbumName’,’ at line 1]
    INSERT INTO wp_shashin_album (0,name,last_updated_timestamp,include_in_random) VALUES (‘Array’,’AlbumName’,’1189287723′,’Y’);


    The latter it seems fairly clear that it is erroring out because it doesn’t have access to the album due to the private nature of it, however, in the first example it looks like the script begins to parse the auth key and then fatals out.

  • Hi Pei – your code for using getRandomMarkup in your sidebar looks ok to me. Did you wrap it in <?php ?> tags?

    I had never tried putting just a srandom tag in a post with no other content. I’ll try that and see if I can reproduce the problem you described.

    I do have it set to UTF-8 for parsing the Picasa feed, but I have seen the same problem (I also get the ? character instead of the correct multibyte character). Perhaps it’s something with the shashin mySQL tables – I’ll take a look.

  • Hi Nakitomimaru – thanks for the details on your experience with private albums. My apologies for not pointing out in the documentation that I haven’t tried Shashin with private albums. I will need to change the URL parsing to support the authkey, and add a column to the the shashin_album table to store it.

    I’ll have version 0.7 ready this week. I’ll try to add support for private albums in 0.8.

  • Hi again Pei – I found the character set problem. I was setting the character set to UTF-8 using a constant, but it’s being ignored by my parser. For now you can fix it by going to line 94 of rss-functions-mod.php and changing $output_encoding=’ISO-8859-1′ to ‘UTF-8’. Then sync your albums in the admin panel.

  • Hi there
    Trying to get things working but I’m getting a fatal error.
    here’s the code I’ve included in my sidebar.php file

    Recent photos
    getNewestMarkup(array(null,any,72,2,12)); ?>

    I’m pretty sure I’ve followed instructions properly but may have missed something?

    Hope you can help

  • Hmmm … the code dropped out of my previous comment. I’ll try it without less than/greater than

    h2 Recent photos h2
    ?php echo $photo->getNewestMarkup(array(null,any,72,2,12)); ?

  • Hi Marty,

    Sorry about that. I made a mistake in the instructions. It should be:

    <?php echo ShashinPhoto::getNewestMarkup(array(null,any,72,2,12)); ?>

    I’ll fix the documentation ASAP!

  • hello Mike,
    I just upgrade to version 1.
    I tried put in the text sidebar widget ( I also tried put directly into sidebar.php), but i can’t see the photo. Did I set it wrong?

  • i noticed that the code was not shown above, so i take out
    ?php echo ShashinPhoto::getRandomMarkup(array(null,any,144,1,3,’n’,’none’,’clear’)); ?

    there are 2 “::” after ShashinPhoto, right?

  • Hi Pei – your code is fine – I just tested it on my site. There must be something else going on. I’ll send you an email – please reply and attach your sidebar.php file and I’ll take a look.

  • Hi Pei – the issue is your dynamic sidebar. Shashin does not work as a widget (I may add that in the future). That if… else statement at the top of your sidebar causes all of the sidebar code to be ignored. If you want to use Shashin in your sidebar, you’ll have to put the code after the “endif” line that’s near the end of the sidebar.

  • Hi Josh – the error you’re seeing on the comments table is really strange. My plugin has nothing to do with the comments table. It must be picking up an error that’s coming from something else in your WordPress installation, like another plugin. Not every plugin is good about checking for errors, so if there’s an unreported database error sitting around, my plugin could be picking it up.

    I’d recommend temporarily deactivating all your plugins, then reactivate only Shashin, and then try adding an album. That will help narrow things down.

  • AWesomeness simply because you got back to me so fast!! thanks ok so i tried again and these are the specific error messages that come up maybe this will help:

    Warning: Invalid argument supplied for foreach() in /home/content/s/p/i/spinlikeace/html/aceinthewhole/wp-content/plugins/Shashin/ToppaWPFunctions.php on line 325

    Warning: Invalid argument supplied for foreach() in /home/content/s/p/i/spinlikeace/html/aceinthewhole/wp-content/plugins/Shashin/ToppaWPFunctions.php on line 325

    I will now try and disable all 4 of my plugins hehe
    thanks again.

  • I finally had a chance to test the updated version – sorry for the delay, been very busy with school – and the new error message is as follows –


    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,name,last_updat’ at line 1]
    INSERT INTO wp_shashin_album (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,name,
    last_updated_timestamp,include_in_random) VALUES (‘Array’,’Array’,’Array’,’Array’,’Array’,’Array’,’Array’,’Array’,

    I note that in this error it has found the full auth key, but it still crashes out pretty hard; after attempting to add the private version, I switched the album to public and got the same error. Closing and restarting my admin session cleared the error.

  • Hello.
    I’ve got the exact same probleme as Josh Ventura, desactivating all others plugins didn’t help…

    Error line 325 when trying to add an album

  • Hi Stout – Josh and I have been emailing each other. We’ve narrowed the problem down but haven’t solved it yet. Shashin is seeing the correct URL for his RSS feed but is failing to parse it for some reason. I was able to add his album to Shashin on my site, so it’s not a problem with the feed. It must have to do with a site configuration difference. Could you let me know your WordPress version, your PHP version, and whether you’re on Unix or Windows?

  • Wahou, fast answer ! thank you.
    It probably is a server missconfiguration, currently my site is on webserver, a french provider free hosting service.
    it runs Linux
    php version is 5.1.3RC4-dev
    i use wordpress 2.2

  • Hi, love the flexibility of this plug-in, unfortunately it doesn’t seem to be doing what I want it to do :o(

    I’ve got the PHP from your FAQ for displaying random images, and put it in my themes header.php file. It works fine as I change the variables (image size, number of columns, etc.) until I set it to display 1 column, with 1 photo, at which point my page gives me this error:

    Warning: array_values() [function.array-values]: The argument should be an array in /Users/ecub/Sites/ on line 293

    Warning: implode() [function.implode]: Bad arguments. in /Users/ecub/Sites/ on line 293

    This is the PHP code I’m using:

    Am I doing something wrong?

  • Hi Graeme – I just tried this and got the same thing. So it looks like you found a bug! I will get this fixed within the next couple of days.

  • Hi Graeme – this is fixed now. If you download Shashin from the WordPress site, you’ll get a new version.

    For those keeping score at home, I’ve addressed all the issues raised in the comments so far except: 1. no support for private albums yet and 2. I wasn’t able to reproduce the problem Stout and Josh were having (Shashin was unable to parse their Picasa RSS feeds). But I’m working on a completely new parser, as the current implementation is a little goofy (it’s a hacked version of Magpie, which doesn’t read atom feeds very well). Hopefully that will take care of their problem.

  • Dude, you’re fantastic! It works beautifully now :o)

    Google could learn a lot from you! Glad it was a bug, my skills may be a little limited but was sure I wasn’t doing anything wrong…

  • Hi Mike, do you plan to make it compatible with WP 2.3? I’ve installed it today, and it doesn’t show up on the widgets admin panel. Or maybe I’m doing something wrong? Thanks for making your work available, I’m looking forward to trying it. Ben

  • Hi Ben – I have not made Shashin into a widget. You’ll need to follow the instructions in the FAQ (on the Shashin download page at to use Shashin in your sidebar.

    I’d like to make Shashin into a widget. I’m on another project right now though, so it might be a month or two.

  • thanks for the prompt reply, Mike. I just found my way to the install page. Hoping to try it out shortly.

    Do hope you’ll be able to widgetize it.

  • Your plugin seems to work a treat but then when syncing an album I got the error message Warning: Invalid argument supplied for foreach() in xxxxx/wp-content/plugins/shashin/ToppaWPFunctions.php on line 325. Any clues as to what’s up. Nothing seems to have crashed as such, or at least the site is still showing pictures but I never like warnings 😉

  • Hi Chris – Sorry for the trouble. A couple other folks have reported the same problem. I haven’t been able to reproduce it. The RSS parser I’m using seems to fail in certain environments. I’m working on writing my own parser, but it may be a month or so before it’s ready (job, kids, etc….). Stay tuned.

  • hi Mike
    another bit of info for you. I looked at the album in the admin page and got this…
    Warning: Invalid argument supplied for foreach() in /XXXXXXXXX/wp-content/plugins/shashin/display/admin-edit.php on line 83
    Photo Photo Key Description Markup Include in Random?

    Might help.

  • and more… 😉

    After deleting the offending album, I added it again and then in an attempt to see what was going on, removed other albums from the Random display, saved the settings and then looked at the site. Oddly, the albums from the “exclude from random” were also being displayed, despite the admin page saying they were excluded. Odd.

    Let me know if I can give you any more info.

  • Hi Chris – thanks very much for the details. You found a bug with the random image display! It wasn’t behaving properly if you specified “any” for the album and had excluded some albums. I’ll include a fix for this in my next release, which is almost ready (I’m adding widget support).

  • Hello Mike!

    I’m using your plugin on several WP 2.1. installations. It works great, thank you for your job.

    I also got an error mentioned by Peter (post number 4): Fatal error: Cannot redeclare class Shashin… etc.

    I think I found the reason. You are right: this happens a) only in Win32 enviroment and b) only on WP 2.1 or later. The reason is the bug #4408 (plugin_basename() function) which is already fixed in WP 2.2.

    Here are some more details on it:

    Hope it helps.



  • Thanks Vladimir. This is very helpful information. I’m glad to hear it’s been fixed in WP already. And thanks for the donation! After almost 600 downloads of Shashin, yours is the first donation.

  • Hi, i just load the plugin to my webserver into the “blog-folder” and when i like to aktivate the plugin the following appears:

    Warning: main(/homepages/…/htdocs/gerdpress/wp-content/plugins/shashin/ShashinAlbum.php) [function.main]: failed to open stream: No such file or directory in /homepages/…./htdocs/gerdpress/wp-content/plugins/shashin/shashin.php on line 66

  • Felt that after 600 d/ls you really should have had more than 1 tip, for what is shaping up to be a very good plugin. I wish you all success in its continued development.

  • Hi gerd – sorry for the delay in replying. That error seems very strange. The filename for Shashin.php has an uppercase first letter – I don’t know how yours came out lowercase. In any case, I just released a new version – could you try downloading and installing that, and let me know what happens?

  • Whoops. The php disappeared when I submitted this. Here it is without the php tags:
    echo Shashin::getRandom(3,288,1,1,1,’y’);
    This displays the photo fine, but not the caption.

  • Hi Karen – it looks like you’ve got one too many arguments in the list. 1st is the album key, 2nd is max size, 3rd is max columns, 4th is how many pictures to show, and 5th is y or n for the caption. So if you remove the “1” before the “y”, that should fix it.

  • Is there a way to use the sthumbs tag so that you can just pass an album ID (rather than a list of photo IDs) as the parameter, and it shows a thumbnail table of the photos in that album? Or is there a different Shashin tag that does this?

  • There is currently no mechanism for that in Shashin, but it’s a good idea. The tricky part would be handling large albums with hundreds of pictures. I’d need to look into a good way to “page” the photos. I’ll add it to the wish list!

  • Hey Michael,

    I am using your plugin now, it works fine. Is there a way to have te plugin sync with the picasa album automaticly when the page is opened on which i show the pics? I ask it because i use picasa to upload pictures from my phone to it by shozu and i want to show the latest 12 every time somebody opens that page.



  • Hi Lex – that’s a good suggestion. There might be a a noticeable performance cost though, since Shashin would have to sync every time someone visits your page (since there’s no way for it to know if the album has changed since the last sync). It also might cause a problem for high traffic sites, as Google puts a limit on how frequently you can hit your Picasa RSS feed. A different approach would be to sync on a timer, say once every couple of hours (I could set it up so you could decide how frequently). Would that be satisfactory?

  • Well Michael,

    In my case that page wont be opened real often, i would like to choose for the “every time the page opens” option then. Maybe you can add an option in the options page so that the user can decide himself if he wants that.

    For me, a sync once a day would be a good option also.

    Thanks for your response !


  • Hey Mike 🙂

    This is a great pluggin! Thanks so much.

    I just have a couple of questions. Is there anyway of getting it to display the pictures in the current website?

    If not, would it be possible to get picasa to open in a new window instead of leaving the original site?


  • I’m planning the next version, where I intend to add local caching of images, which would allow for displaying the full-size pictures in your site instead of going to Picasa (you need to cache them locally for this, otherwise it’s probably a violation of the Picasa user agreement). I’m thinking of making it work with the Lightbox plugin, so you’ll get them in a snazzy display.

    If you don’t want to wait (it will probably be a while before I get the next version done), you can change one line of code to get a new window. In ShashinPhoto.php, line 591 (I think), where you see ‘a href’ change it to ‘a target=”_blank” href’

  • GOT IT you have to change that line in ShashinAlbum.php if you want the album to open in a new window … makes sense – sorry for the message board jenkiness – delete my post if needed

    your plug-in is SWEET!

  • Plugin very nice.
    I had been demanded.
    Someday I hope to achieve demands.
    When I click on the thumbnail to view Pacasa Web instead of, for example, in view Thumbnail Viewer feature requests.
    Sorry English is poor.

  • Katsuhiko – if I understand, I think you’re saying you don’t want the thumbnail link to go to Picasa. I’m pretty sure it would be a violation of the Picasa user agreement not to do that. I’m planning to add local caching of images as a solution, but I can’t promise when it will be ready.

  • Wondering if there was a way I could add multiple albums to my sidebar through the widget interface. The theme I use is highly widetized so hard-coding additional albums really isn’t much of an option.

  • Hi Dustin – I’ve taken a look at my code for this, and it could be done with some hacking, but I wouldn’t recommend it unless you’re comfortable with PHP. If you’d like to try, let me know, and I’ll let you know what to do.

    I’ll add to the wish list the ability to have an option that would let you set how many of each kind of widget you’d like to have available.

  • I am comfortable with PHP and would like to attempt at applying these hacks.

    That would be awesome to place into a future update. Displaying multiple albums would definitely have advantages.

  • I thought that I could determine the order of images in a table of thumbnails by the image numbers, but it doesn’t seem to matter what sequence I put them in. The images come out in the same order. Sadly, that’s not a good thing, as I wanted to put the verticle images down below the horizontal ones, in order to be more esthetically pleasing.

  • Hi Dustin – sorry for the late reply. First, a disclaimer: I haven’t tried what I’m about to describe so I can’t guarantee that it will work. In Shashin.php. do the following:

    1. Look for the function widgetAlbum and make a copy of it. Paste it right after widgetAlbum, and change the name to widgetAlbum2. Then within the function, change the argument for get_option from ‘shashin_widget_album’ to ‘shashin_widget_album2’

    2. Where you see all the register_sidebar_widget calls, add one more for your new widgetAlbum2 function.

    3. Since the register_widget_control calls are in the same place, add one for widgetAlbumControl2, which we’ll create in the next step.

    4. Look for the widgetAlbumControl function and make a copy of it, and paste it right after widgetAlbumControl. Change the name to widgetAlbumControl2, and then inside the function, in the call to Shashin::_widgetControl, change the ‘album’ argument to ‘album2’

    5. repeat the previous steps (and update the numbers) if you want more than 2 album widgets.

    I’ll try to think of a better solution for this in a future version.

Comments are closed.