Beispiel #1
0
function getImageInfos($_imgId)
{
    $datas = array();
    $sql = 'SELECT I.id, I.folder_id, I.path, I.filename, I.lat, I.lon, I.exif_date_crea, I.exif_iso, I.exif_aperture, I.exif_exposure_time, F.name as folder_name FROM files I, folders F WHERE I.id=' . $_imgId . ' AND I.folder_id=F.id';
    $req = mysql_query($sql);
    if (mysql_num_rows($req) > 0) {
        $infos = mysql_fetch_assoc($req);
        $datas['fileInfos'] = $infos;
        $datas['tags'] = queryImageTags($_imgId);
        return $datas;
    }
    return false;
}
Beispiel #2
0
        if (removeTagFromBdd($imgId, $_POST['tagId'])) {
            $success[] = $imgId;
        } else {
            $errors[] = $imgId;
        }
    }
    $res = drawMultiImgTags($imgList);
    echo $res;
}
if (isset($_GET['loadTagsForImgList'])) {
    $idList = explode(',', $_POST['idList']);
    echo drawModalTagsEdit($idList);
}
if (isset($_GET['loadTagsForImg'])) {
    $res = '';
    $tags = queryImageTags(clean_champ($_GET['imgId']));
    if (count($tags) == 0) {
        $res = '<em>pas de tag</em>';
    }
    foreach ($tags as $id => $name) {
        $res .= '<a href="search.php?tags_list=' . $id . '">' . $name . '</a><br>';
    }
    $res = substr($res, 0, -1);
    echo $res;
}
if (isset($_GET['autocomplete'])) {
    echo json_encode(searchTagByName($_GET['autocomplete']));
}
if (isset($_GET['importFiles'])) {
    $nbImgProcessed = processImport();
    $res = array('NB_IMG' => $nbImgProcessed);