News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Fix for Blank User Defined fields being Displayed

Started by gtroll, September 26, 2003, 08:58:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gtroll

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....