Advanced search  

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

Pages: [1]   Go Down

Author Topic: [Solved]: Nomi file (o titoli) che si trasformino automaticamente in keys ?  (Read 3839 times)

0 Members and 1 Guest are viewing this topic.

BIIPmoni

  • Coppermine frequent poster
  • ***
  • Country: fr
  • Offline Offline
  • Gender: Female
  • Posts: 100

ciaooo^-^

ho cercato ovunque (tranne che nel forum inglese, lingua con cui non ho bel rapporto :D ) ma non ho trovato nulla , tranne Pyap mi pare mesi fa che mi aveva scritto che gli pareva di aver letto qualcosa appunto sempre nella board anglofona.
Cè un sistema perchè tutti i titoli dei file vengano automaticamente riconosciuti come Keys ? (quelle che si vedono nella mia gallery le ho ovviamente aggiunte io )


http://www.photolandimagebank.com/gallery.html

ciao moni
« Last Edit: March 07, 2008, 09:04:09 am by Lontano »
Logged
Un homme qui n'est plus capable de s'émerveiller a pratiquement cessé de vivre. Einstein
<> Vivre à Lanslevillard c'est toujours s'émerveiller <>

Davide Renda

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: Nomi file (o titoli) che si trasformino automaticamente in keys ?
« Reply #1 on: March 01, 2008, 10:48:45 pm »

Non che io sappia. Almeno non per il momento.

BIIPmoni

  • Coppermine frequent poster
  • ***
  • Country: fr
  • Offline Offline
  • Gender: Female
  • Posts: 100
Re: Nomi file (o titoli) che si trasformino automaticamente in keys ?
« Reply #2 on: March 06, 2008, 02:11:32 am »

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

Spero 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:

Code: [Select]
<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" /><br />

Giusto prima di :


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


Code: [Select]
<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" onFocus="copier_motcle()" /><br />

Infine subito sopra aggiungere:


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

Cercare


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

    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 :


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

Code: [Select]
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 ^___________^
« Last Edit: March 06, 2008, 04:16:18 am by BIIPmoni »
Logged
Un homme qui n'est plus capable de s'émerveiller a pratiquement cessé de vivre. Einstein
<> Vivre à Lanslevillard c'est toujours s'émerveiller <>
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 18 queries.