27

Apr

Shashin 2.1 - Easier Steps for Displaying All Album Photos

Topic: WordPress and Web Programming
Tags: ,

Shashin 2.1 is now available. It does not include any new dazzling features, but it has a new, easier to use option for displaying all your album thumbnails, and then have them link to a page on your site that displays all the photos in each album. The Shashin page has instructions on how to do this.

There were 3 problems with how I implemented this feature in the previous (2.0) version of Shashin, but they only became clear to me after hearing feedback from people using Shashin 2.0 in a wide variety of WordPress themes. One problem was that the steps involved were just too complicated for most people’s needs (but the more complex options are still there, if you need greater control of the configuration than the new “easy” way).

The second problem was my attempt to manipulate the title of the page containing the [salbumphotos] tag. Shashin 2.0 tries to dynamically append the title of the selected photo album to the page title. In a rational world this would be easy, but WordPress makes it extraordinarily difficult to isolate and manipulate the title of a page, as reported here. I thought I had come up with a work around. But, as it turns out, my solution was not reliable across all the different WordPress themes that are out there. So, with Shashin 2.1, I have removed all the code that tries to manipulate the page title. It now simply displays the album title as a caption on the table that contains the photo thumbnails. This is much cleaner and shouldn’t cause conflicts with any themes.

The third problem was the [salbumphotos] tag, which is used to display thumbnails for all the photos in an album. In Shashin 2.0, a page with the [salbumphotos] tag won’t play nicely with sidebars that use the wp_list_pages function (for listing links to all the pages on a site). The [salbumphotos] tag only worked correctly if you used it in conjunction with Shashin album thumbnails. You couldn’t just go to the page directly from a sidebar link. This is fixed in Shashin 2.1.

Shashin 2.1 also has a few minor bug fixes, the most important of which is that you can now once again see the photo thumbnails in the Shashin admin panel.

I should point out that, if all you want to do with your Picasa photos in WordPress is display your album thumbnails on a page, and then link them to a page that displays the photos in each album, then I recommend kPicasa Gallery. It has similar features to Shashin in this area, but without Shashin’s management overhead. But if you want to do more than just that, then I recommend Shashin ;-) .

Similar Posts

38 Responses to “Shashin 2.1 - Easier Steps for Displaying All Album Photos”

