Пример #1
0
                } else {
                    $msg = $cs_lang['delfalse'];
                }
                $data['thumbs'][$run]['msg'] = $msg;
                $data['thumbs'][$run]['name'] = 'Thumb_' . $thumb;
                $run++;
            }
        } elseif (!empty($_POST['del'])) {
            $data['if']['no_thumb'] = TRUE;
        }
    }
}
if (isset($_POST['submit_1'])) {
    $post_count = count($_POST);
    $post_count = $post_count - '1';
    $cs_gallery_pic['folders_id'] = empty($_POST['folders_name']) ? $_POST['folders_id'] : make_folders_create('gallery', $_POST['folders_name']);
    $cs_gallery_option = cs_sql_option(__FILE__, 'gallery');
    $img_max['thumbs'] = $cs_gallery_option['thumbs'];
    for ($run = 0; $run < $post_count; $run++) {
        if (!empty($_POST['status_' . $run])) {
            $name = $_POST['name_' . $run];
            if (!extension_loaded('gd')) {
                die(cs_error_internal(0, 'GD extension not installed.'));
            }
            if (cs_resample('uploads/gallery/pics/' . $name, 'uploads/gallery/thumbs/' . 'Thumb_' . $name, $img_max['thumbs'], $img_max['thumbs'])) {
                $where = "gallery_name = '" . cs_sql_escape($name) . "'";
                $search = cs_sql_count(__FILE__, 'gallery', $where);
                if (empty($search)) {
                    $cs_gallery_pic['users_id'] = $account['users_id'];
                    $cs_gallery_pic['gallery_name'] = $name;
                    $cs_gallery_pic['gallery_status'] = isset($_POST['gallery_status']) ? $_POST['gallery_status'] : 0;
Пример #2
0
$cs_post = cs_post('id');
$cs_get = cs_get('id');
$data = array();
require_once 'mods/gallery/functions.php';
$gallery_id = empty($cs_get['id']) ? 0 : $cs_get['id'];
if (!empty($cs_post['id'])) {
    $gallery_id = $cs_post['id'];
}
settype($gallery_id, 'integer');
$edit = cs_sql_select(__FILE__, 'usersgallery', '*', "usersgallery_id = '" . (int) $gallery_id . "'");
$cs_option = cs_sql_option(__FILE__, 'gallery');
$gallery_count_reset = 0;
$new_time = 0;
if (isset($_POST['submit'])) {
    $edit['usersgallery_titel'] = $_POST['gallery_titel'];
    $edit['folders_id'] = empty($_POST['folders_name']) ? $_POST['folders_id'] : make_folders_create('usersgallery', $_POST['folders_name'], $account['users_id']);
    $edit['usersgallery_access'] = $_POST['gallery_access'];
    $edit['usersgallery_status'] = $_POST['gallery_status'];
    $edit['usersgallery_description'] = $_POST['gallery_description'];
    $edit['usersgallery_vote'] = isset($_POST['gallery_vote']) ? $_POST['gallery_vote'] : 0;
    if (!empty($_POST['new_time'])) {
        $edit['usersgallery_time'] = cs_time();
    }
    if (!empty($_POST['gallery_count_reset'])) {
        $edit['usersgallery_count'] = 0;
    }
    $error = '';
    if ($edit['users_id'] != $account['users_id'] and $account['access_usersgallery'] < 4) {
        $error .= $cs_lang['not_own'] . cs_html_br(1);
    }
    if (empty($edit['usersgallery_titel'])) {