Hi
I have just downloaded this release and applaud the removal of tables. This means that we are not limited to a fixed no. of columns. As I needed a quick way of doing this I simply did not calculate the ul width (line 324 of brilliant_gallery.module) if 0 columns were specified which still gives me the flexibilty of specifying a number of cols if I wish.
if ($columns <> '0'){
$style_ul = "width: " . ( ( $imagewidth + 2*$padding ) * $columns ) . "px;"; # Total 'width' controls the number of thumbnails in each row. The number, in pixels, should be calculated thusly: [maximum width desired for thumbnails] + [padding - if any, x 2] + [margin - if any, x 2] + [border - if any, x 2] x [number of thumbnails desired in each row]
}
You can see this in action by comparing http://www.seangates.co.uk/node/607 and http://apps.facebook.com/gatesworld/node/607
Comments
Comment #1
seangee commentedI have just downloaded the latest release to test. This is still a request for me and I have re-applied my change so that maximum columns = 0 allows the desired behaviour. Any chance of including this in a future release?
Comment #2
totkoo commentedI would also like to see this implemented as it's a very usefull feature and something I'd use.
Comment #3
venture_into_a_new_realm commentedSean,
I implemented this and it worked however just to clarify, this occurs in lines 665 & 666 of the original code in brilliant gallery version 6.x-3.0. The final code should look something like this when you add the "if" statement on the line above it and the "}" on the line below it. I show the additions of code in bold below:
if ($columns <> '0'){
# Total 'width' controls the number of thumbnails in each row. The number, in pixels, should be calculated thusly: [maximum width desired for thumbnails] + [padding - if any, x 2] + [margin - if any, x 2] + [border - if any, x 2] x [number of thumbnails desired in each row]
$style_ul = "font-size:0; margin:0px; padding:0px; width: ". (($imagewidth + 2 * $padding) * $columns) ."px;";
}
Thanks
-Dave
Comment #4
jason331 commentedHi everyone, I'm a complete Drupal newbie so please bear with me.
How do I implement the code listed above? I've tried copying and pasting it into my brilliant_gallery.module but still can't get my pictures to auto-wrap. Here is what my current brilliant_gallery.module file looks like:
Line 665: "where nid='$nid' and qid like 'user-%' and user='$uid' ");
Line 666: */
Line 667:
Line 668: $dbresult = db_query("select qid from brilliant_gallery_checklist where qid like 'user-%' and state='1' ");
Line 669: while ($data = db_fetch_object($dbresult)) {
Line 670: $excludedimgs[] = $data->qid;
Line 671: }
Line 672: #print_r($excludedimgs);
Line 673:
Line 674: # Total 'width' controls the number of thumbnails in each row. The number, in pixels, should be calculated thusly: [maximum width desired for thumbnails] + [padding - if any, x 2] + [margin - if any, x 2] + [border - if any, x 2] x [number of thumbnails desired in each row]
Line 675: $style_ul = "font-size:0; margin:0px; padding:0px; width: ". (($imagewidth + 2 * $padding) * $columns) ."px;";
Line 676: $column_count = 0;
Where should I be pasting in the extra lines code to enable automatic gallery wrapping?
Comment #5
vacilando commentedGood idea! Just committed it to the dev version.
So setting maximum column number count to 0 (zero) now allows the gallery to automatically fill all the available space on the page.