Ejemplo n.º 1
0
 | @ Author : ArslanHassan, Fawaz Tahir											
 | @ Software : ClipBucket , © PHPBucket.com						
 *******************************************************************
*/
require 'includes/config.inc.php';
@($id = $_GET['id']);
if (empty($id)) {
    e(lang('Photo does not exists'));
    cb_show_page();
} else {
    $photo = $cbphoto->get_photo($id, true);
    if (empty($photo)) {
        e(lang('Photo does not exists'));
        cb_show_page();
    } else {
        $exif = get_photo_meta_value($photo['photo_id'], 'exif_data');
        if (!$exif) {
            e(lang(sprintf('<strong>%s</strong> does not have EXIF Data', $photo['photo_title'])));
        } else {
            if ($photo['userid'] != userid() && $photo['view_exif'] == 'no') {
                e(lang('Owner has decided to keep Exif Information hidden for this photo.'));
            } else {
                $exif = json_decode($exif, true);
                $template_ready_data = ready_exif_data($exif, $photo);
                assign('photo', $photo);
                assign('exif', $template_ready_data);
                if ($photo['userid'] == userid()) {
                    assign('is_owner', true);
                }
                subtitle('Exif | ' . $photo['photo_title']);
                template_files(STYLES_DIR . '/global/exif.html');
Ejemplo n.º 2
0
        $val = $_POST['exif'];
        if (empty($pid) || !$cbphoto->photo_exists($pid)) {
            $response = array('error' => lang('Photo does not exist'));
        }
        if (strtolower($val) != 'yes' || strtolower($val) != 'no') {
            $response = array('error' => lang('Invalid value provided'));
        }
        if ($db->update(tbl('photos'), array('view_exif'), array($val), " photo_id = '" . $pid . "' ")) {
            $response = array('success' => 'Exif privacy setting updated.');
        } else {
            $response = array('error' => 'Unable to update setting. Please try again');
        }
        echo json_encode($response);
        break;
    case "get_colors":
        $pid = mysql_clean($_POST['id']);
        $colors = get_photo_meta_value($pid, 'colors');
        if ($colors) {
            $colors = json_decode($colors, true);
            assign('colors', $colors);
            assign('photo', $cbphoto->get_photo($pid, true));
            $template = Fetch('/global/colors.html', STYLES_DIR);
            $response = array('success' => true, 'template' => $template);
        } else {
            $response = array('error' => 'No colors found for this photo.');
        }
        echo json_encode($response);
        break;
    default:
        exit(json_encode(array('err' => lang('Invalid request'))));
}
Ejemplo n.º 3
0
                $array['user_tagged_only'] = $_GET['only_user'];
            }
            $array['order'] = $array['order'] ? $array['order'] : 'date_added';
            $array['orderby'] = $array['orderby'] ? $array['orderby'] : 'desc';
            $array['order'] = tbl('photo_tags.' . $array['order'] . ' ' . $array['orderby']);
            $tags = $cbphoto->get_photo_tags($array);
            if ($tags) {
                assign('tags', $tags);
            }
            //pr( $tags, true );
            subtitle("Photo Tags");
            break;
        case "exif":
        case "exif_data":
            assign('view', 'exif');
            $exif = get_photo_meta_value($id, 'exif_data');
            if ($exif) {
                $exif = json_decode($exif, true);
                $template_ready_data = ready_exif_data($exif, $p);
                assign('photo', $photo);
                assign('exif', $template_ready_data);
                subtitle('Exif Data');
            }
            break;
    }
}
// Add photo actions links
add_photo_manager_link(lang('Recreate Photo'), 'recreate_thumbs.php?mode=single&photo=' . $p['photo_id']);
if ($p['collection_id'] != 0) {
    add_photo_manager_link(lang('Edit Collection (' . $p['collection_name'] . ')'), 'edit_collection.php?collection=' . $p['collection_id']);
} else {