public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Forum"); $sb->add_int_option("forumTitleSubString", "Title max long: "); $sb->add_int_option("forumThreadsPerPage", "<br>Threads per page: "); $sb->add_int_option("forumPostsPerPage", "<br>Posts per page: "); $sb->add_int_option("forumMaxCharsPerPost", "<br>Max chars per post: "); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Pools"); $sb->add_int_option("poolsMaxImportResults", "Max results on import: "); $sb->add_int_option("poolsImagesPerPage", "<br>Images per page: "); $sb->add_int_option("poolsListsPerPage", "<br>Index list items per page: "); $sb->add_int_option("poolsUpdatedPerPage", "<br>Updated list items per page: "); $sb->add_bool_option("poolsInfoOnViewImage", "<br>Show pool info on image: "); //$sb->add_bool_option("poolsAdderOnViewImage", "<br>Show pool adder on image: "); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Tagger"); $sb->add_int_option("ext_tagger_search_delay", "Delay queries by "); $sb->add_label(" milliseconds."); $sb->add_label("<br/>Limit queries returning more than "); $sb->add_int_option("ext_tagger_tag_max"); $sb->add_label(" tags to "); $sb->add_int_option("ext_tagger_limit"); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Pools"); $sb->add_int_option("poolsMaxImportResults", "Max results on import: "); $sb->add_int_option("poolsImagesPerPage", "<br>Images per page: "); $sb->add_int_option("poolsListsPerPage", "<br>Index list items per page: "); $sb->add_int_option("poolsUpdatedPerPage", "<br>Updated list items per page: "); $sb->add_bool_option("poolsInfoOnViewImage", "<br>Show pool info on image: "); $sb->add_bool_option("poolsShowNavLinks", "<br>Show 'Prev' & 'Next' links when viewing pool images: "); $sb->add_bool_option("poolsAutoIncrementOrder", "<br>Autoincrement order when post is added to pool:"); //$sb->add_bool_option("poolsAdderOnViewImage", "<br>Show pool adder on image: "); $event->panel->add_block($sb); }
public function onSetupBuilding($event) { $sb = new SetupBlock("Image Resize"); $sb->add_bool_option("resize_enabled", "Allow resizing images: "); $sb->add_label("<br>Preset/Default Width: "); $sb->add_int_option("resize_default_width"); $sb->add_label(" px"); $sb->add_label("<br>Preset/Default Height: "); $sb->add_int_option("resize_default_height"); $sb->add_label(" px"); $sb->add_label("<br>(enter 0 for no default)"); $event->panel->add_block($sb); }
public function receive_event(Event $event) { global $config, $database, $page, $user; //if(is_null($this->theme)) $this->theme = get_theme_object($this); if ($event instanceof ImageInfoBoxBuildingEvent) { if (!$config->get_bool("tageditcloud_disable")) { if ($this->can_tag($event->image)) { if (!($cfg_minusage = $config->get_int("tageditcloud_minusage"))) { $cfg_minusage = 2; } if (!($cfg_defcount = $config->get_int("tageditcloud_defcount"))) { $cfg_defcount = 40; } if (!($cfg_maxcount = $config->get_int("tageditcloud_maxcount"))) { $cfg_maxcount = 4096; } if ($config->get_string("tageditcloud_sort") != "p") { $event->add_part($this->build_tag_map($event->image, $cfg_minusage, false), 40); } else { $event->add_part($this->build_tag_map($event->image, $cfg_defcount, $cfg_maxcount), 40); } } } } if ($event instanceof InitExtEvent) { $config->set_default_bool("tageditcloud_disable", false); $config->set_default_bool("tageditcloud_usedfirst", true); $config->set_default_string("tageditcloud_sort", 'a'); $config->set_default_int("tageditcloud_minusage", 2); $config->set_default_int("tageditcloud_defcount", 40); $config->set_default_int("tageditcloud_maxcount", 4096); } if ($event instanceof SetupBuildingEvent) { $sort_by = array('Alphabetical' => 'a', 'Popularity' => 'p'); $sb = new SetupBlock("Tag Edit Cloud"); $sb->add_bool_option("tageditcloud_disable", "Disable Tag Selection Cloud: "); $sb->add_choice_option("tageditcloud_sort", $sort_by, "<br>Sort the tags by:"); $sb->add_bool_option("tageditcloud_usedfirst", "<br>Always show used tags first: "); $sb->add_label("<br><b>Alpha sort</b>:<br>Only show tags used at least "); $sb->add_int_option("tageditcloud_minusage"); $sb->add_label(" times.<br><b>Popularity sort</b>:<br>Show "); $sb->add_int_option("tageditcloud_defcount"); $sb->add_label(" tags by default.<br>Show a maximum of "); $sb->add_int_option("tageditcloud_maxcount"); $sb->add_label(" tags."); $event->panel->add_block($sb); } }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Random Images List"); // custom headers $sb->add_int_option("random_images_list_count", "Amount of Random images to display "); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Blotter"); $sb->add_int_option("blotter_recent", "<br />Number of recent entries to display: "); $sb->add_text_option("blotter_color", "<br />Color of important updates: (ABCDEF format) "); $sb->add_choice_option("blotter_position", array("Top of page" => "subheading", "In navigation bar" => "left"), "<br>Position: "); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sort_by = array('Alphabetical' => 'a', 'Popularity' => 'p', 'Relevance' => 'r'); $sb = new SetupBlock("Tag Edit Cloud"); $sb->add_bool_option("tageditcloud_disable", "Disable Tag Selection Cloud: "); $sb->add_choice_option("tageditcloud_sort", $sort_by, "<br>Sort the tags by:"); $sb->add_bool_option("tageditcloud_usedfirst", "<br>Always show used tags first: "); $sb->add_label("<br><b>Alpha sort</b>:<br>Only show tags used at least "); $sb->add_int_option("tageditcloud_minusage"); $sb->add_label(" times.<br><b>Popularity/Relevance sort</b>:<br>Show "); $sb->add_int_option("tageditcloud_defcount"); $sb->add_label(" tags by default.<br>Show a maximum of "); $sb->add_int_option("tageditcloud_maxcount"); $sb->add_label(" tags."); $sb->add_label("<br><b>Relevance sort</b>:<br>Ignore tags (space separated): "); $sb->add_text_option("tageditcloud_ignoretags"); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Image Rotate"); $sb->add_bool_option("rotate_enabled", "Allow rotating images: "); $sb->add_label("<br>Default Orientation: "); $sb->add_int_option("rotate_default_deg"); $sb->add_label(" deg"); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Resolution Limits"); $sb->add_label("Min "); $sb->add_int_option("upload_min_width"); $sb->add_label(" x "); $sb->add_int_option("upload_min_height"); $sb->add_label(" px"); $sb->add_label("<br>Max "); $sb->add_int_option("upload_max_width"); $sb->add_label(" x "); $sb->add_int_option("upload_max_height"); $sb->add_label(" px"); $sb->add_label("<br>(-1 for no limit)"); $sb->add_label("<br>Ratios "); $sb->add_text_option("upload_ratios"); $sb->add_label("<br>(eg. '4:3 16:9', blank for no limit)"); $event->panel->add_block($sb); }
public function receive_event(Event $event) { global $config, $database, $page, $user; if (is_null($this->theme)) { $this->theme = get_theme_object($this); } if ($event instanceof InitExtEvent) { $config->set_default_int("history_limit", -1); // shimmie is being installed so call install to create the table. if ($config->get_int("ext_tag_history_version") < 3) { $this->install(); } } if ($event instanceof PageRequestEvent && $event->page_matches("tag_history")) { if ($event->get_arg(0) == "revert") { // this is a request to revert to a previous version of the tags if ($config->get_bool("tag_edit_anon") || !$user->is_anonymous()) { $this->process_revert_request($_POST['revert']); } } else { if ($event->count_args() == 1) { // must be an attempt to view a tag history $image_id = int_escape($event->get_arg(0)); $this->theme->display_history_page($page, $image_id, $this->get_tag_history_from_id($image_id)); } else { $this->theme->display_global_page($page, $this->get_global_tag_history()); } } } if ($event instanceof DisplayingImageEvent) { // handle displaying a link on the view page $this->theme->display_history_link($page, $event->image->id); } if ($event instanceof ImageDeletionEvent) { // handle removing of history when an image is deleted $this->delete_all_tag_history($event->image->id); } if ($event instanceof SetupBuildingEvent) { $sb = new SetupBlock("Tag History"); $sb->add_label("Limit to "); $sb->add_int_option("history_limit"); $sb->add_label(" entires per image"); $sb->add_label("<br>(-1 for unlimited)"); $event->panel->add_block($sb); } if ($event instanceof TagSetEvent) { $this->add_tag_history($event->image, $event->tags); } if ($event instanceof UserBlockBuildingEvent) { if ($user->is_admin()) { $event->add_link("Tag Changes", make_link("tag_history")); } } }
public function receive_event(Event $event) { if (is_null($this->theme)) { $this->theme = get_theme_object($this); } if ($event instanceof DisplayingImageEvent) { global $page, $config, $user; if ($config->get_bool("tag_edit_anon") || $user->id != $config->get_int("anon_id") && $config->get_bool("ext_tagger_enabled")) { $this->theme->build_tagger($page, $event); } } if ($event instanceof SetupBuildingEvent) { $sb = new SetupBlock("Tagger"); $sb->add_bool_option("ext_tagger_enabled", "Enable Tagger"); $sb->add_int_option("ext_tagger_search_delay", "<br/>Delay queries by "); $sb->add_label(" milliseconds."); $sb->add_label("<br/>Limit queries returning more than "); $sb->add_int_option("ext_tagger_tag_max"); $sb->add_label(" tags to "); $sb->add_int_option("ext_tagger_limit"); $event->panel->add_block($sb); } }
public function receive_event(Event $event) { if ($event instanceof ImageAdditionEvent) { global $config; $min_w = $config->get_int("upload_min_width", -1); $min_h = $config->get_int("upload_min_height", -1); $max_w = $config->get_int("upload_max_width", -1); $max_h = $config->get_int("upload_max_height", -1); $ratios = explode(" ", $config->get_string("upload_ratios", "")); $image = $event->image; if ($min_w > 0 && $image->width < $min_w) { throw new UploadException("Image too small"); } if ($min_h > 0 && $image->height < $min_h) { throw new UploadException("Image too small"); } if ($max_w > 0 && $image->width > $max_w) { throw new UploadException("Image too large"); } if ($max_h > 0 && $image->height > $max_h) { throw new UploadException("Image too large"); } if (count($ratios) > 0) { $ok = false; $valids = 0; foreach ($ratios as $ratio) { $parts = explode(":", $ratio); if (count($parts) < 2) { continue; } $valids++; $width = $parts[0]; $height = $parts[1]; if ($image->width / $width == $image->height / $height) { $ok = true; break; } } if ($valids > 0 && !$ok) { throw new UploadException("Image needs to be in one of these ratios: " . html_escape($config->get_string("upload_ratios", ""))); } } } if ($event instanceof SetupBuildingEvent) { $sb = new SetupBlock("Resolution Limits"); $sb->add_label("Min "); $sb->add_int_option("upload_min_width"); $sb->add_label(" x "); $sb->add_int_option("upload_min_height"); $sb->add_label(" px"); $sb->add_label("<br>Max "); $sb->add_int_option("upload_max_width"); $sb->add_label(" x "); $sb->add_int_option("upload_max_height"); $sb->add_label(" px"); $sb->add_label("<br>(-1 for no limit)"); $sb->add_label("<br>Ratios "); $sb->add_text_option("upload_ratios"); $sb->add_label("<br>(eg. '4:3 16:9', blank for no limit)"); $event->panel->add_block($sb); } }
public function onSetupBuilding($event) { $sb = new SetupBlock("Image Options"); $sb->position = 30; // advanced only //$sb->add_text_option("image_ilink", "Image link: "); //$sb->add_text_option("image_tlink", "<br>Thumbnail link: "); $sb->add_text_option("image_tip", "Image tooltip: "); $sb->add_choice_option("upload_collision_handler", array('Error' => 'error', 'Merge' => 'merge'), "<br>Upload collision handler: "); if (!in_array("OS", $_SERVER) || $_SERVER["OS"] != 'Windows_NT') { $sb->add_bool_option("image_show_meta", "<br>Show metadata: "); } $event->panel->add_block($sb); $thumbers = array(); $thumbers['Built-in GD'] = "gd"; $thumbers['ImageMagick'] = "convert"; $sb = new SetupBlock("Thumbnailing"); $sb->add_choice_option("thumb_engine", $thumbers, "Engine: "); $sb->add_label("<br>Size "); $sb->add_int_option("thumb_width"); $sb->add_label(" x "); $sb->add_int_option("thumb_height"); $sb->add_label(" px at "); $sb->add_int_option("thumb_quality"); $sb->add_label(" % quality "); $sb->add_shorthand_int_option("thumb_mem_limit", "<br>Max memory use: "); $event->panel->add_block($sb); }
public function receive_event(Event $event) { global $config, $database, $page, $user; if ($this->theme == null) { $this->theme = get_theme_object($this); } 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'); $config->set_default_bool("tag_list_pages", false); } if ($event instanceof PageRequestEvent && $event->page_matches("tags")) { $this->theme->set_navigation($this->build_navigation()); switch ($event->get_arg(0)) { default: case 'map': $this->theme->set_heading("Tag Map"); $this->theme->set_tag_list($this->build_tag_map()); break; case 'alphabetic': $this->theme->set_heading("Alphabetic Tag List"); $this->theme->set_tag_list($this->build_tag_alphabetic()); break; case 'popularity': $this->theme->set_heading("Tag List by Popularity"); $this->theme->set_tag_list($this->build_tag_popularity()); break; case 'categories': $this->theme->set_heading("Popular Categories"); $this->theme->set_tag_list($this->build_tag_categories()); break; } $this->theme->display_page($page); } if ($event instanceof PageRequestEvent && $event->page_matches("api/internal/tag_list/complete")) { $all = $database->get_all("SELECT tag FROM tags WHERE tag LIKE :search AND count > 0 LIMIT 10", array("search" => $_GET["s"] . "%")); $res = array(); foreach ($all as $row) { $res[] = $row["tag"]; } $page->set_mode("data"); $page->set_type("text/plain"); $page->set_data(implode("\n", $res)); } if ($event instanceof PostListBuildingEvent) { if ($config->get_int('tag_list_length') > 0) { if (!empty($event->search_terms)) { $this->add_refine_block($page, $event->search_terms); } else { $this->add_popular_block($page); } } } if ($event instanceof DisplayingImageEvent) { if ($config->get_int('tag_list_length') > 0) { if ($config->get_string('tag_list_image_type') == 'related') { $this->add_related_block($page, $event->image); } else { $this->add_tags_block($page, $event->image); } } } if ($event instanceof SetupBuildingEvent) { $sb = new SetupBlock("Tag Map Options"); $sb->add_int_option("tags_min", "Only show tags used at least "); $sb->add_label(" times"); $sb->add_bool_option("tag_list_pages", "<br>Paged tag lists: "); $event->panel->add_block($sb); $sb = new SetupBlock("Popular / Related Tag List"); $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", "Show related" => "related"), "<br>Image tag list: "); $sb->add_bool_option("tag_list_numbers", "<br>Show tag counts: "); $event->panel->add_block($sb); } }
public function receive_event(Event $event) { global $config, $database, $page, $user; if (is_null($this->theme)) { $this->theme = get_theme_object($this); } $is_full = disk_free_space(realpath("./images/")) < 100 * 1024 * 1024; if ($event instanceof InitExtEvent) { global $config; $config->set_default_int('upload_count', 3); $config->set_default_int('upload_size', '1MB'); $config->set_default_bool('upload_anon', false); } if ($event instanceof PostListBuildingEvent) { global $user; if ($this->can_upload($user)) { if ($is_full) { $this->theme->display_full($page); } else { $this->theme->display_block($page); } } } if ($event instanceof PageRequestEvent && $event->page_matches("upload")) { if (count($_FILES) + count($_POST) > 0) { $tags = Tag::explode($_POST['tags']); $source = isset($_POST['source']) ? $_POST['source'] : null; if ($this->can_upload($user)) { $ok = true; foreach ($_FILES as $file) { $ok = $ok & $this->try_upload($file, $tags, $source); } foreach ($_POST as $name => $value) { if (substr($name, 0, 3) == "url" && strlen($value) > 0) { $ok = $ok & $this->try_transload($value, $tags, $source); } } $this->theme->display_upload_status($page, $ok); } else { $this->theme->display_permission_denied($page); } } else { if (!empty($_GET['url'])) { global $user; if ($this->can_upload($user)) { $url = $_GET['url']; $tags = array('tagme'); if (!empty($_GET['tags']) && $_GET['tags'] != "null") { $tags = Tag::explode($_GET['tags']); } $ok = $this->try_transload($url, $tags, $url); $this->theme->display_upload_status($page, $ok); } else { $this->theme->display_permission_denied($page); } } else { if (!$is_full) { $this->theme->display_page($page); } } } } if ($event instanceof SetupBuildingEvent) { $sb = new SetupBlock("Upload"); $sb->position = 10; $sb->add_int_option("upload_count", "Max uploads: "); $sb->add_shorthand_int_option("upload_size", "<br>Max size per file: "); $sb->add_bool_option("upload_anon", "<br>Allow anonymous uploads: "); $sb->add_choice_option("transload_engine", array("Disabled" => "none", "cURL" => "curl", "fopen" => "fopen", "WGet" => "wget"), "<br>Transload: "); $event->panel->add_block($sb); } if ($event instanceof DataUploadEvent) { global $config; if ($is_full) { throw new UploadException("Upload failed; disk nearly full"); } if (filesize($event->tmpname) > $config->get_int('upload_size')) { $size = to_shorthand_int(filesize($event->tmpname)); $limit = to_shorthand_int($config->get_int('upload_size')); throw new UploadException("File too large ({$size} > {$limit})"); } } }
public function receive_event(Event $event) { global $config, $database, $page, $user; if (is_null($this->theme)) { $this->theme = get_theme_object($this); } // f*****g PHP "security" measures -_-;;; $free_num = @disk_free_space(realpath("./images/")); if ($free_num === FALSE) { $is_full = false; } else { $is_full = $free_num < 100 * 1024 * 1024; } if ($event instanceof InitExtEvent) { $config->set_default_int('upload_count', 3); $config->set_default_int('upload_size', '1MB'); $config->set_default_bool('upload_anon', false); $config->set_default_bool('upload_replace', true); } if ($event instanceof PostListBuildingEvent) { if ($this->can_upload($user)) { if ($is_full) { $this->theme->display_full($page); } else { $this->theme->display_block($page); } } } if ($event instanceof PageRequestEvent) { if ($event->page_matches("upload/replace")) { /* Upload & Replace Image Request */ if (!$config->get_bool("upload_replace")) { throw new UploadException("Upload Replacing Images is not enabled."); } // check if the user is an administrator and can upload files. if (!$user->is_admin()) { $this->theme->display_permission_denied($page); } else { if ($is_full) { throw new UploadException("Can not replace Image: disk nearly full"); } // Try to get the image ID $image_id = int_escape($event->get_arg(0)); if (empty($image_id)) { $image_id = isset($_POST['image_id']) ? $_POST['image_id'] : null; } if (empty($image_id)) { throw new UploadException("Can not replace Image: No valid Image ID given."); } $image_old = Image::by_id($image_id); if (is_null($image_old)) { $this->theme->display_error($page, "Image not found", "No image in the database has the ID #{$image_id}"); } if (count($_FILES) + count($_POST) > 0) { if (count($_FILES) > 1) { throw new UploadException("Can not upload more than one image for replacing."); } $source = isset($_POST['source']) ? $_POST['source'] : null; $tags = ''; // Tags aren't changed when uploading. Set to null to stop PHP warnings. if (count($_FILES)) { foreach ($_FILES as $file) { $ok = $this->try_upload($file, $tags, $source, $image_id); break; // leave the foreach loop. } } else { foreach ($_POST as $name => $value) { if (substr($name, 0, 3) == "url" && strlen($value) > 0) { $ok = $this->try_transload($value, $tags, $source, $image_id); break; // leave the foreach loop. } } } $this->theme->display_upload_status($page, $ok); } else { if (!empty($_GET['url'])) { $url = $_GET['url']; $ok = $this->try_transload($url, $tags, $url, $image_id); $this->theme->display_upload_status($page, $ok); } else { $this->theme->display_replace_page($page, $image_id); } } } // END of if admin / can_upload } else { if ($event->page_matches("upload")) { if (!$this->can_upload($user)) { $this->theme->display_permission_denied($page); } else { /* Regular Upload Image */ if (count($_FILES) + count($_POST) > 0) { $tags = Tag::explode($_POST['tags']); $source = isset($_POST['source']) ? $_POST['source'] : null; $ok = true; foreach ($_FILES as $file) { $ok = $ok & $this->try_upload($file, $tags, $source); } foreach ($_POST as $name => $value) { if (substr($name, 0, 3) == "url" && strlen($value) > 0) { $ok = $ok & $this->try_transload($value, $tags, $source); } } $this->theme->display_upload_status($page, $ok); } else { if (!empty($_GET['url'])) { $url = $_GET['url']; $tags = array('tagme'); if (!empty($_GET['tags']) && $_GET['tags'] != "null") { $tags = Tag::explode($_GET['tags']); } $ok = $this->try_transload($url, $tags, $url); $this->theme->display_upload_status($page, $ok); } else { if (!$is_full) { $this->theme->display_page($page); } } } } // END of if can_upload } } } // END of if PageRequestEvent if ($event instanceof SetupBuildingEvent) { $tes = array(); $tes["Disabled"] = "none"; if (function_exists("curl_init")) { $tes["cURL"] = "curl"; } $tes["fopen"] = "fopen"; $tes["WGet"] = "wget"; $sb = new SetupBlock("Upload"); $sb->position = 10; // Output the limits from PHP so the user has an idea of what they can set. $sb->add_label("<i>PHP's Upload Limit = " . ini_get('max_file_uploads') . "</i><br/>"); $sb->add_int_option("upload_count", "Max uploads: "); $sb->add_label("<br/><i>PHP's Max Size Upload = " . ini_get('upload_max_filesize') . "</i><br/>"); $sb->add_shorthand_int_option("upload_size", "<br/>Max size per file: "); $sb->add_bool_option("upload_anon", "<br/>Allow anonymous uploads: "); $sb->add_bool_option("upload_replace", "<br/>Allow replacing images: "); $sb->add_choice_option("transload_engine", $tes, "<br/>Transload: "); $event->panel->add_block($sb); } if ($event instanceof DataUploadEvent) { if ($is_full) { throw new UploadException("Upload failed; disk nearly full"); } if (filesize($event->tmpname) > $config->get_int('upload_size')) { $size = to_shorthand_int(filesize($event->tmpname)); $limit = to_shorthand_int($config->get_int('upload_size')); throw new UploadException("File too large ({$size} > {$limit})"); } } }
public function onSetupBuilding($event) { $sb = new SetupBlock("Index Options"); $sb->position = 20; $sb->add_label("Index table size "); $sb->add_int_option("index_width"); $sb->add_label(" x "); $sb->add_int_option("index_height"); $sb->add_label(" images"); $event->panel->add_block($sb); }
public function onSetupBuilding($event) { $sb = new SetupBlock("Comment Options"); $sb->add_bool_option("comment_anon", "Allow anonymous comments: "); $sb->add_bool_option("comment_captcha", "<br>Require CAPTCHA for anonymous comments: "); $sb->add_label("<br>Limit to "); $sb->add_int_option("comment_limit"); $sb->add_label(" comments per "); $sb->add_int_option("comment_window"); $sb->add_label(" minutes"); $sb->add_label("<br>Show "); $sb->add_int_option("comment_count"); $sb->add_label(" recent comments on the index"); $sb->add_label("<br>Show "); $sb->add_int_option("comment_list_count"); $sb->add_label(" comments per image on the list"); $event->panel->add_block($sb); }
public function onSetupBuilding($event) { $sb = new SetupBlock("Image Options"); $sb->position = 30; // advanced only //$sb->add_text_option("image_ilink", "Image link: "); //$sb->add_text_option("image_tlink", "<br>Thumbnail link: "); $sb->add_text_option("image_tip", "Image tooltip: "); $sb->add_choice_option("upload_collision_handler", array('Error' => 'error', 'Merge' => 'merge'), "<br>Upload collision handler: "); if (!in_array("OS", $_SERVER) || $_SERVER["OS"] != 'Windows_NT') { $sb->add_bool_option("image_show_meta", "<br>Show metadata: "); } $sb->add_bool_option("image_jquery_confirm", "<br>Confirm Delete with jQuery: "); $expires = array(); $expires['1 Minute'] = 60; $expires['1 Hour'] = 3600; $expires['1 Day'] = 86400; $expires['1 Month (31 days)'] = 2678400; //(60*60*24*31) $expires['1 Year'] = 31536000; // 365 days (60*60*24*365) $expires['Never'] = 3153600000.0; // 100 years.. $sb->add_choice_option("image_expires", $expires, "<br>Image Expiration: "); $event->panel->add_block($sb); $thumbers = array(); $thumbers['Built-in GD'] = "gd"; $thumbers['ImageMagick'] = "convert"; $sb = new SetupBlock("Thumbnailing"); $sb->add_choice_option("thumb_engine", $thumbers, "Engine: "); $sb->add_label("<br>Size "); $sb->add_int_option("thumb_width"); $sb->add_label(" x "); $sb->add_int_option("thumb_height"); $sb->add_label(" px at "); $sb->add_int_option("thumb_quality"); $sb->add_label(" % quality "); $sb->add_shorthand_int_option("thumb_mem_limit", "<br>Max memory use: "); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Tag Map Options"); $sb->add_int_option("tags_min", "Only show tags used at least "); $sb->add_label(" times"); $sb->add_bool_option("tag_list_pages", "<br>Paged tag lists: "); $event->panel->add_block($sb); $sb = new SetupBlock("Popular / Related Tag List"); $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", "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); }
public function onSetupBuilding(SetupBuildingEvent $event) { global $config; $sb = new SetupBlock("Image Options"); $sb->position = 30; // advanced only //$sb->add_text_option("image_ilink", "Image link: "); //$sb->add_text_option("image_tlink", "<br>Thumbnail link: "); $sb->add_text_option("image_tip", "Image tooltip: "); $sb->add_choice_option("upload_collision_handler", array('Error' => 'error', 'Merge' => 'merge'), "<br>Upload collision handler: "); if (function_exists("exif_read_data")) { $sb->add_bool_option("image_show_meta", "<br>Show metadata: "); } $event->panel->add_block($sb); $thumbers = array(); $thumbers['Built-in GD'] = "gd"; $thumbers['ImageMagick'] = "convert"; $sb = new SetupBlock("Thumbnailing"); $sb->add_choice_option("thumb_engine", $thumbers, "Engine: "); $sb->add_label("<br>Size "); $sb->add_int_option("thumb_width"); $sb->add_label(" x "); $sb->add_int_option("thumb_height"); $sb->add_label(" px at "); $sb->add_int_option("thumb_quality"); $sb->add_label(" % quality "); if ($config->get_string("thumb_engine") == "convert") { $sb->add_label("<br>ImageMagick Binary: "); $sb->add_text_option("thumb_convert_path"); } if ($config->get_string("thumb_engine") == "gd") { $sb->add_shorthand_int_option("thumb_mem_limit", "<br>Max memory use: "); } $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Index Options"); $sb->position = 20; $sb->add_label("Show "); $sb->add_int_option("index_images"); $sb->add_label(" images on the post list"); $event->panel->add_block($sb); }
public function onSetupBuilding(SetupBuildingEvent $event) { $tes = array(); $tes["Disabled"] = "none"; if (function_exists("curl_init")) { $tes["cURL"] = "curl"; } $tes["fopen"] = "fopen"; $tes["WGet"] = "wget"; $sb = new SetupBlock("Upload"); $sb->position = 10; // Output the limits from PHP so the user has an idea of what they can set. $sb->add_int_option("upload_count", "Max uploads: "); $sb->add_label("<i>PHP Limit = " . ini_get('max_file_uploads') . "</i>"); $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_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); }
public function onSetupBuilding(SetupBuildingEvent $event) { $this->set_dir(); $cron_url = make_http(make_link("/cron_upload/" . $this->upload_key)); $cron_cmd = "curl --silent {$cron_url}"; $documentation_link = make_http(make_link("cron_upload")); $sb = new SetupBlock("Cron Uploader"); $sb->add_label("<b>Settings</b><br>"); $sb->add_int_option("cron_uploader_count", "How many to upload each time"); $sb->add_text_option("cron_uploader_dir", "<br>Set Cron Uploader root directory<br>"); $sb->add_label("<br>Cron Command: <input type='text' size='60' value='{$cron_cmd}'><br>\n\t\tCreate a cron job with the command above.<br/>\n\t\t<a href='{$documentation_link}'>Read the documentation</a> if you're not sure what to do."); $event->panel->add_block($sb); }