예제 #1
0
파일: backup.php 프로젝트: 4images/4images
 <?php 
   if ($db_servertype != "mysql") {
       echo "<span class=\"marktext\"><b>Note:</b> You are not using MySQL. Maybe the backup function won't work!</span>";
   }
   if ($msg != "") {
       printf("<b>%s</b>\n", $msg);
   }
   $db_status = "";
   get_database_size();
   if (!empty($global_info['database_size']['total'])) {
       $db_status .= "<p><b>" . $lang['database'] . ":</b><br>" . $lang['homestats_total'] . " <b>" . format_file_size($global_info['database_size']['total']) . "</b>";
       if (!empty($global_info['database_size']['4images'])) {
           $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);
예제 #2
0
        $action = "modifysettings";
    }
}
if ($action == "modifysettings") {
    if (isset($HTTP_GET_VARS['settings_msg'])) {
        printf("<b>%s</b><p>", trim($HTTP_GET_VARS['settings_msg']));
    } elseif (!empty($msg)) {
        echo $msg;
    }
    $sql = "SELECT setting_name, setting_value\n          FROM " . SETTINGS_TABLE;
    $result = $site_db->query($sql);
    $config = array();
    while ($row = $site_db->fetch_array($result)) {
        $config[$row['setting_name']] = $row['setting_value'];
    }
    show_form_header("settings.php", "updatesettings");
    show_table_header($lang['nav_general_settings'], 2);
    echo "<tr class=\"tablerow\"><td colspan=\"2\">";
    echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\"><tr valign=\"top\">\n";
    $numgroups = sizeof($setting_group);
    $percolumn = ceil($numgroups / 2);
    $settingcounter = 0;
    foreach ($setting_group as $key => $val) {
        $settingcounter++;
        echo "<td>";
        show_text_link($val, "#setting_group_" . $key);
        echo "<br /></td>\n";
        if ($settingcounter == 4) {
            echo "</tr><tr>";
            $settingcounter = 0;
        }
예제 #3
0
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$nozip = 1;
define('IN_CP', 1);
$root_path = false === stristr($_SERVER['PHP_SELF'], "/plugins/") ? "./../" : "./../../";
define('ROOT_PATH', $root_path);
require ROOT_PATH . 'admin/admin_global.php';
if ($config['language_dir'] == 'deutsch') {
    $lang_clear_cache = 'Cache leeren';
    $lang_clear_confirm = 'Wollen Sie das Cache-Verzeichnis leeren (%s)?';
    $lang_clear_success = 'Cache-Verzeichnis geleert';
} else {
    $lang_clear_cache = 'Clear Cache';
    $lang_clear_confirm = 'Do you want to clear the cache directory (%s)?';
    $lang_clear_success = 'Cache directory cleared';
}
show_admin_header();
if ($action == "clearcache") {
    @set_time_limit(0);
    clear_cache();
    $msg = $lang_clear_success;
}
if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
}
show_form_header($HTTP_SERVER_VARS['PHP_SELF'], "clearcache");
show_table_header($lang_clear_cache);
show_description_row(sprintf($lang_clear_confirm, realpath($cache_path)));
show_form_footer($lang['submit'], "");
show_admin_footer();
예제 #4
0
     $direction = "ASC";
 }
 $sql = "SELECT COUNT(*) AS comments\n          FROM (" . COMMENTS_TABLE . " c , " . IMAGES_TABLE . " i)\n          WHERE {$condition} AND c.image_id = i.image_id";
 $countcomments = $site_db->query_firstrow($sql);
 $limitfinish = $limitstart + $limitnumber;
 $start = 0;
 if ($countcomments['comments'] > 0) {
     $start = $limitstart + 1;
 }
 echo $lang['found'] . " <b>" . $countcomments['comments'] . "</b> " . $lang['showing'] . " <b>{$start}</b>-";
 if ($limitfinish > $countcomments['comments'] == 0) {
     echo "<b>{$limitfinish}</b>.";
 } else {
     echo "<b>" . $countcomments['comments'] . "</b>.";
 }
 show_form_header("comments.php", "removecomment", "form");
 echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
 if ($countcomments['comments'] > 0) {
     $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name, c.comment_headline, c.comment_text, c.comment_date, i.image_name\n            FROM (" . COMMENTS_TABLE . " c, " . IMAGES_TABLE . " i)\n            WHERE {$condition} AND c.image_id = i.image_id\n            ORDER BY {$orderby} {$direction}\n            LIMIT {$limitstart}, {$limitnumber}";
     $result = $site_db->query($sql);
     echo "<tr class=\"tableseparator\">\n";
     echo "<td class=\"tableseparator\"><input name=\"allbox\" type=\"checkbox\" onClick=\"CheckAll();\" /></td>\n";
     echo "<td class=\"tableseparator\">" . $lang['field_comment'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_username'] . "</td>\n<td class=\"tableseparator\">" . $lang['image'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_date'] . "</td>\n<td class=\"tableseparator\">" . $lang['options'] . "</td>\n</tr>\n";
     while ($comment_row = $site_db->fetch_array($result)) {
         echo "<tr class=\"" . get_row_bg() . "\">";
         echo "<td><input type=\"checkbox\" name=\"deletecomments[]\" value=\"" . $comment_row['comment_id'] . "\" /></td>";
         $show_comment = "<b>" . format_text($comment_row['comment_headline']) . "</b><br />";
         if (strlen($comment_row['comment_text']) > 75) {
             $comment_row['comment_text'] = substr($comment_row['comment_text'], 0, 75) . "...";
         }
         $show_comment .= format_text($comment_row['comment_text']);
예제 #5
0
$m = "";
if ($action == "migratekeywords") {
    @set_time_limit(0);
    $sql = "SELECT image_id, image_keywords, image_name, image_description FROM " . IMAGES_TABLE . " WHERE image_keywords LIKE '% %';";
    $image_result = $site_db->query($sql);
    while ($image_row = $site_db->fetch_array($image_result)) {
        $image_keywords = $image_row['image_keywords'];
        $image_id = intval($image_row['image_id']);
        $image_keywords = preg_replace("/[\n\r\\s]/is", ",", $image_keywords);
        $image_keywords_arr = explode(',', $image_keywords);
        array_walk($image_keywords_arr, 'trim_value');
        $image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));
        $sql = "UPDATE " . IMAGES_TABLE . " SET image_keywords = '" . $image_keywords . "' WHERE image_id = " . $image_id . " LIMIT 1;";
        $result = $site_db->query($sql);
        if ($result) {
            remove_searchwords($image_id);
            $search_words = array("image_name" => $image_row['image_name'], "image_description" => $image_row['image_description'], "image_keywords" => $image_row['image_keywords']);
            add_searchwords($image_id, $search_words);
            $msg .= "Image ID: " . $image_row['image_id'] . "; Keywords: " . $image_keywords . "<br />";
        }
    }
    $msg .= "<br />" . $lang_migration_success;
}
if ($msg != "") {
    printf("<b>%s</b><br /><br />\n", $msg);
}
show_form_header($HTTP_SERVER_VARS['PHP_SELF'], "migratekeywords");
show_table_header($lang_migration_title);
show_description_row($lang_migration_perform);
show_form_footer($lang['submit'], "");
show_admin_footer();
예제 #6
0
                        $imgs .= "<td>" . $quality . "</td>";
                        $imgs .= "</tr>\n";
                        $imgs .= "<input type=\"hidden\" name=\"image_dimensions[" . $image_row['image_id'] . "]\" value=\"" . $image_info[0] . "x" . $image_info[1] . "\">";
                        $image_counter++;
                    }
                }
            }
            if ($image_counter == $num_newimages) {
                break;
            }
        }
    }
    if (empty($imgs)) {
        echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
        $bgcounter = 0;
        show_description_row($lang['no_search_results']);
        show_table_footer();
    } else {
        show_form_header("resizer.php", "resizeimages", "form");
        show_hidden_input("image_type", $image_type);
        show_hidden_input("height", $height);
        show_hidden_input("dimension", $dimension);
        show_hidden_input("resize_type", $resize_type);
        show_hidden_input("quality", $quality);
        echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
        echo "<tr class=\"tableseparator\">\n<td class=\"tableseparator\">\n<input name=\"allbox\" type=\"checkbox\" onClick=\"CheckAll();\" checked=\"checked\">\n</td>\n<td class=\"tableseparator\">" . $lang['field_image_file'] . "</td>\n<td class=\"tableseparator\">" . $lang['resize_org_size'] . "</td>\n<td class=\"tableseparator\">" . $lang['resize_new_size'] . "</td>\n<td class=\"tableseparator\">" . $lang['resize_new_quality'] . "</td>\n</tr>\n";
        echo $imgs;
        show_form_footer($lang['resize_start'], "", 5);
    }
}
show_admin_footer();
예제 #7
0
        }
    } else {
        $msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
        $action = "addusers";
    }
}
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);
    }
