Module for MiniSlide Show integration

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sat, 2009-08-22 04:33

MiniSlide Show is a flash based slideshow with support for Gallery 3 (that I've seen mentioned on the forums a couple of times). This module will allow you to display the slideshow within Gallery 3. Example:
[img]http://codex.gallery2.org/images/c/c1/Minislideshowmodule.jpg[/img]

Please be aware that:
- This module has been tested against git only and will most likely not work with Beta 2.
- The actual flash slideshow is not included with the module. You will need to download and install it separately (see the above link).
- The slideshow works in conjunction with the RSS module. If you want it to display more then the first 20 photos in an album, you'll need to modify the RSS module.

---
Report Problems/Suggestions Here | Get latest version | Documentation | Coffee Fund | My Library | My GitHub

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2009-08-22 05:10

Cool!
I would like to see a different icon/button that is not the same as the existing sideshow button.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sat, 2009-08-22 05:38

Is this different enough? I'm not really sure what else to make a slideshow button look like.
[img]http://gallery.menalto.com/files/ico-view-minislideshow.png[/img]

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2009-08-22 05:49

Looks good to me. I am sure some theme/UX person will change it if they want.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2009-08-22 12:37
 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2009-08-22 14:36

Hmmm... installed, but no "Admin -> Settings -> MiniSlide Show settings menu option"

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sat, 2009-08-22 17:43
suprsidr wrote:
Hmmm... installed, but no "Admin -> Settings -> MiniSlide Show settings menu option"

Are you using Gallery 3 Beta 2 or Experimental? If you're using Beta 2, you'll need to upgrade to the expermintal version:
FAQ: How do I upgrade?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2009-09-16 21:24
floridave wrote:
Looks good to me. I am sure some theme/UX person will change it if they want.

Okay, modifications attached here and up on my github. It seems that menu icons are all controlled within the actual theme, so some minor editing of the theme you're using will be required to get the menu icon to show up properly (see the "theme files" folder included with the module).

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2009-08-23 00:50
Quote:
This module has been tested against git only and will most likely not work with Beta 2

Sorry, read this as will work with beta2 only - duh!

I have not spent much time with G3, I really should take a look.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-06-09 03:44

Updated version of MiniSlide Show module:
- I've tested it against beta 3, everything seems to work fine.
- I've re-worked some of the code so that theme modifications are no longer necessary.

The updated module is attached to this post, and up on my github.

 
ptan

Joined: 2010-04-14
Posts: 3
Posted: Wed, 2010-04-14 23:41

Thanks for this great module. I have some questions though...
- I like to have a bigger modal dialog box. I tried changing the embedded size in minislideshow_dialog.html.php but that only changes the image size displayed within the dialog. Where can I change the modal dialog box size?
- Is it possible to have the minislideshow start up in fullscreen mode?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-12-15 04:46

Here is the latest version of the MiniSlide Show integration module. I've updated the code to load the CSS into Gallery's combined css file, added a few admin-level "this module requires the RSS module" messages that get displayed if RSS is turned off, and updated the module.info file so the new links in Gallery 3.0.2 point to the proper pages.

This version of the module has been tested for use with Gallery 3.0.2.

 
laohu99

Joined: 2011-08-24
Posts: 6
Posted: Wed, 2011-08-24 03:47

Hi rWatcher:
Thank you so much for your work.

I have tried to place the embed codes in the album pages, expecting the album pages to show the slide automatically when openned.
How should I get the album item number for xml in the embed codes?

Thanks for your help.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2011-08-24 04:21

If you look at the edit album link at the top of the page, it'll look something like http://www.example.com/gallery3/index.php/form/edit/albums/ALBUM_ID_NUMBER -- the end of the url is the id number for the current album.

 
laohu99

Joined: 2011-08-24
Posts: 6
Posted: Wed, 2011-08-24 04:32

Thank you rWatcher.
I mean, Is there any method to pass the variable ALBUM_ID_NUMBER into the embed code, so that every album can be openned with the slideshow automatically?

 
laohu99

Joined: 2011-08-24
Posts: 6
Posted: Wed, 2011-08-24 05:16

Just now I found the following codes in your minislideshow_dialog.html.php , and tried to insert them into album.html.php of my theme, but it doesnot work.

<embed src="<?= module::get_var("minislideshow", "slideshow_url") ?>" width="485" height="300"
align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" name="minislide" wmode="transparent"
allowFullscreen="true" allowScriptAccess="always" quality="high"
flashvars="xmlUrl=<?= url::site("rss/feed/gallery/album/" . $item_id, "http") ?><?=$slideshow_params ?>"></embed>

What should I do to this $item_id?

Many thanks for your help

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-08-24 13:09
 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2011-08-24 21:19
laohu99 wrote:
What should I do to this $item_id?

Try $item->id or $theme->item->id instead.

 
laohu99

Joined: 2011-08-24
Posts: 6
Posted: Fri, 2011-08-26 06:50

rWatcher:

Thank you very much!

$theme->item->id works.

I m a php beginner.Thank you again for your help.

 
laohu99

Joined: 2011-08-24
Posts: 6
Posted: Tue, 2011-08-30 03:27

Hi rWatcher:

Thank you again . The embed codes work greatly.

BTW, about the rss feeds, if I want minislideshow to show the latest 20 photos of an album, what should the feed's url be like?
Something like "xmlUrl=http://www.lijiangmm.com/gallery/index.php/rss/feed/gallery/album/1/latest" ?

Appreciate your help.

 
riflecn

Joined: 2011-09-03
Posts: 1
Posted: Sat, 2011-09-03 07:19

Thanks for your great minislideshow and hard work.

I have a question and need help:

I have modified the rss module to make xml items be ordered by upadteDate, but items in minislideshow seem still shown in a random order.

Thank you rWatcher.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-09-03 14:04
 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Thu, 2011-09-22 20:35

Hi,
Is there a way please, of inserting code in "minislideshow_dialog.html.php" in order for an mp3 file to play automatically on starting a slideshow in an album,
Thanks,
Ken

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-09-22 21:09
 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Sat, 2011-09-24 22:25

Thanks for the response. As laou99 asked "Is there any method to pass the variable ALBUM_ID_NUMBER into the embed code, so that every album can be openned with the slideshow automatically?"
Can this be done with a sound file please?

I did try the &mp3Url but no sound. The code in "minislideshow_dialog.html.php" contains no & and the whole code is repeated using &quot; around everything. I presume I needed to change both.

I have a minislideshow in my gallery root feeding 2 drupal sites and am putting this minislideshow.swf as the address for the minislideshow module in the modules file. Will this have an effect on the this module's performance,
Thanks,
Ken

www.talkingwalk.com/gallerywalk

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Sun, 2011-10-23 19:10

An afterthought. The album with the sound file is;- http://talkingwalk.com/gallerywalk/TALK-AND-WALK/KEN-ENNION/Wetherlam

Have tried for ages to insert mp3Url code into minislideshow file with no success. Is there another way to do this as it does not seem to be accepted,
Ken
www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2011-10-23 21:33

I've never used the minislideshow module for G3, so I cannot advise on passing extra variables.
But...
As of mini 3.0.1 there is an external javascript function that gets fired when the mini has finished loading and ready to play.

<script type="text/javascript">
    function onMiniSlideShowReady(){
        // Do something...
    }
</script>

So we could have that function load up some audio via html5's great new audio tag:

/**
 * @author suprsidr
 */
function onMiniSlideShowReady(){
    var audio = document.createElement('audio');
    audio.setAttribute('autoplay', true);
    audio.setAttribute('controls', true);
    
    var src1 = document.createElement('source');
    src1.setAttribute('src', 'http://www.flashyourweb.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=44493&g2_serialNumber=2');
    src1.setAttribute('type', 'audio/ogg');
    
    var src2 = document.createElement('source');
    src2.setAttribute('src', 'http://www.flashyourweb.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=44478&g2_serialNumber=2');
    src2.setAttribute('type', 'audio/mpeg');
    
    audio.appendChild(src1);
    audio.appendChild(src2);
    
    document.querySelector('body').appendChild(audio);
}
  • We create an audio element: document.createElement('audio') and set a few attributes
  • Then we create a couple of source elements document.createElement('source') browser support varies for different audio formats, so you should provide at least 2 - mp3 and ogg cover most of the field.
  • then we append our sources to the audio and the audio to some display element like <body /> : document.querySelector('body').appendChild(audio)

Whalah!
example <- please use a modern browser as crappy 'ol IE<9 does not cut it.

Of course there are other advisable steps like testing for html5 audio support and providing a fallback, so if yer interested in that check out my other html5 audio examples.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Sun, 2011-10-23 23:00

Thanks for all of that. I'd love to give it a try but have little idea where to put the code or how to provide a fallback but I'll give it a go tomorrow.
Tried your example in IE9 and it works ok.

I presume any older browsers would not cope so a fallback would be needed,
Ken

www.talkingwalk.com/gallerywalk

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Tue, 2011-10-25 19:29

Hi,
Tried to implement the code suprsidr supplied but now confess I haven't a clue what to do with it. I have upgraded minisldeshow to 3.0.1.

I did however,insert the code below in minislideshow which gave me an item on the settings form to insert an mp3Url. If I give the exact address of an mp3 file it will now play it.
I may be asking the impossible but would it be possible to enable the audio particular to an album to play as does the slideshow on clicking the button.

I inserted in;- modules/minislideshow/comtrollers/admin_minislideshow.php
$str_slideshow_mp3Url = Input::instance()->post("mp3Url");
module::set_var("minislideshow", "mp3Url", $str_slideshow_mp3Url);
at line 64
$group_slideshow_settings->input("mp3Url")
->label(t("mp3Url:"))
->value(module::get_var("minislideshow", "mp3Url"));
at line 122

and into;- modules/minislideshow/comtrollers/minislideshow.php
if (module::get_var("minislideshow", "mp3Url") != "") {
$slideshow_params = $slideshow_params . "&mp3Url=" . module::get_var("minislideshow", "mp3Url"
}
at line 66
Thanks again,
Ken

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2011-10-25 23:41

There is no reason you cannot create a separate slideshow page foe any album.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 16:15

Hi,
Not sure that would help. I maybe need to explain properly. As can be seen by the link;- http://talkingwalk.com/gallerywalk/TALK-AND-WALK/KEN-ENNION/Wetherlam , the audio and photos are in the same album. The intention is a commentary while the slideshow shows. Other albums have different audio and photos so what I'm trying to achieve is, on clicking the slideshow button, both audio and slideshow will start relevant to whatever album is opened.

It seems that the slideshow respnds to "url::site("rss/feed/gallery/album/" . $item_id". Don't know if something similar to the "item_id" is possible for the audio. Am I asking the impossible?
Thanks,
Ken
www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-10-26 16:37
Quote:
"url::site("rss/feed/gallery/album/" . $item_id"

That is the RSS feed that the mini parses to get the photo list.

I actually used to have a version of the mini that would play any mp3 that showed up in the RSS feed, which would make it easy to add album specific audio.
But I discarded that change and G3 RSS feeds don't display audio/mpeg anyways.

You could hand add a custom array to modules/minislideshow/comtrollers/minislideshow.php, something like:

    $audioArray = array(
        // format: 'album id' => 'url to audio'
        '1' => 'http://mysite.com/my_audio1.mp3',
        '6' => 'http://mysite.com/my_audio6.mp3',
        '8' => 'http://mysite.com/my_audio8.mp3',
        '14' => 'http://mysite.com/my_audio14.mp3',
        '16' => 'http://mysite.com/my_audio16.mp3',
        '22' => 'http://mysite.com/my_audio22.mp3'
    );

then your mp3Url would look like:
$slideshow_params = $slideshow_params . "&mp3Url=" . isset($audioArray[$item_id])?$audioArray[$item_id]:'';
Anytime you want to add audio to a new album, just edit the above array and add a new line.
Quite a hack, but works in a pinch.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 19:31

That was quick, thanks. All things were possible once upon a time then!
Have been trying the code in modules/minislideshow/controllers/minislideshow.php as per below (and all sorts of other combinations)but can't make it happen. It still works sticking the Url onto the form.

if (module::get_var("minislideshow", "mp3Url") != ""){
$slideshow_params = $slideshow_params . "&mp3Url=" . isset($audioArray[$item_id])?$audioArray[$item_id]:'';

$audioArray = array(
// format: 'album id' => 'url to audio'
'4838' => 'http://talkingwalk.com/gallerywalk/var/albums/TALK AND WALK/KEN ENNION/Wetherlam/Wetherlam.mp3',
'6' => 'http://mysite.com/my_audio6.mp3',
'8' => 'http://mysite.com/my_audio8.mp3',
'14' => 'http://mysite.com/my_audio14.mp3',
'16' => 'http://mysite.com/my_audio16.mp3',
'22' => 'http://mysite.com/my_audio22.mp3'

);

}
$view->slideshow_params = $slideshow_params;

// Display the slideshow.
print $view;
}
}

