Upload form: additional explanations below the textfields Upload form: additional explanations below the textfields
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Upload form: additional explanations below the textfields

Started by AK_CCM, June 22, 2006, 05:58:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AK_CCM

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

Abbas Ali

Edit upload.php

Add


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

EOT;
}


just before


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


then Add


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


just before


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


then Add


array("description for pic title", "", 5),


just before


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


and lastly Replace


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


with


    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

$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
Chief Geek at Ranium Systems

AK_CCM

Hello Abbas,

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

You're awesome!

Regards, Andreas

Sami

‍I don't answer to PM with support question
Please post your issue to related board