Subscribe to this posts Comments RSS Feed

  1. zinnia Says:

    Dear Michael, A mistake was typing its name by the previous comment.

    It’s wonderful and is the best upgrade.
    It became very easy to use.
    Thank you very much.

    Now, I’ll also use this wonderful plug-in habitually.

  2. GFB Says:

    Michael - fixed my colon issue with this latest release, absolutely fabulous plug-in.

    One question I have not found any documentation on. I will be linking to around 4 Picasa Albums for family photos…is there a way similar to the “Album Photos” pages to create a page that shows All Albums for a particular Picasa account?

    I am thinking I could link each album into their own page rather than have all Albums drop onto one page. Now I realize I can do so by building a page and inputting the Album Names (or ids or something) into the code variables, but didn’t know if there was an automatic way to accomplish this!

    Many thanks.

  3. Mike Says:

    Hi GFB,

    There’s no automatic way to do that at this time. But you can do it with the [salbumthumbs] tag, which is documented here.

    In your case you’d want to create a page with the [salbumthumbs] tag, and give it the album keys for just the albums you want. Then it will display thumbnails for only those albums. When you click the album thumbnails, it’ll link to the page containing the [salbumphotos] tag, where it will display all the photos in the album.

    This is a more complicated than the new “easy” option, but it gives you a huge amount of flexibility. You can choose any albums you want, you can have the album thumbnails in a post or a page, you can layout the album thumbnails differently from the photos, etc.

  4. Jim R Says:

    Wow - great-looking plugin, just what I was looking for.

    I’ve installed it on a new Wordpress 2.5 install for testing, but can’t seem to get the Highslide option to work. When this option is selected, I don’t see the Highslide “magnifying glass” icon when mousing over the thumbnail would expect. Clicking on the thumbnail results in a small “Loading…” box that pops up over the picture, but nothing happens. If I click again outside the “Loading…” box, the plain image is displayed on its own page. It’s as if the Highslide JS is not getting invoked or something.

    I’ve tried both IE7 and Firefox browsers, but no difference. It works with the sample images at the Highslide web site, so I don’t think it’s a browser setting.

    Any ideas what to look for? Did I miss a step somewhere? The only potential problem I see is that my hosting service (GoDaddy.com) only has MySQL 4.0 rather than 4.1, but it doesn’t seem likely that would cause JS problems.

    Thanks!

  5. Jim R Says:

    OK - getting closer. Found one thing I missed the first time: the default Wordpress install on GoDaddy is in the /wordpress subdirectory. So I modified the URLs in the highslide.css file to reflect the actual location.

    Now I’m getting the “magnifying glass” cursor when I mouse over a thumbnail. But when I click, it still just brings up the “Loading…” box, and sits there spinning without ever doing anything. I’ve waited up to 5 minutes & nothing happens. Clicking “Loading…” a second time stops it.

    Since I have MySQL 4.0, I also made the suggested modifications to ToppaWPFunctions.php (comment out lines 179-181). I also deleted the existing albums from the Manage.Shashin page, re-added them, and re-synced all the albums with Picasweb.

    Still the same results: I get the Highslide “magnifying glass” cursor, but clicking on the thumbnail never actually loads anything.

    Ideas? Thanks again!

  6. Jim R Says:

    Solved my problem: corrupted upload of the highslide/graphics directory. After browsing similar problems on the Highslide forum, I tried setting hs.outlinetype to null in the shashin.php file. That worked! This meant the problem was an inability to load the highslide graphics files. A quick test of trying to manually download these files in a browser showed they were corrupt. Re-uploaded them (explicitly setting FileZilla FTP to “binary: this time) and everything seems to work fine.

    Thanks, and I look forward to moving ahead with this great-lookin plugin!

  7. Mike Says:

    Hi Jim - Sorry for not catching your messages sooner. Sounds like your diligence has paid off. Let me know if anything else comes up.

  8. Milan Says:

    Is there, or will there be any pagination option?

    For example, “kPicasa Gallery” plugin has nice option that you can enter number of albums or photos per page and the script automaticly add page navigation at bottom.

    It can be very useful option, first of all for those who have lot of pictures and want to organize it, nicer.

    One more, when i choose 160px width, all picture thumbs are same size, but when I choose 72px width I get some of them like portrait or landscape shapes, whitch doesn’t look pretty enaught (link http://www.salsanis.com/galerija-slika?album_id=5197716434981344401&title=Treca+salsa+zurka+u+Nisu)?

    Btw, the script is great :))) Regards from Serbia.

  9. Jim R Says:

    One suggestion for the [salbumphotos] tag: have a parameter that controls album sort order, in addition to the existing photo sort order. I like to show the most recent albums first, but within each album show the photos in chronological (ascending) order. I’d imagine this is a common scenario.

    I’ve hacked the existing script to make this happen (adding a DESC keyword to the sql query), but might be a nice option for those that don’t want to touch the code.

  10. Mike Says:

    Hi Milan - Pagination is a good idea - I’ll add it to the wish list. If you check the Shashin page, it explains that some of the image sizes are special “cropped” sizes. 160 is one of these sizes - it displays all the images 160×160 square.

  11. Mike Says:

    Hi Jim - that’s a good suggestion - thanks. I try to find the right balance between having good options, but not letting the parameter list become too long and potentially confusing. In this case it might be worth adding one more… I’ll keep thinking about it.

  12. Angi Says:

    Hi :) Just want to say THANKS for this plugin! I was searching for a plugin with so many possibilities for days, and I’m very happy that I found yours which is just perfect. So, thank you so much! :)

  13. Guillaume Says:

    I’m the kPicasa Gallery developper, just wanted to say hi and thanks for the great words! Keep up your work.

  14. -drew- Says:

    Hey Mike - thanks for providing such a great plug-in. It hardly took much effort to get it working on my site, and I’m impressed with the presentation it gives my site

  15. Christian Says:

    Hey Mike,

    first thanks for these great plug-in. But I have a problem with the plug-in, more exactly with [salbumphotos] tag. I create a page containing the [salbumphotos] tag. The page display thumbnails for all the albums I have loaded in shashin. Then when I click on a thumbnail, it don´t display thumbnails for all the photos in that album of my page, but in the window opens my picasaweb (see here: http://www.essetrip.com/?page_id=71) What´s wrong? Can you help me?
    I want like Dragons art gallery.

    Ideas? Thanks!!!

  16. Mike Says:

    Hi Christian - it sounds like you just need to go into your Settings menu for Shashin and change the “full size image display” setting to Highslide.

  17. Shashin - плагин для отображения фотографий Picasa | WordPress | Дневник “Идущего к Цели” Says:

    [...] сайте разработчика, путем использования комментариев в посте, объявляющем о Shashin 2.1 для [...]

  18. Shashin Plugin « Samtex test site Says:

    [...] Shashin 2.1 - Easier Steps for Displaying All Album Photos if you use Picassa Albums. The process is straight [...]

  19. scubes Says:

    I am currently running mysql 3.23. I tried installing your plugin, but I get the two create table errors that you mentioned here. I commented out the three lines in the “functions” code. However, I am still unable to add an album which I suppose is b/c the tables never get created at all.

    Any insights?

  20. Mike Says:

    Hi - I haven’t worked with that version of mysql, but it’s possible it pre-dates mySQL’s current UTF-8 support. In shashin.php, look for and comment out the following two lines:

    $wpdb->query(’ALTER TABLE ‘ . SHASHIN_ALBUM_TABLE . ‘ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci’);

    and

    $wpdb->query(’ALTER TABLE ‘ . SHASHIN_PHOTO_TABLE . ‘ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci’);

    And then in ToppaWPFunctions.php, replace this line:

    $sql .= “) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;”;

    with this:

    $sql .= “);”;

    Let me know if that works.

  21. Aouni Says:

    Dear Sir, should shashin display albums with highlight? Coz only single photos are being displayed with highlight. As to albums, am getting the link which lets visitors go to picasa and view them there.

  22. Mike Says:

    Hi Aouni - album thumbnails can be set up to link to another page that shows the pictures in the album. See the Shashin page for instructions (see link in the post above). The album thumbnail itself does not display in Highslide, if that’s what you mean.

  23. Daniel Says:

    Since Shashin 2.2.1, images don’t display anymore. With the previous release, everything worked perfectly well.

    A tag such as [simage=104,160,n,right] only displays an empty square on my blog http://www.heiniger-net.ch.

    What did I do wrong? Or could it be that some bug was introduced?

    Thanks a lot for your help.

  24. Mike Says:

    Hi Daniel - You need to deactivate/reactivate, and then do a “sync all” for your albums (if you downloaded 2.2.1 last Saturday night or Sunday morning, the “sync all” note was missing, but it’s been in the installation notes since then).

  25. Daniel Says:

    When I try a “sync all”, it gives me this message:

    “Failed to sync albums. This was probably a bad connection trying to read the RSS feed. Please try again.”

    Trying again just gives the same message over and over.
    What’s the problem?

  26. Mike Says:

    Hi Daniel - please check line 220 of Shashin.php. It should be this:

    if ($foundEnclosure === false) {
        $wpdb->query('ALTER TABLE ' . SHASHIN_PHOTO_TABLE . ' ADD enclosure_url text NOT NULL');
        $wpdb->query('ALTER TABLE ' . SHASHIN_PHOTO_TABLE . ' ADD enclosure_type varchar(255) NOT NULL');
               }

    If you’re missing the “enclosure_type” line, then put this in your code:

    // if ($foundEnclosure === false) {
    //    $wpdb->query('ALTER TABLE ' . SHASHIN_PHOTO_TABLE . ' ADD enclosure_url text NOT NULL');
          $wpdb->query('ALTER TABLE ' . SHASHIN_PHOTO_TABLE . ' ADD enclosure_type varchar(255) NOT NULL');
    //}

    Then deactivate and reactivate - this will force it to create the enclosure_type field.

    There was a glitch with my upload to wordpress.org last weekend, and for a short time there was a version of Shashin.php that had the missing line. I’m guessing this is what’s causing your problem. If this isn’t the problem, please let me know.

  27. Daniel Says:

    This is what I found at line 220 in shashin.php:
    [code]
    if ($foundEnclosure === false) {
    $wpdb->query(’ALTER TABLE ‘ . SHASHIN_PHOTO_TABLE . ‘ ADD enclosure_url text NOT NULL’);
    $wpdb->query(’ALTER TABLE ‘ . SHASHIN_PHOTO_TABLE . ‘ ADD enclosure_type varchar(255) NOT NULL’);
    }
    [/code]Therefore, it looks ok.
    Is there anything else I can check?

  28. Mike Says:

    Hi Daniel - Do you have a tool like phpMyAdmin, that lets you browse your database tables? If you can send me a list of the columns in your wp_shashin_photo and wp_shashin_album tables, we can see if the tables were updated correctly.

    What version of mySQL are you using? Shashin has certain problems with versions prior to 4.1.

    It must be either Shashin’s table structure or its RSS parser that’s giving you trouble. The tables are the most straightforward to check so let’s start there.

  29. Daniel Says:

    Hi Mike — Even better: I have WP-phpMyAdmin. It tells me this:

    Server version: 5.0.32-Debian_7etch6-log
    Protocol version: 10
    phpMyAdmin - 2.10.3
    MySQL client version: 5.0.32
    MySQL charset: UTF-8 Unicode (utf8)

    table wp_shashin_album has the following columns:
    album_key, album_id, user, name, link_url, title, description, location, cover_photo_url, last_updated, photo_count, pub_date, geo_pos, include_in_random

    table wp_shashin_photo has the following columns:
    photo_key, photo_id, album_id, title, description, link_url, content_url, width, height, taken_timestamp, uploaded_timestamp, tags, include_in_random, deleted, enclosure_url

    Thank you for your help. I hope this brings us further. Anything else that is of interest?
    – Daniel

  30. Mike Says:

    Hi Daniel - Try the code change I sent you before, then deactivate and reactivate. The enclosure_type column didn’t get created in your wp_shashin_photo table when you upgraded. At the moment I’m not sure why it didn’t, but the code change I sent you before should force the code to run that will create that column. Let me know if it works.

  31. Daniel Says:

    Great! That did the trick. Now it works again, photos are shown.

    But this reminds of another minor glitch: Did you verify the shashin CSS code under Firefox? Or is it my theme? If you look at the “Random Image”, or the little house on the current latest article of my blog in Firefox, you will notice that the pictures “hang out of their frames”. I fixed that in shashin 2.2 by editing the shashin.css, but that change is, of course, gone now.

    Thanks –Daniel

  32. Mike Says:

    Hi Daniel - There are some errors in your “Chameleon” theme that may be causing the trouble:

    
    Warning: Error in parsing value for property 'width'.  Declaration dropped.
    Source File: http://www.heiniger-net.ch/blog/wp-content/themes/chameleon/style.css
    Line: 38
    
    Warning: Expected end of value for property but found 'padding'.  Error in parsing value for property 'margin'.  Declaration dropped.
    Source File: http://www.heiniger-net.ch/blog/wp-content/themes/chameleon/style.css
    Line: 672
    

    Also, with this version of Shashin, you can put a copy of shashin.css in the folder of your active theme and it will use that. So when you upgrade Shashin in the future, you won’t lose any customizations you’ve made.

  33. Daniel Says:

    The first css error is intentional, and I just fixed the second one, but without any visible effect on the image-display.

    It took this on shashin.css for my pictures to display properly on Firefox:
    .shashin_image img {
    padding: 3px 3px; /* double this for shashin_div_padding option */
    border: none;
    }

    (i.e. a second “3px” on the padding line)

  34. Mike Says:

    Hi Daniel - at least in theory, there’s no reason to make the change you did. The declaration for this in shashin.css has 3px listed once, which means it adds 3px of padding to each side of the image. By putting it twice, you’re still saying the same thing - the first 3px applies to the top and bottom of the image, and the second applies to the left and right. See here:

    http://www.w3schools.com/Css/pr_padding.asp

    I haven’t seen any problems related to this in Firefox (versions 2 or 3). If you really want to get to the bottom of this, I’d recommend briefly switching themes (and turning off other plugins that add their own css) to test whether there’s some interaction with your theme that was causing this.

  35. Dan Says:

    I have the same “Failed to add albums. This was probably a bad connection trying to read the RSS feed. Please try again.” error when I go to the manage section and enter my photos… http://picasaweb.google.com/jaquintd

    I have the latest version of wordpress and the latest version of your plugin installed… any thoughts?

    here is my PHP/mysql info… http://www.jaquint.com/phpinfo.php

  36. Mike Says:

    Hi Dan - please send me a list of the columns in your wp_shashin_album and wp_shashin_photo tables

  37. Kristiaan Says:

    Hey Mike,

    Love the plugin. I got it working perfectly. I think its great.

    I was wondering: is it possible to display albums from two seperate picasaID’s, seperately on a website, say sorted by ID?
    My problem is this. I use the plugin on our schools website. Right now all pictures from kindergartenschool and primary school are put together on one picasa ID, so they end up mixed together on a page.

    Is there a way to get them displayed apart, maybe on different pages?
    I thought we might have to register an different picasa account for one or the other, but i think shashin would still display them together on a page although it can sync with multiple ID’s.

    Is there a workaround? I dont think a second shashin installation is a possibility, right?

  38. Mike Says:

    Hi Kristiaan - the only way to approach this currently is to use the salbumthumbs tag - see the directions here. But this requires you to know the album keys for each picasa user, which is a pain. I’ll try to think of an easy way to adjust this so you can specify a Picasa username instead of album keys.

Leave a Reply