commit
986d010f8e
@ -15,6 +15,7 @@ class TagList implements Extension {
|
||||
|
||||
if($event instanceof InitExtEvent) {
|
||||
$config->set_default_int("tag_list_length", 15);
|
||||
$config->set_default_int("popular_tag_list_length", 15);
|
||||
$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');
|
||||
@ -85,7 +86,8 @@ class TagList implements Extension {
|
||||
$event->panel->add_block($sb);
|
||||
|
||||
$sb = new SetupBlock("Popular / Related Tag List");
|
||||
$sb->add_int_option("tag_list_length", "Show top "); $sb->add_label(" tags");
|
||||
$sb->add_int_option("tag_list_length", "Show top "); $sb->add_label(" related tags");
|
||||
$sb->add_int_option("popular_tag_list_length", "<br>Show top "); $sb->add_label(" popular tags");
|
||||
$sb->add_text_option("info_link", "<br>Tag info link: ");
|
||||
$sb->add_choice_option("tag_list_image_type", array(
|
||||
"Image's tags only" => "tags",
|
||||
@ -301,9 +303,9 @@ class TagList implements Extension {
|
||||
FROM tags
|
||||
WHERE count > 0
|
||||
ORDER BY count DESC
|
||||
LIMIT :tag_list_length
|
||||
LIMIT :popular_tag_list_length
|
||||
";
|
||||
$args = array("tag_list_length"=>$config->get_int('tag_list_length'));
|
||||
$args = array("popular_tag_list_length"=>$config->get_int('popular_tag_list_length'));
|
||||
|
||||
$tags = $database->get_all($query, $args);
|
||||
$database->cache->set("popular_tags", $tags, 600);
|
||||
|
@ -62,19 +62,29 @@ class UploadTheme extends Themelet {
|
||||
";
|
||||
|
||||
if($tl_enabled) {
|
||||
$link = make_http(make_link("upload"));
|
||||
$link = make_http(make_link("upload"));
|
||||
if($config->get_bool('nice_urls')){
|
||||
$delimiter = '?';
|
||||
} else {
|
||||
$delimiter = '&';
|
||||
}
|
||||
{
|
||||
$title = "Upload to " . $config->get_string('title');
|
||||
$html .= '<p><a href="javascript:location.href="' .
|
||||
$link . '?url="+location.href+"&tags="+prompt("enter tags")">' .
|
||||
$link . $delimiter . 'url="+location.href+"&tags="+prompt("enter tags")">' .
|
||||
$title . '</a> (Drag & drop onto your bookmarks toolbar, then click when looking at an image)';
|
||||
}
|
||||
if($tl_enabled) {
|
||||
$link = make_http(make_link("upload"));
|
||||
}
|
||||
{
|
||||
$title = "Danbooru to " . $config->get_string('title');
|
||||
$html .= '<p><a href="javascript:if(document.getElementById("post_old_tags").value.search(/\bflash\b/)==-1) { location.href="' .
|
||||
$link . '?url="+document.getElementById("highres").href+"&tags="+document.getElementById("post_old_tags").value } else { location.href="' .
|
||||
$link . '?url="+document.getElementsByName("movie")[0].value+"&tags="+document.getElementById("post_old_tags").value } ">' .
|
||||
$html .= '<p><a href="javascript:var img=document.getElementById("highres").href;var ste="' .
|
||||
$link . $delimiter . 'url=";var tag=document.getElementById("post_old_tags").value;if (confirm("OK = Use Current tags.\nCancel = Use new tags.")==true)' .
|
||||
'{if(tag.search(/\bflash\b/)==-1){location.href=ste+img+"&tags="+tag;}else{location.href=ste+document.getElementsByName("movie")[0].value' .
|
||||
'+"&tags="+tag;}}else{var p=prompt("Enter Tags","");if(tag.search(/\bflash\b/)==-1){location.href=ste+img+"&tags="+p;}' .
|
||||
'else{location.href=ste+document.getElementsByName("movie")[0].value+"&tags="+p;}}">' .
|
||||
$title . '</a> (As above, Click on a Danbooru-run image page. (This also grabs the tags!))';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$page->set_title("Upload");
|
||||
@ -187,4 +197,4 @@ class UploadTheme extends Themelet {
|
||||
";
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user