Creating Gallery From Db Results

Hi,

I’d like to create a photo gallery from database data - I’m storing there paths to photos, and some additional information.

The things it should have:

  • clickable thumbnails

  • paging

  • ajax loading of the pages, and images also

  • if possible, preloading next page photos

What I know how to do is displaying the images with CListView with paging.

I’d like to ask what would be best practice to do the other things (and how to structure it), so it could be easily maintained, cause I’ve already tried to create it using regular gallery, but failed to integrate it to Yii the way I’d like to (ajax, preloading, paging,…)

Should I make some widget for it or are there other options?

Any idea please?