Merge pull request #157 from DakuTree/master

Fixes/Features
This commit is contained in:
Shish 2012-03-05 01:28:22 -08:00
commit e56bd7b276
6 changed files with 21 additions and 2 deletions

View File

@ -307,6 +307,8 @@ class ImageIO extends Extension {
return null;
}
else {
$merged = array_merge($image->get_tag_array(), $existing->get_tag_array()); //TODO: Make this only work if &update=1 is set
send_event(new TagSetEvent($existing, $merged)); //Update tags even if image exists
$error = "Image <a href='".make_link("post/view/{$existing->id}")."'>{$existing->id}</a> ".
"already has hash {$image->hash}:<p>".Themelet::build_thumb_html($existing);
throw new ImageAdditionException($error);

View File

@ -14,6 +14,8 @@ class TagList extends Extension {
$config->set_default_int("tags_min", 3);
$config->set_default_string("info_link", 'http://en.wikipedia.org/wiki/$tag');
$config->set_default_string("tag_list_image_type", 'related');
$config->set_default_string("tag_list_related_sort", 'alphabetical');
$config->set_default_string("tag_list_popular_sort", 'tagcount');
$config->set_default_bool("tag_list_pages", false);
}
@ -98,6 +100,14 @@ class TagList extends Extension {
"Image's tags only" => "tags",
"Show related" => "related"
), "<br>Image tag list: ");
$sb->add_choice_option("tag_list_related_sort", array(
"Tag Count" => "tagcount",
"Alphabetical" => "alphabetical"
), "<br>Sort related list by: ");
$sb->add_choice_option("tag_list_popular_sort", array(
"Tag Count" => "tagcount",
"Alphabetical" => "alphabetical"
), "<br>Sort popular list by: ");
$sb->add_bool_option("tag_list_numbers", "<br>Show tag counts: ");
$event->panel->add_block($sb);
}

View File

@ -36,6 +36,8 @@ class TagListTheme extends Themelet {
$html = "";
$n = 0;
if($config->get_string('tag_list_related_sort') == 'alphabetical') asort($tag_infos);
foreach($tag_infos as $row) {
$tag = $row['tag'];
$h_tag = html_escape($tag);
@ -77,6 +79,7 @@ class TagListTheme extends Themelet {
$html = "";
$n = 0;
if($config->get_string('tag_list_popular_sort') == 'alphabetical') asort($tag_infos);
foreach($tag_infos as $row) {
$tag = $row['tag'];

View File

@ -1,16 +1,19 @@
/* Imageboard to Shimmie */
// This should work with "most" sites running Danbooru/Gelbooru/Shimmie
//TODO: Make this use jQuery!
var maxsze = (maxsze.match("(?:\.*[0-9])")) * 1024; //This assumes we are only working with MB.
var toobig = "The file you are trying to upload is too big to upload!";
var notsup = "The file you are trying to upload is not supported!";
if (CA === 0 || CA > 2){ //Default
if (confirm("OK = Use Current tags.\nCancel = Use new tags.")==true){
//Do nothing
}else{
var tag=prompt("Enter Tags","");
var chk=1; //This makes sure it doesn't use current tags.
}
}else if (CA === 1){ //Current Tags
//Do nothing
}else if (CA === 2){ //New Tags
var tag=prompt("Enter Tags","");
var chk=1;
@ -19,6 +22,7 @@ if (CA === 0 || CA > 2){ //Default
// Danbooru | oreno.imouto | konachan | sankakucomplex
if(document.getElementById("post_tags") !== null){
if (typeof tag !=="ftp://ftp." && chk !==1){var tag=document.getElementById("post_tags").value;}
tag = tag.replace(/\+/g, "%2B"); //This should stop + not showing in tags :x
var srx="http://" + document.location.hostname + document.location.href.match("\/post\/show\/[0-9]+");
if(srx.search("oreno\\.imouto") >= 0 || srx.search("konachan\\.com") >= 0){
var rtg=document.getElementById("stats").innerHTML.match("<li>Rating: (.*) <span")[1];

View File

@ -7,7 +7,7 @@ class CustomViewImageTheme extends ViewImageTheme {
$page->set_heading(html_escape($image->get_tag_list()));
$page->add_block(new Block("Navigation", $this->build_navigation($image), "left", 0));
$page->add_block(new Block("Statistics", $this->build_stats($image), "left", 15));
$page->add_block(new Block(null, $this->build_image_editor($image, $editor_parts), "main", 10));
$page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 10));
$page->add_block(new Block(null, $this->build_pin($image), "main", 11));
}

View File

@ -13,7 +13,7 @@ class CustomViewImageTheme extends ViewImageTheme {
$page->add_html_header("<meta property=\"og:url\" content=\"".make_http(make_link("post/view/{$image->id}"))."\">");
$page->add_block(new Block("Navigation", $this->build_navigation($image), "left", 0));
$page->add_block(new Block("Statistics", $this->build_stats($image), "left", 15));
$page->add_block(new Block(null, $this->build_image_editor($image, $editor_parts), "main", 10));
$page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 10));
$page->add_block(new Block(null, $this->build_pin($image), "main", 11));
}