Module: Carousel

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2010-06-06 05:26

Inspired from jCarousel lite a new module to add items to the sidebar in a vertical carousel.

http://codex.gallery2.org/Gallery3:Modules:carousel

Known issues:
* Random query does not return all items it should for small galleries. Larger ones seems fine.
* Buttons need better positioning or remove altogether and only use mouse wheel.
* Thumbs get slightly distorted/clipped.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Fri, 2010-06-25 08:25

Why you chose the sidebar for it? it would be better to be placed horizontally under the resized photo, IMHO. Is it easy to modify that?

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Fri, 2010-06-25 09:32

I've realized that this module is intended to show random/recent/popular items, rather than make you able to navigate the photos beside the one you are viewing. It will be really nice if you could add navigation functionality as well as an option to show the thumbnails below the resized photo.

Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2010-06-25 13:58
Quote:
Why you chose the sidebar for it?

Because that is what I wanted it to do.
I will consider making another similar module to add a horizontal carousel under the photos.

Quote:
It will be really nice if you could add navigation functionality as well as an option to show the thumbnails below the resized photo.

Then it would not be a carousel then would it? Sounds to me like you want some thumb-navigation.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2010-06-27 07:13
mamouneyya wrote:
Why you chose the sidebar for it? it would be better to be placed horizontally under the resized photo

I have started on creating another module to go under the thumbs and photos.
There is some bugs to work out and some css love is required but it is functional.
Here is what I have so for:
http://www.langleycom.com/gallery3/index.php/ see the bottom.
I will start a new thread once I have some more time.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Thu, 2010-07-01 23:34

Looks like you disabled it, as I don't see anything similar in the bottom of the items in your site. Anyway, I am thankful you are working on that :)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2010-07-03 03:49

Updated the module.
* mouse wheel navigaton
* hover pause if auto scrolling
* removed nav buttons
* auto start
* Half item to represent more items.

Use the above attachment.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Lord Beowulf
Lord Beowulf's picture

Joined: 2010-03-31
Posts: 56
Posted: Tue, 2010-07-06 02:49

Hey Dave,

Looks pretty good, but I've found at least one minor bug and possibly another. The one is simply that if you re-enter the module configuration page with the "autoscroll" option checked, the fields associated with it aren't enabled. You have to uncheck and recheck to enable them. Again, minor, but anyway... BTW, what's the scale on those numbers for the scroll control? Seems like it's maybe milliseconds?

The other behavior that to me looks like a bug, but may be intended is that with autoscroll off, the images all filled the bar in a column as opposed to being a single image that you could rotate through. Was that what was supposed to happen?

At any rate, great start and I look forward to seeing this one grow!

Thanks,

Beo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-07-06 03:37
Quote:
You have to uncheck and recheck to enable them. Again, minor, but anyway...

yes it takes a bit of code to fix, no time to fix care to take a crack at it?

Quote:
Seems like it's maybe milliseconds?

I think so. Don't know for sure as I anm using a 4th party bit of code.

Quote:
the images all filled the bar in a column.....Was that what was supposed to happen?

No it is not intended. It does not function properly.

I am thinking of dropping this 4th party JS code as it conflicts with the other carousel module.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Lord Beowulf
Lord Beowulf's picture

Joined: 2010-03-31
Posts: 56
Posted: Tue, 2010-07-06 03:59

Hey Dave,

If I have the time, my first priority would be to adjust the maximum limits on the scroll timing, but if you're considering changing the underlying code then maybe I should hold off. However, any adjustments I manage to make I'll be sure to feed back to you. Thanks again for all your hard work.

Beo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2010-07-09 01:22

Fixed the (u)hiding / (dis)able of the times if the auto scroll is selected.
Adjusted the maximum time for the two fields as well.

Quote:
The other behavior that to me looks like a bug, but may be intended is that with autoscroll off, the images all filled the bar in a column as opposed to being a single image that you could rotate through.

I don't see that behavior now.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Lord Beowulf
Lord Beowulf's picture

Joined: 2010-03-31
Posts: 56
Posted: Sat, 2010-07-10 15:36

Hey Dave,

Found a bug in the carousel views. You're using "autostart" for the field in the admin page, but just "auto" on the views, so that field doesn't do anything. The fix is:

$auto 		= module::get_var("carousel", "autostart", "800");

Beo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2010-07-10 19:09

Thanks for keeping me on my toes!
Fixed in the above attachment.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Mon, 2010-08-02 08:57