Am I doing something wrong?
If we can make it work for me to use great. My problem would then be if and when a registered user wants to do it but I'll cross that bridge if it happens,
Ken
www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-10-26 20:19

try like:

$audioArray = array(
// format: 'album id' => 'url to audio'
'4838' => 'http://talkingwalk.com/gallerywalk/var/albums/TALK%20AND%20WALK/KEN%20ENNION/Wetherlam/Wetherlam.mp3',
'6' => 'http://mysite.com/my_audio6.mp3',
'8' => 'http://mysite.com/my_audio8.mp3',
'14' => 'http://mysite.com/my_audio14.mp3',
'16' => 'http://mysite.com/my_audio16.mp3',
'22' => 'http://mysite.com/my_audio22.mp3'

);


$slideshow_params .= isset($audioArray[$item_id])?"&mp3Url=" .$audioArray[$item_id]:'';

// Display the slideshow.
print $view;
}
}

notice I put %20 in place of the spaces in your url.
also note I removed your condition:

if (module::get_var("minislideshow", "mp3Url") != ""){
$slideshow_params = $slideshow_params . "&mp3Url=" . isset($audioArray[$item_id])?$audioArray[$item_id]:'';
}

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 21:32

Just getting very pixelated photos, no sound,
Ken

www.talkingwalk.com/gallerywalk

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 21:47

