Auto-Fill Album Fields - Help Needed Auto-Fill Album Fields - Help Needed
 

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

Auto-Fill Album Fields - Help Needed

Started by mirdonamy, September 23, 2007, 09:48:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mirdonamy

Hi there,

Is there a way to auto-fill album fields when editing the image information for an album? 

For instance, I have a custom field called "Locations" (which I made in config).  For a trip called "Trip to Las Vegas," I'd like to auto-fill all 200+ photos with "Las Vegas, NV" as the Location rather than copying/pasting it into every single image's 'Location' field.

Does anyone kno:
1. if this is possible; and if so,
2. how to do this?

Thank you so much, in advance,
~ Arielle :)

mirdonamy

I would really appreciate some help on this issue.

Thanks :)

Joachim Müller

Change the default value by editing the core code of modifyalb.php. However, this is probably not what you're up to - I raather guess that you're looking for a solution to batch-modify several pics at once. This can not be accomplished using the Coppermine user interface. Instead, run a query directly on the database using a tool like phpMyAdmin.
Post a link to the example aplbum you refer to.

mirdonamy

The picture I included is the example.  When I upload photos (batch), I go to edit photos and then start typing in the title, description, location, date, etc.  I added location and date myself as new fields in the config area.  Anyhow, I have a lot of photos that will be the same date (a birthday party) or same location (my apartment).  I want to be able to fill in the location one time, and have all 200 photos that are in that album have that location without me having to copy and paste.  I'd like to do this with the interface rather than take an extra step every single time I update an album.. having to go to PhpMyAdmin and do it.  I don't even know how to to do that.

Please help!

Nibbler

Modify your copy of editpics.php - replace the form_input function with this new version.


function form_input($text, $name, $max_length,$field_width=100)

{

    global $CURRENT_PIC;
    static $done = array();
   
    $link = '';
   
    if (empty($done)){

$link = <<< EOT

<script type="text/javascript">

function map(id, field){

var inputs = document.getElementsByTagName('input');

var value = document.getElementById(id).value;

for (var i in inputs){
if (inputs[i].className != 'textinput field_' + field) continue;
inputs[i].value = value;
}

return false;
}

</script>

EOT;

    }
   
    $fname = $name;

    $value = $CURRENT_PIC[$name];

    $name .= $CURRENT_PIC['pid'];
   
    if (empty($done[$fname])){
    $link .= '<a href="" onclick="return map(\''.$name.'\', \''.$fname.'\')">[Apply to all]</a>';
    $done[$fname] = true;
    $field_width = '90';

    }
   

    if ($text == '') {

        echo "        <input type=\"hidden\" name=\"$name\" value=\"\" />\n";

        return;

    }



    echo <<<EOT

        <tr>

            <td class="tableb" style="white-space: nowrap;">

                        $text

        </td>

        <td width="100%" class="tableb" valign="top">

                <input type="text" style="width: {$field_width}%" name="$name" id="$name" maxlength="$max_length" value="$value" class="textinput field_$fname" />
                $link

                </td>

        </tr>



EOT;

}

François Keller

the keyword_add plugin allow you auto-fill pictures custom fields for all pictures in an album. But not for picture title (sorry  ;))
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

skidpics

Awesome! Exactly what I was looking for in a previous thread I started!  However, how do we get this to apply to the description also?


Nibbler

You'd need to expand the mod to include textarea elements - form_textarea().

skidpics

Quote from: Nibbler on January 04, 2008, 01:13:58 AM
You'd need to expand the mod to include textarea elements - form_textarea().

is it as simple as copying and pasting the coding into the form_textarea, without the function form_input($text, $name, $max_length,$field_width=100) from the original source?