Hi Dave,
Regarding the incompatibility with navcarousel module: I did a fresh install of Gallery 3 and was able to repro immediately. Your module doesn't initialise and neither does mine.
I am getting two JS errors:
eval(function (p, a, c, k, e, d) { [...] )) is not a function
(which is the jcarouselliste.js)

and
jQuery("#navcarousel").jcarousel is not a function
(which is the initialisation of for jCarousel used by my module)

Now if I modify your module so that it used the minified version of jcarousellite instead of the packed one it starts working. I have posted the modified files here and asked Lord Beowulf to test.

Uli

---
Build bridges not barriers.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-08-02 15:38

Thanks, I am following the other thread as well and when Lord Beowulf reports back positively, I will update my module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Mon, 2010-08-02 16:34

I know. Sorry for the double post.

Oh and thanks for this really cool module :D

Uli

---
Build bridges not barriers.

 
Lord Beowulf
Lord Beowulf's picture

Joined: 2010-03-31
Posts: 56
Posted: Tue, 2010-08-03 00:33

I know you're following the other thread too, but it looks like it's working great now. Thanks to both of you for some great work.

Beo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-08-03 01:08

hukoeth & Lord Beowulf,
Thanks for your testing and feedback. I have updated the above .zip file to use the minified version of the JS and also found a bug where I did not have the mousewheel setting on the admin page.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Armani2

Joined: 2007-05-09
Posts: 263
Posted: Fri, 2011-01-07 02:48

Is there any reason why this module in which i have above my photo pages, would cause the site to become very sluggish when the album has many photos? I have one album with 30 or so photos and i see no sluggishness, when i load a photo from a album with 170 photos, it takes a long time for each photo to load?
Does anyone have any insight on this....
Thanks..
Marcus..
www.armaniphotography.com/gallery

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-01-16 19:32

Updated the zip file on the codex page to reflect the recent changes.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
MarkRH

Joined: 2007-05-25
Posts: 241
Posted: Tue, 2011-02-15 12:02

Was trying out this module as replacement for the ImageBlock module and I noticed that the check boxes for "Show on album & collection pages" and "Show on photo pages" on the settings page always seem to be checked even if I uncheck the photo pages option and save the settings. When I return back to the settings page, they are all checked again instead of reflecting their true state of being unchecked in the database.

Behavior wise, the images are not shown on the Photo pages like I set it, it's just the Settings page not reflecting the Saved state.

In my case I just show the number of images I want and turn off mouse scrolling; however, the tooltip still says to "use the mouse wheel to scroll" when it doesn't actually do anything. I'll probably just go into the code and change it to show the photo title or something.

Anyway, thought you'd like to know.

Thanks,
Mark H.

Using Gallery 3.0.1 - gallery.markheadrick.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-02-19 05:41

Thanks for the feedback. Does the attached work better?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-03-19 01:29

Well? does it work better?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
MarkRH

Joined: 2007-05-25
Posts: 241
Posted: Tue, 2011-03-22 20:14

I'm sorry.. I've been caught up playing the new EverQuest 2 expansion LOL. This code does seem to work better. The state of the check boxes now seem to reflect their saved value.

Oh, since I've configured it not to show anything on the actual photo pages, it seems like Google is indexing things much better. The images google is showing actually points to the page where the photo is.

Thanks,
Mark H.

Using Gallery 3.0.1 - gallery.markheadrick.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2011-03-24 00:04

Thanks,
I updated the download for the codex page with the above version.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
IainY

Joined: 2011-03-28
Posts: 6
Posted: Mon, 2011-03-28 14:18

Hello,

I have included the Carousel module, but I have a couple of queries about it.

When set to autoscroll, the Random Items block works fine, but the images in Recent and Popular Items just show the top x pixels where x seems to be proportional to the width set. Have I missed a setting somewhere? (Very likely!)

Secondly the "scroll using mouse" option doesn't seem to work in IE7 (strictly speaking in Compatibility View when using IE8) - all the images are shown, instead of the number set in the options. The full thumbnails are shown in this case however, not just the cropped images.

My implementation of Gallery is at http://modelmasterdecals.com/Gallery/index.php.

I like the module very much - and so does the Site Owner, which is much more important! - but I would like to be put right about the way I am using it.

Thanks,

Iain

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-03-28 14:41
Quote:
When set to autoscroll, the Random Items block works fine, but the images in Recent and Popular Items just show the top x pixels where x seems to be proportional to the width set. Have I missed a setting somewhere? (Very likely!)

