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: Upload form: additional explanations below the textfields  (Read 2993 times)

0 Members and 1 Guest are viewing this topic.

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Upload form: additional explanations below the textfields
« on: June 22, 2006, 05:58:53 am »

Hello all,

our mushroom club manages pictures with CPG in the future. For that I want to give the uploaders some little instructions how to arrange the content in the file-information-textfields of the upload form as is to be seen at the screenshot. I think that the changes are to be made in upload.php, but I don't know, how I can do this. ???

Could anyone help me please, to insert the explanations below the textfields?

Thanks before!

Regards, AK
« Last Edit: June 22, 2006, 06:59:05 pm by GauGau »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Upload form: additional explanations below the textfields
« Reply #1 on: June 22, 2006, 08:46:53 am »

Edit upload.php

Add

Code: [Select]
function form_textfield_desc($text) {
    echo <<<EOT
        <tr>
                <td class="tableb">
                        &nbsp;
                </td>
                <td class="tableb" colspan="2">
                        $text
                </td>
        </tr>

EOT;
}

just before

Code: [Select]
// The form statement creation function. Takes a non-array element form $data as its argument.
function form_statement($text) {

then Add

Code: [Select]
                case 5 :
                    form_textfield_desc($element[0]);
                    break;

just before

Code: [Select]
                // If the type is not present, kill the script.
                default:
                    cpg_die(ERROR, $lang_upload_php['reg_instr_1'], __FILE__, __LINE__);

then Add

Code: [Select]
array("description for pic title", "", 5),

just before

Code: [Select]
array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length'], (isset($iptc['Caption'])) ? $iptc['Caption'] : ''),

and lastly Replace

Code: [Select]
    if(!empty($CONFIG['user_field1_name'])) {
        $form_array[] = array($CONFIG['user_field1_name'], 'user1', 0, 255, 1);
    }

with

Code: [Select]
    if(!empty($CONFIG['user_field1_name'])) {
        $form_array[] = array($CONFIG['user_field1_name'], 'user1', 0, 255, 1);
        $form_array[] = array("description for first user field", "", 5);
    }

There are 4 blocks for 4 user fields. You can add
Code: [Select]
$form_array[] = array("description for first user field", "", 5);
in all 4 blocks to show descriptions for all 4 user fields.

Also change the descriptions as per you need in above code. The text strings can also go in lang file if you intend to use more than one language.


HTH
Abbas
Logged
Chief Geek at Ranium Systems

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Upload form: additional explanations below the textfields
« Reply #2 on: June 22, 2006, 12:14:40 pm »

Hello Abbas,

much thanks for your instructions - the mod is working very well.

You're awesome!

Regards, Andreas
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Upload form: additional explanations below the textfields
« Reply #3 on: June 22, 2006, 12:21:10 pm »

good job Abbas
Karma ++
Logged
‍I don't answer to PM with support question
Please post your issue to related board
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.