commit
7a95325a5f
@ -243,8 +243,8 @@ class TagEdit extends Extension {
|
|||||||
global $database;
|
global $database;
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$search_set = Tag::explode(strtolower($search));
|
$search_set = Tag::explode(strtolower($search), false);
|
||||||
$replace_set = Tag::explode(strtolower($replace));
|
$replace_set = Tag::explode(strtolower($replace), false);
|
||||||
|
|
||||||
log_info("tag_edit", "Mass editing tags: '$search' -> '$replace'");
|
log_info("tag_edit", "Mass editing tags: '$search' -> '$replace'");
|
||||||
|
|
||||||
@ -266,17 +266,19 @@ class TagEdit extends Extension {
|
|||||||
// search returns high-ids first, so we want to look
|
// search returns high-ids first, so we want to look
|
||||||
// at images with lower IDs than the previous.
|
// at images with lower IDs than the previous.
|
||||||
$search_forward = $search_set;
|
$search_forward = $search_set;
|
||||||
if($last_id >= 0) $search_forward[] = "id<$last_id";
|
$search_forward[] = "order=id_desc"; //Default order can be changed, so make sure we order high > low ID
|
||||||
|
if($last_id >= 0){
|
||||||
|
$search_forward[] = "id<$last_id";
|
||||||
|
}
|
||||||
|
|
||||||
$images = Image::find_images(0, 100, $search_forward);
|
$images = Image::find_images(0, 100, $search_forward);
|
||||||
if(count($images) == 0) break;
|
if(count($images) == 0) break;
|
||||||
|
|
||||||
foreach($images as $image) {
|
foreach($images as $image) {
|
||||||
// remove the search'ed tags
|
// remove the search'ed tags
|
||||||
$before = $image->get_tag_array();
|
$before = array_map('strtolower', $image->get_tag_array());
|
||||||
$after = array();
|
$after = array();
|
||||||
foreach($before as $tag) {
|
foreach($before as $tag) {
|
||||||
$tag = strtolower($tag);
|
|
||||||
if(!in_array($tag, $search_set)) {
|
if(!in_array($tag, $search_set)) {
|
||||||
$after[] = $tag;
|
$after[] = $tag;
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ class Upload extends Extension {
|
|||||||
global $config;
|
global $config;
|
||||||
$config->set_default_int('upload_count', 3);
|
$config->set_default_int('upload_count', 3);
|
||||||
$config->set_default_int('upload_size', '1MB');
|
$config->set_default_int('upload_size', '1MB');
|
||||||
|
$config->set_default_bool('upload_tlsource', TRUE);
|
||||||
|
|
||||||
// SHIT: fucking PHP "security" measures -_-;;;
|
// SHIT: fucking PHP "security" measures -_-;;;
|
||||||
$free_num = @disk_free_space(realpath("./images/"));
|
$free_num = @disk_free_space(realpath("./images/"));
|
||||||
@ -90,6 +91,7 @@ class Upload extends Extension {
|
|||||||
$sb->add_shorthand_int_option("upload_size", "<br/>Max size per file: ");
|
$sb->add_shorthand_int_option("upload_size", "<br/>Max size per file: ");
|
||||||
$sb->add_label("<i>PHP Limit = ".ini_get('upload_max_filesize')."</i>");
|
$sb->add_label("<i>PHP Limit = ".ini_get('upload_max_filesize')."</i>");
|
||||||
$sb->add_choice_option("transload_engine", $tes, "<br/>Transload: ");
|
$sb->add_choice_option("transload_engine", $tes, "<br/>Transload: ");
|
||||||
|
$sb->add_bool_option("upload_tlsource", "<br/>Use transloaded URL as source if none is provided: ");
|
||||||
$event->panel->add_block($sb);
|
$event->panel->add_block($sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +352,7 @@ class Upload extends Extension {
|
|||||||
$metadata['filename'] = $filename;
|
$metadata['filename'] = $filename;
|
||||||
$metadata['extension'] = getExtension($headers['Content-Type']) ?: $pathinfo['extension'];
|
$metadata['extension'] = getExtension($headers['Content-Type']) ?: $pathinfo['extension'];
|
||||||
$metadata['tags'] = $tags;
|
$metadata['tags'] = $tags;
|
||||||
$metadata['source'] = $source;
|
$metadata['source'] = (($url == $source) && !$config->get_bool('upload_tlsource') ? "" : $source);
|
||||||
|
|
||||||
/* check for locked > adds to metadata if it has */
|
/* check for locked > adds to metadata if it has */
|
||||||
if(!empty($locked)){
|
if(!empty($locked)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user