This patch removes a notice or two from variables that are used but possibly not defined. Also, it fixes a bug where no album direction is set (the user wishes to use 'files' as their album root.)

@@ -243,8 +245,13 @@ function render_brilliant_gallery( $this
              #form_set_error('yemail', t('Header injection attempt detected.  Do not enter line feed characters into the from field!'));
              return 'Main gallery folder path must not begin or end with a slash; please fix it in the <a href="/admin/settings/brilliant_gallery">settings page</a>.';
            }
-        if ( $thisfolder <> '' ) {
-             $galleryfolder .= '/' . $thisfolder;
+        if ( $thisfolder <> '') {
+            if ($galleryfolder <> '') {
+              $galleryfolder .= '/' . $thisfolder;
+            }
+            else{
+              $galleryfolder = $thisfolder;
+            }
            }
         if ( $colcountoverride == '' ) {
              $columns = variable_get('brilliant_gallery_maxcol', 3);
@@ -266,12 +273,12 @@ function render_brilliant_gallery( $this
            } else {
              $bgcolour = $colouroverride;
            }     
-        if ( $captionyesornot == 'yes' or $captionyesornot == '' or ( variable_get('brilliant_gallery_caption', '') <> '' and $captionyesornot <> 'no' ) ) {
+        if ( $captionyesnotext == 'yes' or $captionyesnotext == '' or ( variable_get('brilliant_gallery_caption', '') <> '' and $captionyesnotext <> 'no' ) ) {
              $showcaption = 'filename';
-           } else if ( $captionyesornot == 'no' ) {
+           } else if ( $captionyesnotext == 'no' ) {
              $showcaption = '';
            } else {
-             $showcaption = $captionyesornot;
+             $showcaption = $captionyesnotext;
            }
         $padding = variable_get('brilliant_gallery_padding', 3);
         $overbrowser = variable_get('brilliant_gallery_overbrowser', 'thickbox');
@@ -372,9 +379,11 @@ function render_brilliant_gallery( $this
                          #$smallenough = false;
                          $imgw = $retval_dimensions[$poct-1]['imgw'];
                          $imgh = $retval_dimensions[$poct-1]['imgh'];
-                         $imgwbig = $retval_dimensions[$poct-1]['imgwbig'];
-                         $imghbig = $retval_dimensions[$poct-1]['imghbig'];
-                         $smallenough = $retval_dimensions[$poct-1]['smallenough'];
+                         @$smallenough = $retval_dimensions[$poct-1]['smallenough'];
+                         if ($smallenough !== true) {
+                          $imgwbig = $retval_dimensions[$poct-1]['imgwbig'];
+                          $imghbig = $retval_dimensions[$poct-1]['imghbig'];
+                         }
                          $style_li = "float: left; width: " . $imagewidth . "px; list-style: none; background: " . $bgcolour . "; height: " . $imagemaxh . "px; padding: " . $padding . "px; text-align: center; margin: 0; border: none;"; #$style_li = "float: left; list-style: none; background: #000; width: 44px; height: 33px; padding: 4px; text-align: center; margin: 0; border: none;";
                          $result .= ('<li style="' . $style_li . '">' . "\n");
                          # Get this module's path:

I hope this helps. I apologize if these have already been fixed. If you have any questions, please let me know.

jrp

Comments

Vacilando’s picture

Status: Active » Fixed

Thanks, pletcher -- I had to iron some problems stemming from the files root browsing, but it was worth it -- good idea, good code! See it all applied in upcoming 6.x-2.0.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.