コード例 #1
0
ファイル: checkimages.php プロジェクト: 4images/4images
             $keywords = implode(',', array_unique(array_filter($keywords_arr)));
         }
     }
     show_textarea_row($title, "image_keywords_" . $i, $keywords, $textarea_size);
     if (isset($error['cat_id_' . $i])) {
         $title = sprintf("<span class=\"marktext\">%s *</span>", $lang['field_category']);
     } else {
         $title = $lang['field_category'];
     }
     echo "<tr class=\"" . get_row_bg() . "\">\n<td><p class=\"rowtitle\">" . $title . "</p></td>\n<td>" . get_category_dropdown($cat_id, 0, 3, $i) . "</td>\n</tr>\n";
     show_user_select_row($lang['user'], $user_id, $i);
     if (is_array($iptc) && $iptc_date) {
         $date = isset($iptc['2#055'][0]) ? preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $iptc['2#055'][0]) : $date;
     }
     $title = $lang['field_date'] . $lang['date_desc'] . $lang['date_format'] . (isset($file_src) ? get_iptc_insert_link($file_src, "date_created", "image_date_" . $i, 0) : "");
     show_input_row($title, "image_date_" . $i, $date, $textinput_size);
     show_hidden_input("old_cat_id_" . $i, $cat_id);
     show_radio_row($lang['field_free'], "image_active_" . $i, 1);
     show_radio_row($lang['field_allow_comments'], "image_allow_comments_" . $i, 1);
     show_additional_fields("image", array(), IMAGES_TABLE, $i);
 } else {
     echo "<tr class=" . get_row_bg() . ">\n";
     echo "<td><input type=\"checkbox\" name=\"addimage_" . $i . "\" value=\"1\"{$checked}></td>\n";
     $link = "<a href=\"" . MEDIA_PATH . $cat_path . "/" . $file . "\" target=\"_blank\">" . $file . "</a>";
     show_hidden_input("image_media_file_" . $i, $file);
     if ($thumb_file) {
         $file_src = THUMB_PATH . $cat_path . "/" . $thumb_file;
         $img_info = @getimagesize($file_src);
         $width = 48;
         $height = 48;
         $dim = $width;
コード例 #2
0
ファイル: settings.php プロジェクト: 4images/4images
function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0)
{
    global $config, $setting;
    $config_value = $config[$setting_name];
    $config_value = $htmlspecialchars ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];
    $setting[$setting_name] = replace_url($setting[$setting_name]);
    if ($value_option == "") {
        show_input_row($setting[$setting_name], "setting_item[" . $setting_name . "]", $config_value);
    } elseif ($value_option == "textarea") {
        show_textarea_row($setting[$setting_name], "setting_item[" . $setting_name . "]", $config_value, "", 6);
    } elseif ($value_option == "radio") {
        show_radio_row($setting[$setting_name], "setting_item[" . $setting_name . "]", $config_value);
    } else {
        echo "<tr class=\"" . get_row_bg() . "\">\n<td valign=\"top\"><p class=\"rowtitle\">" . $setting[$setting_name] . "</p></td>\n";
        echo "<td><p>";
        $value_option($setting_name, $config_value);
        echo "</p></td>\n</tr>\n";
    }
}
コード例 #3
0
        $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']);
    } else {
        $subcat = 0;
コード例 #4
0
ファイル: resizer.php プロジェクト: abhinay100/fourimages_app
    $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) {
        $bgcounter = 0;
        $image_counter = 0;
コード例 #5
0
    ?>
</option>
  </select>
  <select name="direction">
  <option selected value="ASC"><?php 
    echo $lang['asc'];
    ?>
</option>
  <option value="DESC"><?php 
    echo $lang['desc'];
    ?>
</option>
  </select>
  </p></td></tr>
  <?php 
    show_input_row($lang['results_per_page'], "limitnumber", 50);
    show_form_footer($lang['search'], $lang['reset'], 2);
}
if ($action == "findcomments") {
    $condition = "1=1";
    $image_name = trim($HTTP_POST_VARS['image_name']);
    if ($image_name != "") {
        $condition .= " AND INSTR(LCASE(i.image_name),'" . strtolower($image_name) . "')>0";
    }
    $image_id = intval($HTTP_POST_VARS['image_id']);
    if ($image_id != 0) {
        $condition .= " AND INSTR(LCASE(c.image_id),'" . strtolower($image_id) . "')>0";
    }
    $user_name = trim($HTTP_POST_VARS['user_name']);
    if ($user_name != "") {
        $condition .= " AND INSTR(LCASE(c.user_name),'" . strtolower($user_name) . "')>0";
コード例 #6
0
ファイル: users.php プロジェクト: abhinay100/fourimages_app
    }
}
if ($action == "addusers") {
    if (isset($HTTP_GET_VARS['num_newusers']) || isset($HTTP_POST_VARS['num_newusers'])) {
        $num_newusers = isset($HTTP_GET_VARS['num_newusers']) ? intval($HTTP_GET_VARS['num_newusers']) : intval($HTTP_POST_VARS['num_newusers']);
    } else {
        $num_newusers = 1;
    }
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    show_form_header("users.php", "saveusers", "form", 1);
    show_table_header($lang['nav_users_add'], 2);
    show_num_select_row("&nbsp;", "num_newusers", $lang['num_newusers_desc']);
    for ($i = 1; $i <= $num_newusers; $i++) {
        show_table_separator($lang['user'] . " " . $i, 2);
        show_userlevel_select_row($lang['field_userlevel'], "user_level_" . $i);
        show_input_row($lang['field_username'], "user_name_" . $i, "", $textinput_size);
        show_input_row($lang['field_email'], "user_email_" . $i, "", $textinput_size);
        show_input_row($lang['field_password'], "user_password_" . $i, "", $textinput_size);
        show_input_row($lang['field_homepage'], "user_homepage_" . $i, "", $textinput_size);
        show_input_row($lang['field_icq'], "user_icq_" . $i, "", $textinput_size);
        show_radio_row($lang['field_showemail'], "user_showemail_" . $i, 0);
        show_radio_row($lang['field_allowemails'], "user_allowemails_" . $i, 1);
        show_radio_row($lang['field_invisible'], "user_invisible_" . $i, 0);
        show_additional_fields("user", array(), USERS_TABLE, $i);
    }
    show_hidden_input("num_newusers", $num_newusers);
    show_form_footer($lang['add'], $lang['reset'], 2);
}
show_admin_footer();
コード例 #7
0
ファイル: email.php プロジェクト: abhinay100/fourimages_app
        $site_email->set_bcc($emails);
        echo $site_email->send_email() ? $lang['send_emails_success'] : $lang['send_emails_error'];
        echo "<p>";
        show_text_link($lang['back'], "javascript:history.back(1)");
    } else {
        $msg = sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
        $action = "emailusers";
    }
}
if ($action == "emailusers") {
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    show_form_header("email.php", "sendemails");
    show_table_header($lang['send_emails'], 2);
    show_input_row($lang['send_emails_subject'], "subject", "", 45);
    show_textarea_row($lang['send_emails_message'], "message", "", 60, 20);
    $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";
コード例 #8
0
ファイル: admin_functions.php プロジェクト: 4images/4images
function show_additional_fields($type = "image", $image_row = array(), $table = IMAGES_TEMP_TABLE, $i = 0)
{
    global $site_db, $lang;
    $field_type_array = "additional_" . $type . "_fields";
    global ${$field_type_array};
    if (!empty(${$field_type_array})) {
        $table_fields = $site_db->get_table_fields($table);
        foreach (${$field_type_array} as $key => $val) {
            if (!isset($table_fields[$key])) {
                continue;
            }
            $field_name = $i ? $key . "_" . $i : $key;
            $value = isset($image_row[$key]) ? $image_row[$key] : "";
            switch ($val[1]) {
                case "textarea":
                    show_textarea_row($val[0], $field_name, $value);
                    break;
                case "radio":
                    show_radio_row($val[0], $field_name, $value == "" ? 1 : $value);
                    break;
                case "text":
                default:
                    show_input_row($val[0], $field_name, $value);
            }
            // end switch
        }
    }
}
コード例 #9
0
ファイル: categories.php プロジェクト: 4images/4images
    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');
        if ($msg != "") {
            printf("<b>%s</b>\n<p>", $msg);
コード例 #10
0
      window.location.replace("<?php 
    echo $site_sess->url("rebuild_searchindex.php?action=emptyindex");
    ?>
");
    }
  }
  //-->
  </script>
<?php 
    if (!$cat_id) {
        $cat_id = intval($site_sess->get_session_var("rsicatid"));
    }
    show_form_header("rebuild_searchindex.php", "buildsearchindex");
    show_table_header($lang_rebuild_title, 2);
    show_input_row($lang_rebuild_batchsize, "batchsize", $batchsize);
    show_input_row($lang_rebuild_batchstart, "batchstart", $batchstart);
    show_cat_select_row($lang_rebuild_category, $cat_id, 2);
    show_radio_row("Include subcategories", "subcat", $subcat);
    show_radio_row($lang_rebuild_autoredirect, "autoredirect", $autoredirect);
    show_form_footer($lang['submit'], $lang['reset'], 2);
    echo "<p align=\"center\"><b>" . $lang_rebuild_empty;
    echo " <a href=\"javascript:ConfirmEmptySearchindex()\">" . $lang_rebuild_empty_click . "</a></b></p>";
}
if ($action == "buildsearchindex") {
    $sql = "SELECT MAX(image_id) as max\n          FROM " . IMAGES_TABLE;
    $row = $site_db->query_firstrow($sql);
    $max = isset($row['max']) ? $row['max'] : 0;
    $cat_filter = "1=1";
    $order = " ORDER BY image_id ASC LIMIT {$batchsize}";
    $filter = "image_id >= " . $batchstart . $order;
    if ($cat_id) {
コード例 #11
0
ファイル: stats.php プロジェクト: abhinay100/fourimages_app
        $image_rating = sprintf("%.2f", intval($image_rating));
        $sql = "UPDATE " . IMAGES_TABLE . "\n            SET image_rating = {$image_rating}\n            {$where_sql}";
        $result = $site_db->query($sql);
        echo $result ? "<b>OK</b><br />" : "<b><span class=\"marktext\">ERROR</span></b><br />";
    }
    if ($image_votes !== "") {
        echo $lang['field_votes'] . "...";
        flush();
        $sql = "UPDATE " . IMAGES_TABLE . "\n            SET image_votes = {$image_votes}\n            {$where_sql}";
        $result = $site_db->query($sql);
        echo $result ? "<b>OK</b><br />" : "<b><span class=\"marktext\">ERROR</span></b><br />";
    }
}
if ($action == "resetstats") {
    if ($msg !== "") {
        printf("<b>%s</b>\n", $msg);
    }
    show_form_header("stats.php", "updatestats", "form", 1);
    show_table_header($lang['nav_general_stats'], 2);
    show_description_row($lang['reset_stats_desc'], 2);
    show_cat_select_row($lang['field_category'], 0, 2);
    show_table_separator($lang['nav_categories_edit'], 2);
    show_input_row($lang['field_hits'], "cat_hits", "", $textinput_size2);
    show_table_separator($lang['nav_images_edit'], 2);
    show_input_row($lang['field_hits'], "image_hits", "", $textinput_size2);
    show_input_row($lang['field_downloads'], "image_downloads", "", $textinput_size2);
    show_input_row($lang['field_rating'] . " (1-" . MAX_RATING . ")", "image_rating", "", $textinput_size2);
    show_input_row($lang['field_votes'], "image_votes", "", $textinput_size2);
    show_form_footer($lang['save_changes'], "", 2);
}
show_admin_footer();
コード例 #12
0
    } else {
        $msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
        $action = "editgroup";
    }
}
if ($action == "editgroup") {
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    $group_id = isset($HTTP_POST_VARS['group_id']) ? intval($HTTP_POST_VARS['group_id']) : intval($HTTP_GET_VARS['group_id']);
    $sql = "SELECT group_id, group_name\n          FROM " . GROUPS_TABLE . "\n          WHERE group_id = {$group_id}";
    $result = $site_db->query_firstrow($sql);
    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']);