Raga, ho integrato coppermine nel mio database di cani che per ora è ancora in fase embrionale, e siccome quando carico la foto in coppermine se la sua dimensione in altezza o larghezza è maggiore della misura impostata (che nel mio caso è di 400 px, automaticamente ridimensiona l'immagine e la reintitola con normal_nomefile.jpg.
Ora facendo girare il seguente script mi da l'errore seguente ma non capisco come mai:
Notice: Undefined variable: foto_width in c:\programmi\easyphp1-8\www\ped_data\untitled-4.php on line 49
Il codice è il seguente in rosso è la linea incriminata
codice:
// Esegue la query
$queryok=@mysql_query('SELECT * FROM pedigree WHERE PedigreeId =' .$id);
if (!$queryok) {
exit('
Error retrieving the dog from the database!
'.
'Error: ' . mysql_error(). '</p>');
}
if (mysql_num_rows($queryok) < 1) {
exit('Could not locate the specified record ID.');
}
//altrimenti carico i dati del record selezionato
$dogrow = mysql_fetch_array($queryok);
$name = $dogrow['Name'];
$title = $dogrow['PreTitle'];
$petname = $dogrow['PetName'];
$id_fath = $dogrow['SireId'];
$id_moth = $dogrow['DamId'];
$sex = $dogrow['Sex'];
$dob = $dogrow['DOB'];
$breeder = $dogrow['BreederName'];
$owner = $dogrow['OwnerName'];
$coat = $dogrow['CoatColour'];
$pattern = $dogrow['CoatPattern'];
$eyes = $dogrow['Health_Eye'];
$created = $dogrow['RecordCreated'];
$updated = $dogrow['RecordUpdated'];
$foto_url = $dogrow['Photo'];
$foto_widht = $dogrow['pwidht'];
$foto_height = $dogrow['pheight'];
//mi serve ora l'url esatto dell'immagine, essendo abilitato il ridimensionamento
// per le foto di dimensione maggiore di 400 px
if (max($foto_width, $foto_height) > 400){
$condition = true;
}else{
$condition = false;
}
if ($condition) {
$picture_url = 'normal_' .$foto_url;
} else {
$picture_url = $foto_url;
}
?>
ciao