I think it has to do with the very unusual aspect ratio you are using. I could be wrong but what if you have a taller item as the recent item?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
IainY

Joined: 2011-03-28
Posts: 6
Posted: Mon, 2011-03-28 15:07
Quote:
I think it has to do with the very unusual aspect ratio you are using. I could be wrong but what if you have a taller item as the recent item?

Dave

Hi, thanks very much for the feeback.

It certainly seems to have something to do with that. I deleted all the "unusual" items and everything was fine. I then put one of them back and now the Recent Items are fine but the Popular and Random Items are not.

I haven't tried the scrolling issue again. Do you think that is connected too?

The offending images do indeed have an unusual aspect ratio, so if we use more "normal" items throughout maybe everything will be OK. The images I picked were really just the first ones that came to hand. Unfortunately some of those which might be likely to be used in practice also have somewhat unusual aspect ratios.

Thanks again,

Iain

 
IainY

Joined: 2011-03-28
Posts: 6
Posted: Mon, 2011-03-28 15:29

Hello,

Back again!

I have deleted the offending images again and added a new Album whose images are an assortment of aspect ratios and sizes; everything looks OK in autoscroll mode. It looks as though there was something special about those earlier images which caused a problem. Maybe we'll just have to manipulate unusual images if it is felt essential to include them at all.

Sadly, the IE7 problem hasn't been resolved, but the site owner likes the automatic scrolling anyway!

Regards,

Iain

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-03-29 03:57

I have zero interest in supporting IE.
I might be interested in in attempting to support a very unusual aspect ratio. However it is low in the priority list.
How do you expect the the behavior to work? Should the <div> get bigger as the next item shows? or should the height of the <div> be determined by the largest/tallest item in the whole album/gallery?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
IainY

Joined: 2011-03-28
Posts: 6
Posted: Tue, 2011-03-29 14:00
Quote:
How do you expect the the behavior to work? Should the <div> get bigger as the next item shows? or should the height of the <div> be determined by the largest/tallest item in the whole album/gallery?

Dave

Hello,

Thanks for your interest. I suppose in an ideal world the <div> should get bigger as required when the next item shows, but I don't see a problem if it is easier to simply fix the <div> height in advance by reference to the largest/tallest item in the whole gallery (rather than in a given album since multiple albums would normally be used to generate the display). To my mind, the main objective would be to show the whole or as much as possible of the image in every case which the latter approach would achieve.

I understand that this change could not be given high priority.

Thanks again.

Regards,

Iain

 
Rien Post

Joined: 2011-03-29
Posts: 1
Posted: Tue, 2011-03-29 15:08

That's exactly what I needed to have a "latest entry" thumbnail in my sidebar (www.rienpost.com). Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-04-03 06:37
Quote:
I don't see a problem if it is easier to simply fix the <div> height in advance by reference to the largest/tallest item in the whole gallery

The simple solution is almost always the way to go.
Add:

#g-carousel-rec {
height: 200px;
}

and adjust the height as needed.
#g-carousel-pop
#g-carousel-ran
will need some as well.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Armani2

Joined: 2007-05-09
Posts: 263
Posted: Sun, 2011-04-03 11:57

Do you have any Ideas why Nav Carousel Is so sluggish with albums over say 400 photos? I have tried everyting...
with albums of say 300 photos It works great,I have one album with 700 photos and its a good 4 seconds to load the photo
the the Carousel loads fast??
I really need this to work on the large albums where users can keep scrolling until they find the photo they want...
Please take a look ...
Thanks...
http://www.armaniphotography.com/gallery/index.php/Head-Of-The-Lagoon-20102/IMG_3693

 
IainY

Joined: 2011-03-28
Posts: 6
Posted: Sun, 2011-04-03 12:10
Quote:
The simple solution is almost always the way to go.
Add:

#g-carousel-rec {
height: 200px;
}

and adjust the height as needed.

It must be too simple for me, nothing changes! For the avoidance of doubt, I have added the above to http://modelmasterdecals.com/Gallery/modules/carousel/css/carousel.css. Is this right?

Thanks very much for your further input.

Regards,

Iain

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-04-04 01:59

I don't see any of that css when viewing your site. I bet that the css was used durring devlopment and is not used. Try adding the code to your themes css.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
IainY

Joined: 2011-03-28
Posts: 6
Posted: Mon, 2011-04-04 16:29
Quote:
Try adding the code to your themes css.

