Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Fix for Blank User Defined fields being Displayed  (Read 4260 times)

0 Members and 1 Guest are viewing this topic.

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
Fix for Blank User Defined fields being Displayed
« 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
Code: [Select]

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
Code: [Select]

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....
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 18 queries.