Exemple #1
0
            if (!isset($msg)) {
                if (i18n_gallery_save($gallery, @$_GET['name'])) {
                    $msg = i18n_r('i18n_gallery/SAVE_SUCCESS');
                    if (@$name) {
                        $msg .= ' <a href="load.php?id=i18n_gallery&amp;edit&amp;name=' . $name . '&amp;new=' . @$_POST['post-name'] . '&amp;undo">' . i18n_r('UNDO') . '</a>';
                    }
                    $success = true;
                    $gallery = return_i18n_gallery(@$_POST['post-name']);
                    // reread
                    $name = @$_POST['post-name'];
                } else {
                    $msg = i18n_r('i18n_gallery/SAVE_FAILURE');
                }
            }
        } else {
            $gallery = return_i18n_gallery(@$_GET['name']);
        }
    }
}
$settings = i18n_gallery_settings();
$w = intval(@$settings['adminthumbwidth']) > 0 ? intval($settings['adminthumbwidth']) : I18N_GALLERY_DEFAULT_THUMB_WIDTH;
$h = intval(@$settings['adminthumbheight']) > 0 ? intval($settings['adminthumbheight']) : I18N_GALLERY_DEFAULT_THUMB_HEIGHT;
$viewlink = function_exists('find_i18n_url') ? find_i18n_url('index', null) : find_url('index', null);
$viewlink .= (strpos($viewlink, '?') === false ? '?' : '&amp;') . 'name=' . $name . '&amp;preview-gallery';
$plugins = i18n_gallery_plugins();
$plugins = subval_sort($plugins, 'name');
// default gallery type
if (!@$gallery['type']) {
    $gallery['type'] = @$settings['type'] ? $settings['type'] : I18N_GALLERY_DEFAULT_TYPE;
}
?>
Exemple #2
0
    require_once '../../../gsconfig.php';
}
$GSADMIN = '../../../' . (defined('GSADMIN') ? GSADMIN : 'admin');
if (defined('I18N_GALLERY_PIC_FILTER') && I18N_GALLERY_PIC_FILTER) {
    try {
        global $file, $filters;
        include $GSADMIN . '/inc/common.php';
        $loggedin = cookie_check();
        // logged in on backend?
        if (!$loggedin) {
            $file = GSDATAUPLOADPATH . $infile;
            if (!file_exists($file)) {
                error404();
            }
            if ($gallery) {
                $data = return_i18n_gallery($gallery);
                if ($data) {
                    foreach ($data['items'] as $item) {
                        if ($item['filename'] == $infile) {
                            $tags = preg_split('/\\s*,\\s*/', $item['tags']);
                            break;
                        }
                    }
                }
            }
            if (!isset($tags)) {
                error404();
            }
            @session_start();
            foreach ($filters as $filter) {
                if ($gallery && $filter['filter'] == 'image-veto') {