Ciao ^__________^
Il grande, sublime , meraviglioso Elwood J. Blues (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.news3d.eu%2FSmileys%2FNews3D%2Faveave.gif&hash=6f8295a477c0cc316ac6245d0e318079e62f9c01) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.news3d.eu%2FSmileys%2FNews3D%2Fbacetto.gif&hash=d9e8c1653180bac1e90758948e9869d4895778a9) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.news3d.eu%2FSmileys%2FNews3D%2Fsupercool.gif&hash=7d2f3ee3aeeb562448c588a32b9214c293e7e1a0) del forum francese ha appena creato un hack veramente perfetto e con moltissime opzioni!!!
http://forum.coppermine-gallery.net/index.php/topic,18958.0.htmlSpero di far bene
e traduco qua il suo imho, veramente superbo lavoro!
Vi sono varie opzioni ,
la prima è quando si usa la funzione upload per caricare le immagini, (e quindi non il batch /ftp)Per questa procedere come segue :
Nel file upload.php cercare:<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" /><br />
Giusto prima di :// The function to create the album list drop down.
function form_alb_list_box($text, $name) {
// frogfoot re-wrote this function to present the list in categorized, sorted and nicely formatted order
E rimpiazzare la stringa con la seguente :<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" onFocus="copier_motcle()" /><br />
Infine subito sopra aggiungere:<script language="javascript">
var passage = false;
function copier_motcle(){
if (passage == false) {
document.forms[0].keywords.value += document.forms[0].title.value;
document.forms[0].keywords.value += " ";
document.forms[0].keywords.value += document.forms[0].album.text;
passage = true;
}
}
</script>
Adesso quando si caricano le immagini con l’upload basta selezionare la casella delle parole chiave e i titoli delle immagini e dell’album si incolleranno automaticamente, e ovviamente , si possono correggere.
Quando si utilizza il batch ftp :Cercarefunction form_input($text, $name, $max_length,$field_width=100)
{
global $CURRENT_PIC;
$value = $CURRENT_PIC[$name];
$name .= $CURRENT_PIC['pid'];
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" maxlength="$max_length" value="$value" class="textinput" />
</td>
</tr>
EOT;
}
e sovrascriverlo con :function form_input($text, $name, $max_length,$field_width=100)
{
global $CURRENT_PIC;
$value = $CURRENT_PIC[$name];
$name .= $CURRENT_PIC['pid'];
if ($text == '') {
echo " <input type=\"hidden\" name=\"$name\" value=\"\" />\n";
return;
}
if (ereg("keywords[0-9]",$name)){
$name_ref = $name;
$name .= "\" onFocus=\"copier_motcle".$CURRENT_PIC['pid']."()";
$script = "<script language=\"javascript\">
var passage".$CURRENT_PIC['pid']." = false;
function copier_motcle".$CURRENT_PIC['pid']."(){
if (passage".$CURRENT_PIC['pid']." == false) {
document.editForm.$name_ref.value += \" \";
document.editForm.$name_ref.value += document.editForm.title".$CURRENT_PIC['pid'].".value;
document.editForm.$name_ref.value += \" \";
document.editForm.$name_ref.value += document.editForm.aid".$CURRENT_PIC['pid'].".options[document.editForm.aid".$CURRENT_PIC['pid'].".options.selectedIndex].text.slice(2);
passage".$CURRENT_PIC['pid']." = true;
}
}
</script>";
}
echo <<<EOT
<tr>
<td class="tableb" style="white-space: nowrap;">
$text
</td>
<td width="100%" class="tableb" valign="top">
$script
<input type="text" style="width: {$field_width}%" name="$name" maxlength="$max_length" value="$value" class="textinput" />
</td>
</tr>
EOT;
}
In modifica immagini dell’album basta cliccare nella casella parole chiave e aggiunge automaticamente i titoli dell’albun e i titoli delle immagini.
Infine giocando sulle seguenti stringhe si può scegliere se inserire automaticamente solo il titolo delle immagini , o solo l’ album o evitare alcune lettere inziali :document.editForm.$name_ref.value += document.editForm.title".$CURRENT_PIC['pid'].".value;
document.editForm.$name_ref.value += \" \";
document.editForm.$name_ref.value += document.editForm.aid".$CURRENT_PIC['pid'].".options[document.editForm.aid".$CURRENT_PIC['pid'].".options.selectedIndex].text.slice(2);
1) La prima aggiunge il titolo.
2) La seconda separa i titoli dell’album
3) La terza aggiunge il nome dell’album (io cancello i primi due caratteri perché ho un >. Quindi per non cancellarli basta eliminare ".slice(2)"
Quindi se non si vuole aggiungere le parole chiavi dell’album si cancellano le due ultime righe .
By Elwood J. Blues !Ciao moni ^___________^