if (empty($edit['usersgallery_titel'])) { $error .= $cs_lang['no_titel'] . cs_html_br(1); } if (empty($edit['folders_id'])) { $error .= $cs_lang['no_cat'] . cs_html_br(1); } } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_picture']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['data'] = $edit; $data['current']['img'] = cs_html_img('mods/gallery/image.php?usersthumb=' . $edit['usersgallery_id']); $data['folders']['select'] = make_folders_select('folders_id', $edit['folders_id'], $account['users_id'], 'usersgallery'); $data['access']['options'] = ''; $levels = 0; while ($levels < 6) { $edit['usersgallery_access'] == $levels ? $sel = 1 : ($sel = 0); $data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $data['status']['options'] = ''; $levels = 0; while ($levels < 2) { $edit['usersgallery_status'] == $levels ? $sel = 1 : ($sel = 0); $data['status']['options'] .= cs_html_option($cs_lang['show_' . $levels], $levels, $sel); $levels++; } $data['abcode']['smileys'] = cs_abcode_smileys('gallery_description');
} } while ($filename = readdir($dirHandleThumbs)) { if ($filename != "." && $filename != ".." && $filename != ".keep" && $filename != ".git" && $filename != "Thumbs.db" && $filename != "index.html") { $name = strlen($filename); $filename = substr($filename, '6', $name); $thumbnamesArray[] = $filename; } } $diff = array_diff($picnamesArray, $thumbnamesArray); $diff2 = array_diff($thumbnamesArray, $picnamesArray); $checkDiff = count($diff); $checkDiff2 = count($diff2); if (!empty($checkDiff) and !empty($_POST['read']) or !empty($checkDiff) and $zip_file == 1) { $data['if']['pictures_found'] = TRUE; $data['folders']['select'] = make_folders_select('folders_id', '0', '0', 'gallery'); $levels = 0; $data['access']['options'] = ''; while ($levels < 6) { $cs_gallery['gallery_access'] == $levels ? $sel = 1 : ($sel = 0); $data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $levels = 0; $data['show']['options'] = ''; while ($levels < 2) { $cs_gallery['gallery_status'] == $levels ? $sel = 1 : ($sel = 0); $data['show']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['show_' . $levels], $levels, $sel); $levels++; } $cs_gallery['gallery_watermark'] = '';
} $where = "folders_name = '" . cs_sql_escape($folders['folders_name']) . "' AND folders_mod = 'usersgallery'"; $where .= "AND users_id = '" . $account['users_id'] . "'"; $search = cs_sql_count(__FILE__, 'folders', $where); if (!empty($search)) { $error .= $cs_lang['cat_exists'] . cs_html_br(1); } } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_folder']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['data'] = $folders; $data['data']['folders_select'] = make_folders_select('sub_id', $folders['sub_id'], $account['users_id'], 'usersgallery'); $levels = 0; $data['data']['folders_access'] = ''; while ($levels < 6) { $folders['folders_access'] == $levels ? $sel = 1 : ($sel = 0); $data['data']['folders_access'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $option['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $option['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($option['max_size']) . cs_html_br(1);
$folder_arr = get_subfolders($folders_id); if (!empty($folder_arr)) { foreach ($folder_arr as $cond) { $where .= "OR gal.folders_id = '" . $cond['folders_id'] . "' "; } } } if (!empty($access_id) and empty($folders_id)) { $where = "gal.gallery_access = '" . $access_id . "' "; } if (!empty($access_id) and !empty($folders_id)) { $where = "gal.folders_id = '" . $folders_id . "' AND gallery_access = '" . $access_id . "'"; } $where = trim($where); $access_data = array(0 => array('access_id' => '1', 'access_name' => $cs_lang['lev_1']), 1 => array('access_id' => '2', 'access_name' => $cs_lang['lev_2']), 2 => array('access_id' => '3', 'access_name' => $cs_lang['lev_3']), 3 => array('access_id' => '4', 'access_name' => $cs_lang['lev_4']), 4 => array('access_id' => '5', 'access_name' => $cs_lang['lev_5'])); $data['dropdown']['folders'] = make_folders_select('where', $folders_id, 0, 'gallery', 0); $data['dropdown']['access'] = cs_dropdown('access', 'access_name', $access_data, $access_id, 'access_id'); $data['sort']['id'] = cs_sort('gallery', 'manage', $start, $where_x, 1, $sort); $data['sort']['name'] = cs_sort('gallery', 'manage', $start, $where_x, 3, $sort); $data['sort']['time'] = cs_sort('gallery', 'manage', $start, $where_x, 5, $sort); $data['sort']['folders'] = cs_sort('gallery', 'manage', $start, $where_x, 7, $sort); $data['sort']['status'] = cs_sort('gallery', 'manage', $start, $where_x, 9, $sort); $from = 'gallery gal INNER JOIN {pre}_users usr ON gal.users_id = usr.users_id '; $from .= 'LEFT JOIN {pre}_folders fol ON gal.folders_id = fol.folders_id'; $select = 'gal.gallery_id AS gallery_id, gal.gallery_status AS gallery_status, '; $select .= 'gal.gallery_name AS gallery_name, gal.gallery_titel AS gallery_titel, '; $select .= 'gal.users_id AS users_id, gal.gallery_time AS gallery_time, '; $select .= 'gal.folders_id AS folders_id, fol.folders_name AS folders_name, usr.users_active AS users_active'; $data['pictures'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $pictures_loop = count($data['pictures']); for ($run = 0; $run < $pictures_loop; $run++) {
} $where = "folders_name = '" . cs_sql_escape($folders['folders_name']) . "'"; $where .= " AND folders_mod = 'gallery' AND folders_id != '" . $folders_id . "'"; $search = cs_sql_count(__FILE__, 'folders', $where); if (!empty($search)) { $error .= $cs_lang['cat_exists'] . cs_html_br(1); } } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_folder']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['data'] = $folders; $data['data']['folders_select'] = make_folders_select('sub_id', $folders['sub_id'], '0', 'gallery', 1, $folders_id); $levels = 0; $data['data']['folders_access'] = ''; while ($levels < 6) { $folders['folders_access'] == $levels ? $sel = 1 : ($sel = 0); $data['data']['folders_access'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } if (empty($folders['folders_picture'])) { $data['data']['picture'] = $cs_lang['nopic']; $data['if']['picture_exists'] = FALSE; } else { $url = 'uploads/folders/' . $folders['folders_picture']; $data['data']['picture'] = cs_html_img($url); $data['if']['picture_exists'] = TRUE; }
$cs_gallery['gallery_status'] = 1; $gallery_watermark_trans = '20'; $gray = '0'; $watermark_pos = '1'; $file_up = 0; } if (!isset($_POST['submit'])) { $data['body']['picture_create'] = $cs_lang['body_edit']; } elseif (!empty($error)) { $data['error']['icon'] = cs_icon('important'); $data['error']['error'] = $cs_lang['error_occured'] . cs_html_br(1); $data['error']['message'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['data'] = $cs_gallery; $data['data']['folders_select'] = make_folders_select('folders_id', $cs_gallery['folders_id'], '0', 'gallery'); if (empty($file_up)) { $data['if']['file_up'] = FALSE; $data['if']['no_up'] = TRUE; $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $cs_option['width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $cs_option['height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($cs_option['size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['data']['info_clip'] = cs_abcode_clip($matches); } elseif ($file_up == 1) { $data['if']['no_up'] = FALSE;
} elseif (!empty($count_subfolders) and empty($count_pictures)) { $msg = sprintf($cs_lang['del_subfolder'], cs_secure($folder['folders_name']), $count_subfolders) . $ask; } elseif (!empty($count_pictures) and empty($count_subfolders)) { $msg = sprintf($cs_lang['del_folder_pics'], cs_secure($folder['folders_name']), $count_pictures) . $ask; $data['if']['pictures_in_folder'] = TRUE; } else { $msg = sprintf($cs_lang['del_folder_rly'], cs_secure($folder['folders_name'])); $data['if']['pictures_in_folder'] = FALSE; } $data['lang']['fr_opt_2'] = sprintf($cs_lang['fr_opt_2'], $count_pictures, cs_secure($folder['folders_name'])); $where = "folders_mod = 'usersgallery' AND folders_id != '" . $folders_id . "' AND users_id = '" . $account['users_id'] . "'"; $select = 'folders_id, folders_name, sub_id, folders_position'; $folders = cs_sql_select(__FILE__, 'folders', $select, $where, 'folders_name', 0, 0); if (!empty($folders)) { $data['if']['other_folders'] = TRUE; $data['folders']['dropdown'] = make_folders_select('folders_id', 0, $account['users_id'], 'usersgallery', 0); } else { $data['if']['other_folders'] = FALSE; } $data['head']['body'] = $msg; $data['hidden']['id'] = $folders_id; echo cs_subtemplate(__FILE__, $data, 'usersgallery', 'folders_remove'); } else { # move folder content to new selected folder ($new_folders_id) if ($delete_mode == 3) { # move subfolders -> new selected folder foreach ($get_subfolders as $sub) { $cells = array('sub_id'); $update = array($new_folders_id); cs_sql_update(__FILE__, 'folders', $cells, $update, $sub['folders_id']); }
} elseif (!empty($error) or empty($files_gl['picture']['tmp_name'])) { $data['head']['body'] = $error; } if (!isset($_POST['submit']) or !empty($error)) { $data['data'] = $cs_gallery; $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $cs_option['width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $cs_option['height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($cs_option['size2']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['data']['infobox'] = cs_abcode_clip($matches); $data['data']['folders'] = make_folders_select('folders_id', $cs_gallery['folders_id'], $cs_gallery['users_id'], 'usersgallery'); $data['access']['options'] = ''; $levels = 0; while ($levels < 6) { $cs_gallery['usersgallery_access'] == $levels ? $sel = 1 : ($sel = 0); $data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $data['status']['options'] = ''; $levels = 0; while ($levels < 2) { $cs_gallery['usersgallery_status'] == $levels ? $sel = 1 : ($sel = 0); $data['status']['options'] .= cs_html_option($cs_lang['show_' . $levels], $levels, $sel); $levels++; } $data['abcode']['smileys'] = cs_abcode_smileys('description');
} elseif (!empty($count_subfolders) and empty($count_pictures)) { $msg = sprintf($cs_lang['del_subfolder'], $folder['folders_name'], $count_subfolders) . $ask; } elseif (!empty($count_pictures) and empty($count_subfolders)) { $msg = sprintf($cs_lang['del_folder_pics'], $folder['folders_name'], $count_pictures) . $ask; $data['if']['pictures_in_folder'] = TRUE; } else { $msg = sprintf($cs_lang['del_folder_rly'], $folder['folders_name']); $data['if']['pictures_in_folder'] = FALSE; } $data['lang']['fr_opt_2'] = sprintf($cs_lang['fr_opt_2'], $count_pictures, $folder['folders_name']); $where = "folders_mod = 'gallery' AND folders_id != '" . $folders_id . "'"; $select = 'folders_id, folders_name, sub_id, folders_position'; $folders = cs_sql_select(__FILE__, 'folders', $select, $where, 'folders_name', 0, 0); if (!empty($folders)) { $data['if']['other_folders'] = TRUE; $data['folders']['dropdown'] = make_folders_select('folders_id', 0, 0, 'gallery', 0); } else { $data['if']['other_folders'] = FALSE; } $data['head']['body'] = $msg; $data['hidden']['id'] = $folders_id; echo cs_subtemplate(__FILE__, $data, 'gallery', 'folders_remove'); } else { # move folder content to new selected folder ($new_folders_id) if ($delete_mode == 3) { # move subfolders -> new selected folder foreach ($get_subfolders as $sub) { $cells = array('sub_id'); $update = array($new_folders_id); cs_sql_update(__FILE__, 'folders', $cells, $update, $sub['folders_id']); }