and the delay is now the default 3secs instead of my 10secs.
Have removed all other references to mp3Url.

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-10-26 21:52
 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 22:02

Magic. The $view-> was missed out.
Still got very pixelated photos though. I was getting this when I had inserted the previous code and when I put a mp3Url into the form. If I removed it photos returned to normal,
Ken

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-10-26 22:07

make sure useFull is set in minislideshow settings

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 22:18
 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-10-26 22:21

I updated the above attachment was overwriting the other params

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 22:33

It is indeed just like magic. Works great and I look forward to playing.
One last question if I may. Where do I set the width of the box in which the photo is displayed. Changed the photo size to 900x900 but the box stays narrow,
Ken

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-10-26 22:45

I changed the height and width in modules/minislideshow/views/minislideshow_dialog.html.php
and like you only the height was affected.
Maybe a bug?
Start a new thread with a relevant title.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-26 22:48

Once again, many thanks,
Ken

www.talkingwalk.com/gallerywalk

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Sat, 2011-10-29 16:41

hi,
The mp3Url is self explanatory but can, for instance, .wav be added,
Thanks,
Ken

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-10-29 17:47
 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Sun, 2011-10-30 19:57

Really pleased with the results on my computer but on using 2 other computers I find that the minislideshow hangs with "Loading 1/0". Have latest Flash, Mozilla and IE8. Been trying to solve this for some time with no success so, apologies for coming back yet again and hope you can help,
Ken

www.talkingwalk.com/gallerywalk

 
mervyngroves

Joined: 2008-08-03
Posts: 92
Posted: Sun, 2011-10-30 20:55

I experienced the same issue but only when minislideshow is associated with Gallery3. I usually use Chrome but it occurs in the other browsers too.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2011-10-30 23:21

I just rewrote minislideshow_dialog.html.php to utilize gallery3's swfobject to embed the mini.
This may help your issue. If not pass me a link to offending album.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Mon, 2011-10-31 14:33

Made the changes but no change. Ok on my computer. On other computers the "Loading 1/0" for the photos appears. A link below but it is the same on all albums that I checked,
Thanks,
Ken

http://talkingwalk.com/gallerywalk/TALK-AND-WALK/KEN-ENNION/Wetherlam

www.talkingwalk.com/gallerywalk

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2011-11-01 02:10

Sorry, works fine on all six of my PCs including my netbook and crappy mac.
I cannot diagnose an issue I cannot see.

Can those browsers view the feed: http://talkingwalk.com/gallerywalk/rss/feed/gallery/album/4838

Have you tried uninstalling flash and re-installing?
http://kb2.adobe.com/cps/141/tn_14157.html
http://www.adobe.com/support/flashplayer/downloads.html

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2