Hello vano
i chanced this code in download.php
if ($user_info['user_level'] != ADMIN) {
$sql = "UPDATE ".IMAGES_TABLE."
SET image_downloads = image_downloads + 1
WHERE image_id = $image_id";
$site_db->query($sql);
}from this
if ($user_info['user_level'] != ADMIN) {
//olacak was created . in mysql olacak is integer --> int(11) . and showed this number quality of pic.
//This number is min photo is quality. some pics olacak's worth 305 , 499, 509, 566, 1000,1455,8787, 9000,.....
//default 12000
$sql = "SELECT olacak
FROM ".IMAGES_TABLE."
WHERE i.image_active = 1
ORDER BY olacak ASC";
$image_row = $site_db->query_firstrow($sql);
$olacak_min = $image_row['olacak']; // this must 300 because min olacak worth is = 305
$sql = "SELECT image_downloads
FROM ".IMAGES_TABLE."
WHERE i.image_active = 1
ORDER BY image_downloads DESC";
$image_row = $site_db->query_firstrow($sql);
$download_max = $image_row['image_downloads']; // this one must 15. because max image_downloads = 15
$downdanekle = $olacak_min / $download_max; // 305/15 = 20.333333 (i dont know exatly )
$sql = "SELECT olacak
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
$kacisin = $image_row['olacak']; // i want to read old olacAKs worth ( this pic old quality ) maybe 500
$kacisin = $kacisin - $downdanekle ); // i want to calculate new quality $kacisin = 500 - 20.3333 = 470.666
$kacisin = (int)$kacisin; // i want this $kacisin =470 for to write mysql olacak int(11)
$sql = "UPDATE ".IMAGES_TABLE."
SET image_downloads = image_downloads + 1, olacak = '$kacisin'
WHERE image_id = $image_id";
$site_db->query($sql);
}result is unexpected error occured . and not download.
i hope i can explain.
result is this
An unexpected error occured. Please try again later.
An unexpected error occured. Please try again later.
ÿØÿàJFIFÿş;CREATOR: gd-jpeg v1.0 (using IJG JPE.................................