I have added the code to the screen.css file in the folder for my chosen theme - still no good I'm afraid. Is there anywhere else I could put it? Is it possible that the problem is theme dependent? I'll try your suggestion in another theme to see if that helps. Maybe the simple solution just isn't going to work.

Regards,

Iain

 
Armani2

Joined: 2007-05-09
Posts: 263
Posted: Tue, 2011-04-05 08:20

Dave Can you take a look Please? I have asked about this many times??????????
If you dont know , Just say that....

http://www.armaniphotography.com/gallery/index.php/Head-Of-The-Lagoon-20102/IMG_3693

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-04-06 03:03
Armani2 wrote:
Do you have any Ideas why Nav Carousel Is so sluggish with albums over say 400 photos?

No.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
MarkRH

Joined: 2007-05-25
Posts: 241
Posted: Wed, 2011-04-06 04:42

Noticed the following bug in /carousel/views/carousel_random.html.php:

<? foreach ($photos as $photo): 
	if (module::get_var("carousel", "mousewheel") == true) {
		$ctitle = "Use mouse wheel to scroll!";
		} else {
		$ctitle = title;
	}
	?>

$ctitle = title; should be $ctitle = $photo->title;

I also happened to discover that IE9 shows all 5 images instead of the 3 or 1 image that I set as being the height of the carousel if IE9 is set to compatibility mode (to see how things looked with older browsers). To get around this, I went into Settings -> Advanced and set the quantity values to 1 and 3 instead of 5. Now both modes of IE9 show the correct amount of images. But.. my case is special as I'm not really using this as a scrollable carousel but something to control where I display a set number of recent and random images on the sidebar.

Regards,
Mark H.

Using Gallery 3.0.1 - gallery.markheadrick.com

 
Armani2

Joined: 2007-05-09
Posts: 263
Posted: Wed, 2011-04-06 07:04
floridave wrote:
Armani2 wrote:
Do you have any Ideas why Nav Carousel Is so sluggish with albums over say 400 photos?

No.

Dave

Thanks Dave I Am Happy to see you show your childish Side!
Better go to bed it is a school night LOL....
___________________________________________

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2011-04-21 21:40
MarkRH wrote:

$ctitle = title; should be $ctitle = $photo->title;

Cheers! fixed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jaywa

Joined: 2011-11-16
Posts: 5
Posted: Thu, 2011-11-17 04:13

I modified the JCarouselLite JavaScript code to allow for a much better presentation of the photos in case of different aspect ratios (e.g. mixed portrait and landscape orientation).
I have performed only limited testing so far, namely for the following settings:
Browser: Chrome 15 (ezcellent) and Firefox 3.6.23 (very slow, anyway not recommended since rounded corners and other screen candy is not supported)
Number of thumbs to show: 1.5
Size of thumbs: 200px

Use at own risk :-)

Instructions:
Make a backup copy of jcarousellite.min.js in the gallery3/modules/carousel/js folder.
Download and extract the attached zip file and replace the original jcarousellite.min.js file.
--> That should be all.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2011-11-18 01:05

Cheers!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2011-12-19 04:59

Hi Dave,

This is a really cool module, it is working well, smooth and clean.

About the popular items : on what base is this working ? The number of time the photo page has been viewed ?

Thank you in advance for your answer

------

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-12-19 14:40

Popular is done with this bit of code in the view file:

$photos		= ORM::factory("item")->viewable()
        ->where("type", "!=", "album")
		->order_by("view_count", "DESC")
		->find_all($quantity);

So it looks to see if the user has permission to view the item(s)
make sure the items are not albums
orders by view count
and finds the quantity you want.
Does it not work properly?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2011-12-19 23:44

It seems to work well, I was just asking that because of the albums... I have so many on the website.
So what if an album gets listed in the carousel ? Is its thumbnail going to appear ?
What if we click on it, are we redirected on the listing page ?
I guess I could leave with that, although I am affraid albums are going to take all the places of the carousel in the long term.

Is there no way to list albums out of the carousel ?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-12-20 02:03
floridave wrote:
Only items are chosen not albums.

If you want albums to show you would have to edit the code to not make that check.

If an album gets listed in the popular carousel, then I'm making a mistake in the code as I understand how it works.

Dave
___________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Tue, 2011-12-20 02:53

So far I only get items...so it seems to work properly :-)

Thank you for this module Dave, it is really a nice one

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2011-12-26 06:56

Hello

I was wondering if there is any RSS feed for this module, and if yes which one is it ?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-01-01 21:21

@more rss feeds: http://gallery.menalto.com/node/95073

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team