if ($ratio > 1) { $width = $dim; $height = round($dim / $img_info[0] * $img_info[1]); } else { $width = round($dim / $img_info[1] * $img_info[0]); $height = $dim; } } else { $width = $img_info[0]; $height = $img_info[1]; } } show_image_row($lang['thumb'], $thumb_src, 1, "", $height, $width); show_hidden_input("image_thumb_file_" . $i, $thumb_file); } else { show_custom_row($lang['thumb'], $lang['no_thumb_newimages_ext']); show_hidden_input("image_thumb_file_" . $i, ""); } show_input_row($lang['field_download_url'] . $lang['download_url_desc'], "image_download_url_" . $i, "", $textinput_size); $image_name = isset($error['image_name_' . $i]) && isset($HTTP_POST_VARS['image_name_' . $i]) ? $HTTP_POST_VARS['image_name_' . $i] : str_replace("_", " ", $image_name); $iptc = ""; if (isset($info['APP13'])) { $iptc = iptcparse($info['APP13']); } if (is_array($iptc) && $iptc_name) { if (isset($iptc['2#005'][0])) { $image_name = $iptc['2#005'][0]; } } $title = $lang['field_image_name'] . (isset($file_src) ? get_iptc_insert_link($file_src, "object_name", "image_name_" . $i, 0) : ""); show_input_row($title, "image_name_" . $i, stripslashes($image_name), $textinput_size);
$db_status .= " / 4images: <b>" . format_file_size($global_info['database_size']['4images']) . "</b></p>"; } } show_form_header("backup.php", "makebackup"); show_table_header($lang['do_backup'], 2); $table_select = "<select name=\"db_tables[]\" size=\"10\" multiple>\n"; $result = $site_db->query("SHOW tables"); while ($row = $site_db->fetch_array($result)) { $table_select .= "<option value=\"" . $row[0] . "\""; if (in_array($row[0], $default_tables) && preg_match("/^" . $table_prefix . "/i", $row[0])) { $table_select .= " selected"; } $table_select .= ">" . $row[0] . "</option>\n"; } $table_select .= "</select>\n"; show_custom_row($lang['do_backup_desc'] . $db_status, $table_select); show_form_footer($lang['do_backup'], $lang['reset']); show_table_header($lang['list_backups'], 4); $handle = opendir(ROOT_PATH . DATABASE_DIR); $filelist = array(); while ($file = @readdir($handle)) { if (is_file(ROOT_PATH . DATABASE_DIR . "/" . $file) && $file != "." && $file != ".." && preg_match("/\\.sql/i", $file)) { $filelist[] = $file; } } closedir($handle); if (!empty($filelist)) { rsort($filelist); foreach ($filelist as $key => $file) { echo "<tr class=\"" . get_row_bg() . "\" width=\"30%\">\n<td><p class=\"rowtitle\">{$file}</p></td>\n"; $file_time = format_date($config['date_format'] . " " . $config['time_format'], filemtime(ROOT_PATH . DATABASE_DIR . "/" . $file));
echo "</td></tr>\n"; show_table_footer(); $action = "final"; } } if ($action == "intro") { $category = "\n<select name=\"cat\" class=\"categoryselect\">\n"; $category .= "<option value=\"0\">" . $lang['all_categories'] . "</option>\n"; $category .= "<option value=\"0\">-------------------------------</option>\n"; $drop_down_cat_cache = array(); $drop_down_cat_cache = $cat_parent_cache; $category .= get_category_dropdown_bits($cat_id); $category .= "</select>\n"; show_form_header("files_check.php", "checkimages"); show_table_header("Files Check", 2); show_custom_row("Category", $category); show_radio_row("Include sub-categories", "subcat", 1); show_input_row("Number of images to do per cycle", "imchksize", 50, 5); show_radio_row("Check Remote Files", "local", 1); show_radio_row("Check Thumbnails", "thumbs", 1); show_radio_row("Include automatic JavaScript redirect to next page", "autoredirect", 1); show_form_footer($lang['submit'], $lang['reset'], 2); } if ($action == "checkimages") { if (isset($HTTP_GET_VARS['cat']) || isset($HTTP_POST_VARS['cat'])) { $cat = isset($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : intval($HTTP_POST_VARS['cat']); } else { $cat = 0; } if (isset($HTTP_GET_VARS['subcat']) || isset($HTTP_POST_VARS['subcat'])) { $subcat = isset($HTTP_GET_VARS['subcat']) ? intval($HTTP_GET_VARS['subcat']) : intval($HTTP_POST_VARS['subcat']);
$select_image_type .= "</select>"; show_custom_row($lang['resize_image_type_desc'], $select_image_type); $dimension = isset($HTTP_POST_VARS['dimension']) ? intval($HTTP_POST_VARS['dimension']) : $config['max_image_width']; $height = isset($HTTP_POST_VARS['height']) ? intval($HTTP_POST_VARS['height']) : $config['max_image_height']; $resize_type = isset($HTTP_POST_VARS['resize_type']) ? intval($HTTP_POST_VARS['resize_type']) : $config['auto_thumbnail_resize_type']; $quality = isset($HTTP_POST_VARS['quality']) && intval($HTTP_POST_VARS['quality']) && intval($HTTP_POST_VARS['quality']) <= 100 ? intval($HTTP_POST_VARS['quality']) : 100; $num_newimages = isset($HTTP_POST_VARS['num_newimages']) && intval($HTTP_POST_VARS['num_newimages']) ? intval($HTTP_POST_VARS['num_newimages']) : 10; show_input_row($lang['max_imagewidth'], "dimension", $dimension); show_input_row($lang['max_imageheight'], "height", $height); $resize_type_1_checked = $resize_type == 1 ? " checked=\"checked\"" : ""; $resize_type_2_checked = $resize_type == 2 ? " checked=\"checked\"" : ""; $resize_type_3_checked = $resize_type == 3 ? " checked=\"checked\"" : ""; $resize_type_radios = "<input type=\"radio\" name=\"resize_type\" value=\"1\"" . $resize_type_1_checked . "> " . $lang['resize_proportionally'] . "<br />"; $resize_type_radios .= "<input type=\"radio\" name=\"resize_type\" value=\"2\"" . $resize_type_2_checked . "> " . $lang['resize_fixed_width'] . "<br />"; $resize_type_radios .= "<input type=\"radio\" name=\"resize_type\" value=\"3\"" . $resize_type_3_checked . "> " . $lang['resize_fixed_height'] . "<br />"; show_custom_row($lang['resize_proportions_desc'], $resize_type_radios); show_input_row($lang['resize_quality_desc'], "quality", $quality); show_input_row($lang['num_newimages_desc'], "num_newimages", $num_newimages); show_form_footer($lang['resize_check'], ""); echo "</form>"; } if (isset($HTTP_POST_VARS['action']) && $action == "selectoptions") { $path = $HTTP_POST_VARS['image_type'] == "media" ? MEDIA_PATH : THUMB_PATH; $sql_image_type = $HTTP_POST_VARS['image_type'] == "media" ? "image_media_file" : "image_thumb_file"; $dimension = isset($HTTP_POST_VARS['dimension']) ? intval($HTTP_POST_VARS['dimension']) : $config['max_image_height']; $height = isset($HTTP_POST_VARS['height']) ? intval($HTTP_POST_VARS['height']) : $config['max_image_height']; $quality = isset($HTTP_POST_VARS['quality']) ? intval($HTTP_POST_VARS['quality']) : 75; $sql = "SELECT image_id, image_name, cat_id, {$sql_image_type}\n FROM " . IMAGES_TABLE; $result = $site_db->query($sql); $imgs = ""; if ($result) {
$select = "<select name=\"emails[]\" size=\"15\" multiple=\"multiple\">\n"; $sql = "SELECT " . get_user_table_field("", "user_id") . get_user_table_field(", ", "user_level") . get_user_table_field(", ", "user_name") . get_user_table_field(", ", "user_email") . "\n FROM " . USERS_TABLE . "\n WHERE " . get_user_table_field("", "user_id") . " <> " . GUEST . " AND " . get_user_table_field("", "user_allowemails") . " = 1\n ORDER BY " . get_user_table_field("", "user_level") . " DESC"; $result = $site_db->query($sql); $level = 1000; while ($row = $site_db->fetch_array($result)) { $user_level = $row[$user_table_fields['user_level']]; if ($level != $user_level && $user_level == ADMIN) { $select .= "<option value=\"0\">__________________________</option>\n"; $select .= "<option value=\"0\" class=\"dropdownmarker\">" . $lang['userlevel_admin'] . "</option>\n"; } elseif ($level != $user_level && $user_level == USER) { $select .= "<option value=\"0\">__________________________</option>\n"; $select .= "<option value=\"0\" class=\"dropdownmarker\">" . $lang['userlevel_registered'] . "</option>\n"; } elseif ($level != $user_level && $user_level == USER_AWAITING) { $select .= "<option value=\"0\">__________________________</option>\n"; $select .= "<option value=\"0\" class=\"dropdownmarker\">" . $lang['userlevel_registered_awaiting'] . "</option>\n"; } $user_email = $row[$user_table_fields['user_email']]; $user_name = $row[$user_table_fields['user_name']]; $selected = isset($HTTP_POST_VARS['emails']) && !in_array($user_email, $HTTP_POST_VARS['emails']) ? "" : " selected=\"selected\""; $select .= "<option value=\"" . $user_email . "\"" . $selected . ">» " . format_text($user_name, 2) . " (" . $user_email . ")</option>\n"; $level = $user_level; } $select .= "</select>\n"; $title = $lang['select_email_user']; if (isset($error['emails'])) { $title = sprintf("<span class=\"marktext\">%s *</span>", $title); } show_custom_row($title, $select); show_form_footer($lang['send_emails'], "", 2); } show_admin_footer();
show_form_header("categories.php", "updatecat", "cat_form"); show_hidden_input("cat_id", $cat_id); show_table_header($lang['nav_categories_edit'], 2); show_input_row($lang['field_category_name'], "cat_name", $cat_row['cat_name'], $textinput_size); show_textarea_row($lang['field_description_ext'], "cat_description", $cat_row['cat_description'], $textarea_size); $cat_parent_id = $cat_row['cat_parent_id']; $category = "\n<select name=\"cat_parent_id\" class=\"categoryselect\" onChange=\"update_order_select(this.options[this.selectedIndex].value)\">\n"; $category .= "<option value=\"0\">" . $lang['main_category'] . "</option>\n"; $category .= "<option value=\"0\">--------------</option>\n"; $drop_down_cat_cache = array(); $drop_down_cat_cache = $cat_parent_cache; $category .= get_category_dropdown_bits($cat_parent_id); $category .= "</select>\n"; show_custom_row($lang['field_parent'], $category); if ($show_cat_order_dropdown) { show_custom_row($lang['cat_order'], get_cat_order_dropdown($cat_parent_id, $cat_row['cat_order'])); } show_input_row($lang['field_hits'], "cat_hits", $cat_row['cat_hits'], 5); show_table_separator($lang['permissions'], 2); foreach ($access_field_array as $key => $val) { show_access_select($lang[$key], $key, $cat_row[$key]); } show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']); } if ($action == "modifycats") { $site_sess->set_session_var('back_url', $self_url); show_admin_header(); if ($msg != "") { printf("<b>%s</b>\n<p>", $msg); } else { $msg = $site_sess->get_session_var('msg');
} else { echo "<br /> <b class=\"marktext\">" . $lang['creating_thumbnail_error'] . "</b><p>"; } } } } else { echo "<b>Just relaxing because you give me nothing to do!</b>"; } } if ($action == "checkthumbnails") { $num_newimages = isset($HTTP_POST_VARS['num_newimages']) && intval($HTTP_POST_VARS['num_newimages']) ? intval($HTTP_POST_VARS['num_newimages']) : 10; show_form_header("thumbnailer.php", "checkthumbnails"); show_table_header($lang['check_thumbnails'], 2); $desc = $lang['check_thumbnails_desc']; $desc .= " " . $lang['num_newimages_desc'] . "<input type=\"text\" name=\"num_newimages\" value=\"" . $num_newimages . "\" size=\"5\">"; show_custom_row($desc, "<input type=\"submit\" value=\"" . $lang['check_thumbnails'] . "\" class=\"button\">"); show_table_footer(); echo "</form>"; } if (isset($HTTP_POST_VARS['action']) && $HTTP_POST_VARS['action'] == "checkthumbnails") { $sql = "SELECT image_id, image_name, cat_id, image_media_file, image_thumb_file\n FROM " . IMAGES_TABLE; $result = $site_db->query($sql); $imgs = ""; if ($result) { $bgcounter = 0; $image_counter = 0; while ($image_row = $site_db->fetch_array($result)) { if ($image_row['image_thumb_file'] == "") { $exists = false; } else { if (is_remote($image_row['image_thumb_file'])) {
show_form_header("usergroups.php", "updategroup"); show_hidden_input("group_id", $group_id); show_table_header($lang['nav_usergroups'], 2); show_input_row($lang['field_usergroup_name'], "group_name", $result['group_name'], $textinput_size); show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']); } if ($action == "modifygroups") { if ($msg != "") { printf("<b>%s</b>\n", $msg); } show_form_header("usergroups.php", "addgroup", "form"); show_table_header($lang['nav_usergroups'], 2); $sql = "SELECT group_id, group_name\n FROM " . GROUPS_TABLE . "\n WHERE group_type = " . GROUPTYPE_GROUP . "\n ORDER BY group_name ASC"; $result = $site_db->query($sql); $found = 0; while ($row = $site_db->fetch_array($result)) { echo "<tr class=\"" . get_row_bg() . "\"><td><p><b>" . $row['group_name'] . "</b></p></td><td><p>"; show_text_link($lang['edit'], "usergroups.php?action=editgroup&group_id=" . $row['group_id']); show_text_link($lang['delete'], "usergroups.php?action=removegroup&group_id=" . $row['group_id']); show_text_link("<b>" . $lang['permissions'] . "</b>", "usergroups.php?action=editpermissions&group_id=" . $row['group_id']); echo "</p></td></tr>"; $found = 1; } if (!$found) { echo "<tr class=\"" . get_row_bg() . "\">\n<td colspan=\"2\">" . $lang['no_search_results'] . "</td></tr>"; } show_table_separator($lang['add_usergroup'], 2); show_custom_row("<input type=\"text\" name=\"group_name\" value=\"\" size=\"" . $textinput_size . "\">", "<input type=\"submit\" value=\"" . $lang['add_usergroup'] . "\" class=\"button\">"); show_table_footer(); } show_admin_footer();