Integrate ThickBox into {ImageGallery} tag (and other mods)

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Integrate ThickBox into {ImageGallery} tag (and other mods)

Post by kermit »

This modification replaces function.ImageGallery.php found in ./plugins. It requires that you place the requisite ThickBox scripts and CSS in your template or in the page metadata where the new ThickBox parameter is to be used. See the ThickBox site for those files and instructions.

Something like:

Code: Select all

<__script__ type="text/javascript" src="uploads/thickbox/jquery-latest.js"></__script>
<__script__ type="text/javascript" src="uploads/thickbox/thickbox.js"></__script>
<link rel="stylesheet" href="uploads/thickbox/thickbox.css" type="text/css" media="screen" />
When you put styles into a page's metadata, I suggest putting {stylesheet} BEFORE {metadata} in your template to ensure the added styles are not overridden by the template styles.

How to use:

Works just like the {ImageGallery} tag does now; but there's a new parameter, ThickBox, to enable ThickBox links on either 'thumbs' (the thumbnail pages) or the 'bigpic' (the generated single-pic page).. and do not specify a 'type' (i.e. click vs popup). Simply add ThickBox='thumbs' or ThickBox='bigpic' to the {ImageGallery} tag. If ThickBox is omitted, the tag will function as if it were unmodified.

Make a backup of your original function.ImageGallery.php and put somewhere outside the ./plugins directory; rename the .txt file attached to this post to a .php file and upload to ./plugins

This is released as WFM and YMMV ("works for me" and "your mileage may vary"). Base was the ImageGallery plugin as found in the CMSMS 1.2 core.
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by kermit on Mon Nov 19, 2007 2:45 am, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Integrate ThickBox into {ImageGallery} tag (and other mods)

Post by kermit »

after a few more hacks, I finally got {ImageGallery} output the way I want it.. added are:

ScrollNextPrev to optionally insert in-page anchors on links from thumbnails and prev/next links (use to scroll next page right to the image).. eg. appends #content (or whatever you specify for the ID) to those links

NumberInRow to optionally wrap a defined number of thumbnails in a for additional styling. The default layout and styles would create 'holes' in the thumbnail pages if captions or images weren't all the same height. this allows you to clear the 'row' above and start 'fresh' for each row; or apply additional styling. This also allows you to remove absolute thumbnail height from the CSS and avoid squished or squashed-looking thumbnails and still keep some order to the thumbnail layout..

BigPicWidth to optionally insert bigPic's width and height in the img tag instead of relying on CSS alone to constrain larger images to a set size (height is auto calculated, keeping proper aspect ratio). Had problems where IE wouldn't always keep the correct aspect ratio using CSS alone to constrain larger images to fit the space of a bigPic (defined width and auto height in CSS)... this fixed that.


a sample tag:
{ImageGallery picFolder="uploads/images/photos/TheBand/Spring07Tour/" ThickBox='bigpic' ScrollNextPrev='content' BigPicWidth='410' NumberInRow='3'}



plugin with all four mods is attached...
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by kermit on Fri Nov 30, 2007 10:46 am, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
alvin
Forum Members
Forum Members
Posts: 23
Joined: Thu Dec 20, 2007 8:28 pm

Re: Integrate ThickBox into {ImageGallery} tag (and other mods)

Post by alvin »

Kermet,  Are you still monitoring this theard?

AM
Post Reply

Return to “Tips and Tricks”