diff --git a/ext/upload/main.php b/ext/upload/main.php index 75c9989c..9585122c 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -267,9 +267,7 @@ class Upload extends Extension # merge then explode, not explode then merge - else # one of the merges may create a surplus "tagme" return Tag::explode( - ($_POST["tags"] ?? "") . - " " . - ($_POST["tags$id"] ?? "") + ($_POST["tags"] ?? "") . " " . ($_POST["tags$id"] ?? "") . " " . ($_POST["rating"] ?? "") . " " . ($_POST["rating$id"] ?? "") ); } diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 198ba0af..968040e2 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -16,6 +16,8 @@ use function MicroHTML\BR; use function MicroHTML\A; use function MicroHTML\P; +use function MicroHTML\OPTION; +use function MicroHTML\SELECT; class UploadTheme extends Themelet { @@ -56,7 +58,7 @@ class UploadTheme extends Themelet ), $upload_list, TR( - TD(["colspan"=>"6"], INPUT(["id"=>"uploadbutton", "type"=>"submit", "value"=>"Post"])) + TD(["colspan"=>"8"], INPUT(["id"=>"uploadbutton", "type"=>"submit", "value"=>"Post"])) ), ) ); @@ -86,18 +88,26 @@ class UploadTheme extends Themelet TR( TD(["colspan"=>$tl_enabled ? 2 : 4], "Files"), $tl_enabled ? TD(["colspan"=>"2"], "URLs") : emptyHTML(), - TD(["colspan"=>"2"], "Post-Specific Tags"), + TD(["colspan"=>"1"], "Rating"), + TD(["colspan"=>"3"], "Post-Specific Tags"), ) ); for ($i=0; $i<$upload_count; $i++) { $upload_list->appendChild( TR( - TD(["colspan"=>$tl_enabled ? 2 : 4], INPUT(["type"=>"file", "name"=>"data${i}[]", "accept"=>$accept, "multiple"=>true])), + TD(["colspan"=>$tl_enabled ? 2 : 2], INPUT(["type"=>"file", "name"=>"data${i}[]", "accept"=>$accept, "multiple"=>true])), $tl_enabled ? TD(["colspan"=>"2"], INPUT(["type"=>"text", "name"=>"url${i}"])) : emptyHTML(), - #TD(["colspan"=>"2"], INPUT(["type"=>"text", "name"=>"tags${i}", "class"=>"autocomplete_tags", "autocomplete"=>"off"])), - DIV(["class"=>'edit'], - TD(["colspan"=>"2"], INPUT(["type"=>"text", "name"=>"tags${i}", "id"=>"tag_editor", "class"=>"autocomplete_tags", "autocomplete"=>"off"])), + TD(["colspan"=>"4"], + SELECT(["name"=>"rating${i}"], + OPTION(["value"=>"rating:safe"], "Safe"), + OPTION(["value"=>"rating:questionable"], "Questionable"), + OPTION(["value"=>"rating:explicit"], "Explicit"), + ) + ), + + DIV(["class"=>'edit'], + TD(["colspan"=>"2"], INPUT(["type"=>"text", "name"=>"tags${i}", "id"=>"tag_editor", "class"=>"autocomplete_tags", "autocomplete"=>"off"])), ) ) ); @@ -120,21 +130,21 @@ class UploadTheme extends Themelet function() { if(typeof window=="undefined" || !window.location || window.location.href=="about:blank") { window.location = "'. $main_page .'"; - } - else if(typeof document=="undefined" || !document.body) { - window.location = "'. $main_page .'?url="+encodeURIComponent(window.location.href); - } - else if(window.location.href.match("\/\/'. $_SERVER["HTTP_HOST"] .'.*")) { - alert("You are already at '. $title .'!"); - } - else { - var tags = prompt("Please enter tags", "tagme"); - if(tags != "" && tags != null) { - var link = "'. $link . $delimiter .'url="+location.href+"&tags="+tags; - var w = window.open(link, "_blank"); - } - } - } + } +else if(typeof document=="undefined" || !document.body) { + window.location = "'. $main_page .'?url="+encodeURIComponent(window.location.href); + } +else if(window.location.href.match("\/\/'. $_SERVER["HTTP_HOST"] .'.*")) { + alert("You are already at '. $title .'!"); + } +else { + var tags = prompt("Please enter tags", "tagme"); + if(tags != "" && tags != null) { + var link = "'. $link . $delimiter .'url="+location.href+"&tags="+tags; + var w = window.open(link, "_blank"); + } + } + } )();'; $html1 = P( A(["href"=>$js], "Upload to $title"), @@ -199,7 +209,7 @@ class UploadTheme extends Themelet ["id"=>"large_upload_form", "class"=>"vert"], $upload_list, TR(TD("Source"), TD(["colspan"=>3], INPUT(["name"=>"source", "type"=>"text"]))), - TR(TD(["colspan"=>4], INPUT(["id"=>"uploadbutton", "type"=>"submit", "value"=>"Post"]))), + TR(TD(["colspan"=>6], INPUT(["id"=>"uploadbutton", "type"=>"submit", "value"=>"Post"]))), ) ));