coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1d PHPnuke Support (deprecated) => Topic started by: gtroll on September 26, 2003, 08:58:40 AM

Title: Fix for Blank User Defined fields being Displayed
Post by: gtroll on September 26, 2003, 08:58:40 AM
I am using the user defined field and config is set to "Picture information are visible by default" and when the field is blank coppermine will display the field name with no value.
This code will make it so only fields with a value are displayed.
Line 231 displayimage.php
Replace
for ($i =1; $i<= 4; $i++){
      if ($CONFIG['user_field'.$i.'_name']) {
            $info[$CONFIG['user_field'.$i.'_name']] = make_clickable($CURRENT_PIC_DATA['user'.$i]);
      }
   }

With
for ($i =1; $i<= 4; $i++){
      if ($CONFIG['user_field'.$i.'_name']) {
          if($CURRENT_PIC_DATA['user'.$i] != ""){
            $info[$CONFIG['user_field'.$i.'_name']] = make_clickable($CURRENT_PIC_DATA['user'.$i]);
         }
      }
   }

This will probably work with other versions of coppermine but it hasn't been tested....