예제 #8
0
    $action = "modifytemplates";
}
if ($action == "modifytemplates") {
    if ($msg != "") {
        printf("<p><b>%s</b></p>\n", $msg);
    }
    show_table_header($lang['edit_templates'], 2);
    show_theme_select_row($lang['choose_theme']);
    if ($themes_found) {
        show_template_select_row($lang['choose_template'], $template_folder);
    }
    show_table_footer();
    if (!isset($content)) {
        $content = "";
    }
    show_form_header("templates.php", "savetemplate");
    show_table_header($lang['edit_template'] . ": " . $template_file_name, 1);
    echo "<tr class=\"tablerow\"><td>";
    ?>
  <style>
  .template_textarea {
    width: 100%;
  }
  </style>
  <?php 
    echo "<textarea name=\"content\" cols=\"60\" rows=\"30\" wrap=\"off\" class=\"template_textarea\">";
    echo htmlspecialchars($content);
    echo "</textarea>";
    show_hidden_input("template_file_name", $template_file_name);
    show_hidden_input("template_folder", $template_folder);
    show_form_footer($lang['save_changes'], "", 1);
예제 #9
0
        //$action = "modifycats";
        forward_to_modify($msg);
    } else {
        $msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
        $action = "editcat";
    }
}
if ($action == "editcat") {
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    $cat_id = isset($HTTP_POST_VARS['cat_id']) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
    $sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment\n          FROM " . CATEGORIES_TABLE . "\n          WHERE cat_id = {$cat_id}";
    $cat_row = $site_db->query_firstrow($sql);
    show_admin_header();
    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']));
예제 #10
0
 show_form_footer($lang['search'], $lang['reset'], 2);
 $sql = "SELECT COUNT(*) AS images\n          FROM " . IMAGES_TEMP_TABLE . " i\n          WHERE {$condition}";
 $countimages = $site_db->query_firstrow($sql);
 $limitfinish = $limitstart + $limitnumber;
 $start = 0;
 if ($countimages['images'] > 0) {
     $start = $limitstart + 1;
 }
 echo $lang['found'] . " <b>" . $countimages['images'] . "</b> " . $lang['showing'] . " <b>{$start}</b>-";
 if ($limitfinish > $countimages['images'] == 0) {
     echo "<b>" . $limitfinish . "</b>.";
 } else {
     echo "<b>" . $countimages['images'] . "</b>.";
 }
 echo "<br />" . $lang['no_image_found'];
 show_form_header("validateimages.php", "saveimages", "form");
 $bgcounter = 0;
 echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
 if ($countimages['images'] > 0) {
     echo "<tr class=\"tableseparator\">\n";
     echo "<td class=\"tableseparator\">" . $lang['validate'] . "</td>\n<td class=\"tableseparator\">" . $lang['delete'] . "</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">" . $lang['field_image_name'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_category'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_username'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_date'] . "</td>\n<td class=\"tableseparator\">" . $lang['options'] . "</td>\n</tr>\n";
     $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_date, i.image_media_file" . get_user_table_field(", u.", "user_name") . "\n            FROM " . IMAGES_TEMP_TABLE . " i\n            LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)\n            WHERE {$condition}\n            ORDER BY {$orderby} {$direction}\n            LIMIT {$limitstart}, {$limitnumber}";
     $result = $site_db->query($sql);
     while ($image_row = $site_db->fetch_array($result)) {
         echo "<tr class=\"" . get_row_bg() . "\">";
         $image_path = is_remote($image_row['image_media_file']) ? $image_row['image_media_file'] : MEDIA_TEMP_PATH . "/" . $image_row['image_media_file'];
         $file_src = get_file_path($image_row['image_media_file'], "media", 0, 1);
         echo "<td><input type=\"radio\" name=\"image_list[" . $image_row['image_id'] . "]\" value=\"1\"></td>";
         echo "<td><input type=\"radio\" name=\"image_list[" . $image_row['image_id'] . "]\" value=\"0\"></td>";
         echo "<td><a href=\"" . $image_path . "\" target=\"_blank\"><img src=\"" . $file_src . "\" border=\"1\" height=\"50\"></a></td>";
         echo "<td><b><a href=\"" . $image_path . "\" target=\"_blank\">" . format_text($image_row['image_name'], 2) . "</a></b> (" . $image_row['image_media_file'];
    echo $lang_rebuild_empty_confirm;
    ?>
')) {
      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";
예제 #12
0
        $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();
예제 #13
0
                 $imgs .= "<td width=\"25%\">" . format_text($cat_cache[$image_row['cat_id']]['cat_name'], 2) . "</td></tr>\n";
                 $image_counter++;
             }
         }
         if ($image_counter == $num_newimages) {
             break;
         }
     }
 }
 if (empty($imgs)) {
     echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
     $bgcounter = 0;
     show_description_row($lang['no_search_results'], 4);
     show_table_footer();
 } else {
     show_form_header("thumbnailer.php", "createthumbnails", "form");
     echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
     echo "<tr class=\"tableseparator\">\n<td class=\"tableseparator\"><input name=allbox type=checkbox onClick=\"CheckAll();\" checked=\"checked\"></td>\n<td class=\"tableseparator\">" . $lang['field_image_name'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_image_file'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_category'] . "</td>\n</tr>\n";
     echo $imgs;
     show_table_separator($lang['convert_options'], 4);
     echo "<tr class=\"" . get_row_bg() . "\">\n<td colspan=\"2\"><p class=\"rowtitle\">" . $lang['convert_thumbnail_dimension'] . "</p></td>\n";
     echo "<td colspan=\"2\"><p><input type=\"text\" size=\"" . $textinput_size . "\" name=\"dimension\" value=\"" . $config['auto_thumbnail_dimension'] . "\"></p></td>\n</tr>\n";
     echo "<tr class=\"" . get_row_bg() . "\">\n<td colspan=\"2\" valign=\"top\"><p class=\"rowtitle\">" . $lang['resize_proportions_desc'] . "</p></td>\n";
     echo "<td colspan=\"2\"><p>";
     echo "<input type=\"radio\" name=\"resize_type\" value=\"1\" checked=\"checked\"> " . $lang['resize_proportionally'] . "<br />";
     echo "<input type=\"radio\" name=\"resize_type\" value=\"2\"> " . $lang['resize_fixed_width'] . "<br />";
     echo "<input type=\"radio\" name=\"resize_type\" value=\"3\"> " . $lang['resize_fixed_height'] . "<br />";
     echo "</p></td>\n</tr>\n";
     echo "<tr class=\"" . get_row_bg() . "\">\n<td colspan=\"2\"><p class=\"rowtitle\">" . $lang['convert_thumbnail_quality'] . "</p></td>\n";
     echo "<td colspan=\"2\"><p><input type=\"text\" size=\"" . $textinput_size . "\" name=\"quality\" value=\"" . $config['auto_thumbnail_quality'] . "\"></p></td>\n</tr>\n";
     show_form_footer($lang['create_thumbnails'], "", 4);
예제 #14
0
if ($action == "final") {
    $log = $site_sess->get_session_var("imchklog");
    $log = trim($log, ";");
    $log_array = explode(";", $log);
    $log = array();
    $i = 0;
    foreach ($log_array as $key) {
        $error = explode(",", $key);
        if ($error[0] && !in_array($error[0], $ids)) {
            $log[] = $key;
            $i++;
        }
    }
    $site_sess->set_session_var("imchklog", implode(";", $log));
    if ($i) {
        show_form_header("files_check.php", "removeimage", "form");
        echo "Found <font color=red><b>" . count($log) . "</b></font> errors<br><br>";
        echo "<table><tr><td bgcolor=\"green\" width=\"10\" height=\"10\">&nbsp;</td><td width=\"150\"> - Local files</td>";
        echo "<td bgcolor=\"red\" width=\"10\" height=\"10\">&nbsp;</td><td> - Critical errors</td></tr>";
        echo "<td bgcolor=\"orange\" width=\"10\" height=\"10\">&nbsp;</td><td> - Remote files</td>";
        echo "<td bgcolor=\"black\" width=\"10\" height=\"10\">&nbsp;</td><td> - Warnings</td></tr></table><br>";
        echo "<table class=\"tableheader\" cellspacing=\"1\" cellpadding=\"0\"><tr><td>";
        echo "<table bgcolor=\"white\" cellspacing=\"1\" cellpadding=\"3\"><tr align=\"center\"><td class=\"tableheader\">&nbsp;</td>\n";
        echo "<td class=\"tableseparator\"><input name=\"allbox\" type=\"checkbox\" onClick=\"CheckAll();\" /></td>\n";
        echo "<td class=\"tableheader\">Image name</td><td class=\"tableheader\">ID</td>";
        echo "<td class=\"tableheader\">Category</td><td class=\"tableheader\">User Name</td><td class=\"tableheader\">Date</td><td class=\"tableheader\">Image file</td><td class=\"tableheader\">Ext.</td>" . ($thumbs ? "<td class=\"tableheader\">Thumb file</td><td class=\"tableheader\">Ext.</td>" : "") . "<td class=\"tableheader\">Action</td></tr>\n";
        $i = 1;
        foreach ($log as $key) {
            $error = explode(",", $key);
            $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, i.image_date" . get_user_table_field(", u.", "user_name") . "\n              FROM " . IMAGES_TABLE . " i, " . USERS_TABLE . " u\n              WHERE image_id = " . $error[0] . " AND " . get_user_table_field("u.", "user_id") . " = i.user_id\n              LIMIT 1";
            $image_row = $site_db->query_firstrow($sql);
예제 #15
0
 }
 $sql = "SELECT COUNT(*) AS images\n          FROM " . IMAGES_TABLE . " i\n          LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)\n          WHERE " . $condition;
 $countimages = $site_db->query_firstrow($sql);
 $limitfinish = $limitstart + $limitnumber;
 $start = 0;
 if ($countimages['images'] > 0) {
     $start = $limitstart + 1;
 }
 echo $lang['found'] . " <b>" . $countimages['images'] . "</b> " . $lang['showing'] . " <b>{$start}</b>-";
 if ($limitfinish > $countimages['images'] == 0) {
     echo "<b>" . $limitfinish . "</b>.";
 } else {
     echo "<b>" . $countimages['images'] . "</b>.";
 }
 echo "<br />" . $lang['no_image_found'];
 show_form_header("images.php", "removeimage", "form");
 echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
 if ($countimages['images'] > 0) {
     echo "<tr class=\"tableseparator\">\n";
     echo "<td class=\"tableseparator\"><input name=\"allbox\" type=\"checkbox\" onClick=\"CheckAll();\" /></td>\n";
     echo "<td class=\"tableseparator\">" . $lang['field_image_name'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_category'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_username'] . "</td>\n<td class=\"tableseparator\">" . $lang['field_date'] . "</td>\n<td class=\"tableseparator\">" . $lang['options'] . "</td>\n</tr>\n";
     $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_date" . get_user_table_field(", u.", "user_name") . "\n            FROM " . IMAGES_TABLE . " i\n            LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)\n            WHERE {$condition}\n            ORDER BY {$orderby} {$direction}\n            LIMIT {$limitstart}, {$limitnumber}";
     $result = $site_db->query($sql);
     while ($image_row = $site_db->fetch_array($result)) {
         echo "<tr class=\"" . get_row_bg() . "\">";
         echo "<td><input type=\"checkbox\" name=\"deleteimages[]\" value=\"" . $image_row['image_id'] . "\" /></td>";
         echo "<td><b><a href=\"" . $site_sess->url(ROOT_PATH . "details.php?" . URL_IMAGE_ID . "=" . $image_row['image_id']) . "\" target=_blank>" . format_text($image_row['image_name'], 2) . "</a></b> (" . $image_row['image_media_file'];
         if (!get_file_path($image_row['image_media_file'], "media", $image_row['cat_id'], 1, 0)) {
             echo " <b class=\"marktext\">!</b>";
         }
         echo ")</td>\n";
예제 #16
0
<?php

/**
 * DiscuzX Convert
 *
 * $Id: do_setting.inc.php 10469 2010-05-11 09:12:14Z monkey $
 */
showtips('setting_tips');
$sfile = DISCUZ_ROOT . './source/' . $source . '/setting.ini';
if (!submitcheck('submit')) {
    show_form_header();
    show_table_header();
    show_table_row(array(array('colspan="3"', '编辑配置文件 source/' . $source . '/setting.ini')), 'title');
    foreach ($setting as $key => $value) {
        if (is_array($value) && !empty($value)) {
            show_table_row(array(array('colspan="3" align="left"', '<strong>[' . $key . ']<strong>')), 'bg1');
            $disabled = in_array($key, array('program', 'config', 'steps', 'start', 'tablecheck')) ? ' disabled readonly' : '';
            foreach ($value as $k => $v) {
                show_table_row(array(lang($k), array('class="bg2" width="70%"', '<input type="text" size="40" name="newsetting[' . $key . '][' . $k . ']" value="' . htmlspecialchars($v) . '"' . $disabled . '>' . ($disabled ? ' 只读' : ''))), 'bg2');
            }
        }
    }
    show_table_footer();
    show_form_footer('submit', lang('submit'));
} else {
    $newsetting = getgpc('newsetting');
    if (is_array($newsetting)) {
        $lines = file($sfile);
        foreach ($lines as $num => $line) {
            $lines[$num] = $line = trim($line);
            $check = substr($line, 0, 1);
예제 #17
0
        $site_email->set_body("admin_email", $config['language_dir']);
        $emails = $HTTP_POST_VARS['emails'];
        $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";
예제 #18
0
             break;
         }
         if (!@in_array($image_list_all[$key][$i], $image_list_sql[$key])) {
             $image_list[$key][] = $image_list_all[$key][$i];
             $image_counter++;
         }
     }
 }
 foreach ($image_list as $key => $val) {
     sort($image_list[$key]);
 }
 $num_all_newimages = $image_counter;
 if ($msg != "") {
     printf("<b>%s</b>\n", $msg);
 }
 show_form_header("checkimages.php", "savenewimages", "form");
 show_table_header($lang['cni_auto_resizer'] . "&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"auto_resize\" value=\"1\"" . ($auto_resize ? " checked" : "") . ">" . $lang['on'] . "&nbsp;<input type=\"radio\" name=\"auto_resize\" value=\"\"" . ($auto_resize ? "" : " checked") . ">" . $lang['off'], 2);
 show_input_row($lang['resize_dimension_desc'], "dimension", $dimension);
 $resize = "\n<select name=\"resize_type\">\n";
 foreach ($auto_thumbnail_resize_type_optionlist as $key => $val) {
     $resize .= "<option value=\"{$key}\"";
     if ($resize_type == $key) {
         $resize .= " selected=\"selected\"";
     }
     $resize .= ">{$val}</option>\n";
 }
 $resize .= "</select>\n";
 show_custom_row($lang['resize_proportions_desc'], $resize);
 show_input_row($lang['resize_quality_desc'], "quality", $quality);
 show_radio_row($lang['cni_save_orig'], "big", $big);
 show_input_row($lang['cni_big_folder'], "big_folder", $big_folder);
예제 #19
0
        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']);
        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>";
    }