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: Auto-Fill Album Fields - Help Needed  (Read 5461 times)

0 Members and 1 Guest are viewing this topic.

mirdonamy

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Auto-Fill Album Fields - Help Needed
« on: September 23, 2007, 09:48:50 pm »

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 :)
Logged

mirdonamy

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Auto-Fill Album Fields - Help Needed
« Reply #1 on: September 28, 2007, 07:38:55 am »

I would really appreciate some help on this issue.

Thanks :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Auto-Fill Album Fields - Help Needed
« Reply #2 on: October 01, 2007, 07:54:56 am »

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

mirdonamy

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Auto-Fill Album Fields - Help Needed
« Reply #3 on: October 01, 2007, 06:43:26 pm »

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!
Logged

Nibbler

  • Guest
Re: Auto-Fill Album Fields - Help Needed
« Reply #4 on: October 01, 2007, 07:22:09 pm »

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

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

}
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Auto-Fill Album Fields - Help Needed
« Reply #5 on: October 01, 2007, 09:01:19 pm »

the keyword_add plugin allow you auto-fill pictures custom fields for all pictures in an album. But not for picture title (sorry  ;))
Logged
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

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 223
Re: Auto-Fill Album Fields - Help Needed
« Reply #6 on: January 04, 2008, 01:08:02 am »

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?

Logged

Nibbler

  • Guest
Re: Auto-Fill Album Fields - Help Needed
« Reply #7 on: January 04, 2008, 01:13:58 am »

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

skidpics

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 223
Re: Auto-Fill Album Fields - Help Needed
« Reply #8 on: January 04, 2008, 04:57:54 pm »

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

Page created in 0.021 seconds with 19 queries.