IE8 Web Slices with NextGEN Gallery

Web SlicesToday I updated to IE8 and played a bit with the new features. One new feature is the Microformat “Web Slices”. Not sure if I really need it, but for some test I’ve added the feature to the widgets, so you can create a Gallery Web Slice to inform about new images…

Here is the small fix, if you would like to test it. Look into the widget admin panel to activate it .

Wish everybody a nice weekend

Advertisements
Tagged ,

18 thoughts on “IE8 Web Slices with NextGEN Gallery

  1. Ramoonus says:

    Yaay more great functions for nextgen gallery! ๐Ÿ˜‰

  2. Gustav says:

    I’ve made a small modification to my nextgen plugin that might be of interest to make public. I’v added a function similar to singlepic but called randompic. It is what it sounds like. It takes a random image and displays it as a singlepic. There is also an option to choose which gallery the image should be chosen from.

    syntax:
    [randompic gallery=x w=width h=height mode=web20|watermark float=left|right] optional text [/randompic]
    or
    [randompic gallery=x w=width h=height mode=web20|watermark float=left|right]

    All options are optional.

    The code is only added in /lib/shortcodes.php (it is a ripoff from [singlepic]):

    add_shortcode( ‘randompic’, array(&$this, ‘show_randompic’ ) );

    ..

    if ( stristr( $content, ‘[randompic’ )) {
    $search = “@[randompic=(d+)(|,d+|,)(|,d+|,)(|,watermark|,web20|,)(|,right|,center|,left|,)]@i”;
    if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {

    foreach ($matches as $match) {
    // remove the comma
    $match[2] = ltrim($match[2], ‘,’);
    $match[3] = ltrim($match[3], ‘,’);
    $match[4] = ltrim($match[4], ‘,’);
    $match[5] = ltrim($match[5], ‘,’);
    $replace = “[randompic gallery=”{$match[1]}” w=”{$match[2]}” h=”{$match[3]}” mode=”{$match[4]}” float=”{$match[5]}” ]”;
    $content = str_replace ($match[0], $replace, $content);
    }
    }
    }

    ..

    function show_randompic( $atts, $content = ” ) {

    extract(shortcode_atts(array(
    ‘gallery’ => 0, //if no gallery is specified, an image from all galleries is chosen
    ‘w’ => ”,
    ‘h’ => ”,
    ‘mode’ => ”,
    ‘float’ => ”,
    ‘template’ => ”
    ), $atts ));

    $picturelist = nggdb::get_random_images(1,$gallery); //get one random image from $gallery
    $id = $picturelist[0]->pid; //get the id from that one image, wich is the first (and only…)

    $out = nggSinglePicture($id, $w, $h, $mode, $float, $template, $content);

    return $out;
    }

    All parts of code is inserted next to the same code for singlepic.

    I hope this can be of use to others as well. An example can be found at my website: http://averater.se/photo

    enjoy /Gustav

  3. Yogie says:

    I would prefer smaller updates on existing features, as adding more EXIF tags according to the EXIF standard 2.2 (http://www.exif.org/specifications.html) such as adding support for “Flash, Flash Energy, Light Source, Exposure Program, Scene Type, Metering Mode etc….” I would do by my own if I would know how to ๐Ÿ™‚

  4. Gustav says:

    I do realize that my last comment is most likely wrongly placed but I didn’t know where to put it (and I still dont…).

    But however: I do have a better (maybe) way of creating essentially the same thing but without adding another of those tags. By just changing the singlepic by checking if strtolower($id) == ‘random’, then if you write id=random (or Random or raNdom…) a random image is chosen. There is also a need for the (optional) extra input of what gallery to select the image from.

    If no backwards compatibility is needed then it is only needed to replace th following part of /lib/shortcodes.php:
    function show_singlepic( $atts, $content = ” ) {

    extract(shortcode_atts(array(
    ‘id’ => 0,
    ‘w’ => ”,
    ‘h’ => ”,
    ‘mode’ => ”,
    ‘float’ => ”,
    ‘template’ => ”
    ), $atts ));

    $out = nggSinglePicture($id, $w, $h, $mode, $float, $template, $content);

    return $out;
    }

    with:
    function show_singlepic( $atts, $content = ” ) {

    extract(shortcode_atts(array(
    ‘id’ => 0,
    ‘w’ => ”,
    ‘h’ => ”,
    ‘mode’ => ”,
    ‘float’ => ”,
    ‘template’ => ”
    ‘gallery’ => 0, //if no gallery is specified, an image from all galleries is chosen. WARNING this is ignored if id!=random
    ), $atts ));

    if (strtolower($id) == ‘random’) {
    $picturelist = nggdb::get_random_images(1,$gallery); //get one random image from $gallery
    $id = $picturelist[0]->pid; //get the id from that one image, wich is the first (and only…)
    }

    $out = nggSinglePicture($id, $w, $h, $mode, $float, $template, $content);

    return $out;
    }

    If backwards compatibility is needed then the “if ( stristr( $content, ‘[singlepic’ )) {” part of the function convert_shortcode needs to be altered too.

    regards Gustav

  5. Thomas says:

    You have a great widget there Alex. Thanks for all the hard work you’ve done. My only desire would be a pause/stop button for the slideshow, since my viewers may also be watching my videos.

  6. Mark says:

    How would the code for [nggallery id=1] look if I just open the php page and want it to go in a specific place.

  7. Eathan says:

    I’ve tried to upload pictures into nextgen gallery.. i keep getting a error 404. Has anyone had this problem before?

  8. harpaz says:

    hey,

    i down understand why my widget slideshow not vorking? :/ I add it but nothin is showin.. what I need to change?

  9. harpaz says:

    hey,

    NextGEN Slideshow not working to me and I dont understand why, no picture and nothing is showing then I add it:/ what can be wrong?? thanks fot replay.

  10. Carlos says:

    Great function. I like this widget.

  11. Mike says:

    I’m having problems with slideshows, they won’t appear in posts, or in the sidebar widget, just a blank space there. I thought it might be browser issues with FF, but it’s exactly the same in IE as well. I’ve been trying to search for a solution for about a week now, can’t find anything that helps so far.

  12. Bryan says:

    I’m getting a big blank as well. I can display single pictures, and the browser but as soon as I try to do a slideshow I get just a large white space where the slideshow should be. Anybody figure this one out? The short command is (without the spaces before or after the brackets) [ slideshow id=1 w=640 h=480 ]. I’ve also tried leaving out the width and height.

    IE 8.0.6, NextGEN 1.3.5, imagerotator.swf… don’t know version but it was downloaded today from the site. If I go to the flash.com site I do see the video so that is probably working.

    thanks for any help

    -Bryan

  13. Bryan says:

    Nevermind, I got it working by re-loading the imagerotator, and some combination of activating/deactivating the plugin.

  14. Seej says:

    Great function, thanks for sharing. I’m using it on a website, but the “random” function only works intermittently. Sometimes its fine, and reloading the page grabs a new image; other times I can’t get a different image no matter how often I reload. My gallery I’m pulling from has over 30 images, so the odds of it, “just magically pulling from one” is pretty slim. You can see this on the home page of http://www.davidlindner.com

    Thanks for any help.
    Best,
    Seej

  15. Seej says:

    [bump]

    One thing that I notice with this function: it works great if you’re not using a custom template. When I put in a custom template, the randomness becomes very irregular; generally a reload gets you the same image. I’m not doing anything fancy in my custom template, just making the image not a link. So not sure why this would fail. Any help, you know…greatly appreciated.

    Seej

  16. W4yne says:

    Hey, first thing, i love your plugin, that is how wordpress should do it :=). It is really great.
    But with the IE8, the thumbnails are really crashed, so I want to ask if there will be a fix on it?
    Thank you very much

Comments are closed.

%d bloggers like this: