I'm a sucker for CS mods, no question. Now that I'm using CS 1.1 I'm seeing things I have to play with.
Tonight I was looking at the CSGalleries home page on my site. I like the new CS 1.1 random image shown in the Gallery Details block, but ya know, it just wasn't finished. Why couldn't I click on it to see the enlarged and original images? So I added a hyperlink by overriding the base GalleryImage Render(HtmlTextWriter) method in the RandomPicture class.
But that was too simple a mod. Why can't I display more than one random image, complete with hyperlinks? Now I had a mod! To do that I created a RandomPictures class which essentially spits out a Picture[] array of random pictures rather than a single image.
The method I added to the Galleries.Components.Pictures class looks like this.
public static Picture[] GetRandomPictures(int galleryID, int categoryID, int picNumber)
{
Picture[] pictures = new Picture[picNumber];
int postID;
for (int i = 0; i < picNumber; i++)
{
postID = GalleryDataProvider.Instance().GetRandomPostID(galleryID, categoryID);
pictures[i] = GetPicture( postID );
}
return pictures;
}
Here is the Gallery Details block before and after the mod. Here is my CSGalleries Home Page for the real deal. If you're interested in the mod, I zipped up the essentials here.