Example #1
0
 /**
  * Display the error.
  *
  * @param Page $page
  * @param string $title
  * @param string $message
  */
 public function display_rotate_error(Page $page, $title, $message)
 {
     $page->set_title("Rotate Image");
     $page->set_heading("Rotate Image");
     $page->add_block(new NavBlock());
     $page->add_block(new Block($title, $message));
 }
Example #2
0
 public function display_image(Page $page, Image $image)
 {
     global $config;
     $ilink = $image->get_image_link();
     $html = "<img id='main_image' src='{$ilink}'>";
     if ($config->get_bool("image_show_meta")) {
         # FIXME: only read from jpegs?
         $exif = @exif_read_data($image->get_image_filename(), 0, true);
         if ($exif) {
             $head = "";
             foreach ($exif as $key => $section) {
                 foreach ($section as $name => $val) {
                     if ($key == "IFD0") {
                         $head .= html_escape("{$name}: {$val}") . "<br>\n";
                     }
                 }
             }
             if ($head) {
                 $page->add_block(new Block("EXIF Info", $head, "left"));
             }
         }
     }
     $zoom_default = $config->get_bool("image_zoom", false) ? "scale(img);" : "";
     $zoom = "<script type=\"text/javascript\">\n\t\t\t\t\timg = document.getElementById(\"main_image\");\n\t\t\t\t\t\n\t\t\t\t\tif(img) {\n\t\t\t\t\t\timg.onclick = function() {scale(img);};\n\t\t\t\t\t\n\t\t\t\t\t\tmsg_div = document.createElement(\"div\");\n\t\t\t\t\t\tmsg_div.id = \"msg_div\";\n\t\t\t\t\t\tmsg_div.appendChild(document.createTextNode(\"Note: Image has been scaled to fit the screen; click to enlarge\"));\n\t\t\t\t\t\tmsg_div.style.display=\"none\";\n\t\t\t\t\t\timg.parentNode.insertBefore(msg_div, img);\n\t\t\t\t\t\n\t\t\t\t\t\torig_width = {$image->width};\n\t\t\t\t\t\n\t\t\t\t\t\t{$zoom_default}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfunction scale(img) {\n\t\t\t\t\t\tif(orig_width >= img.parentNode.clientWidth * 0.9) {\n\t\t\t\t\t\t\tif(img.style.width != \"90%\") {\n\t\t\t\t\t\t\t\timg.style.width = \"90%\";\n\t\t\t\t\t\t\t\tmsg_div.style.display = \"block\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\timg.style.width = orig_width + 'px';\n\t\t\t\t\t\t\t\tmsg_div.style.display = \"none\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t</script>";
     $page->add_block(new Block("Image", $html . $zoom, "main", 0));
 }
Example #3
0
 public function display_page(Page $page, $images)
 {
     global $config;
     if (count($this->search_terms) == 0) {
         $query = null;
         $page_title = $config->get_string('title');
     } else {
         $search_string = implode(' ', $this->search_terms);
         $query = url_escape($search_string);
         $page_title = html_escape($search_string);
         if (count($images) > 0) {
             $page->set_subheading("Page {$this->page_number} / {$this->total_pages}");
         }
     }
     if ($this->page_number > 1 || count($this->search_terms) > 0) {
         // $page_title .= " / $page_number";
     }
     $nav = $this->build_navigation($this->page_number, $this->total_pages, $this->search_terms);
     $page->set_title($page_title);
     $page->set_heading($page_title);
     $page->add_block(new Block("Navigation", $nav, "left", 0));
     if (count($images) > 0) {
         if ($query) {
             $page->add_block(new Block("Images", $this->build_table($images, "search={$query}"), "main", 10));
             $this->display_paginator($page, "post/list/{$query}", null, $this->page_number, $this->total_pages);
         } else {
             $page->add_block(new Block("Images", $this->build_table($images, null), "main", 10));
             $this->display_paginator($page, "post/list", null, $this->page_number, $this->total_pages);
         }
     } else {
         $page->add_block(new Block("No Images Found", "No images were found to match the search criteria"));
     }
 }
Example #4
0
 public function display_page_editor(Page $page, WikiPage $wiki_page)
 {
     $page->set_title(html_escape($wiki_page->title));
     $page->set_heading(html_escape($wiki_page->title));
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Editor", $this->create_edit_html($wiki_page)));
 }
Example #5
0
    /**
     * @param Page $page
     * @param array $history
     * @param int $page_number
     */
    public function display_global_page(Page $page, $history, $page_number)
    {
        $start_string = "\n\t\t\t<div style='text-align: left'>\n\t\t\t\t" . make_form(make_link("tag_history/revert")) . "\n\t\t\t\t\t<ul style='list-style-type:none;'>\n\t\t";
        $end_string = "\n\t\t\t\t\t</ul>\n\t\t\t\t\t<input type='submit' value='Revert To'>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t";
        global $user;
        $history_list = "";
        foreach ($history as $fields) {
            $current_id = $fields['id'];
            $image_id = $fields['image_id'];
            $current_tags = html_escape($fields['tags']);
            $name = $fields['name'];
            $h_ip = $user->can("view_ip") ? " " . show_ip($fields['user_ip'], "Tagging Image #{$image_id} as '{$current_tags}'") : "";
            $setter = "<a href='" . make_link("user/" . url_escape($name)) . "'>" . html_escape($name) . "</a>{$h_ip}";
            $history_list .= '
				<li>
					<input type="radio" name="revert" value="' . $current_id . '">
					<a href="' . make_link('post/view/' . $image_id) . '">' . $image_id . '</a>:
					' . $current_tags . ' (Set by ' . $setter . ')
				</li>
			';
        }
        $history_html = $start_string . $history_list . $end_string;
        $page->set_title("Global Tag History");
        $page->set_heading("Global Tag History");
        $page->add_block(new Block("Tag History", $history_html, "main", 10));
        $h_prev = $page_number <= 1 ? "Prev" : '<a href="' . make_link('tag_history/all/' . ($page_number - 1)) . '">Prev</a>';
        $h_index = "<a href='" . make_link() . "'>Index</a>";
        $h_next = '<a href="' . make_link('tag_history/all/' . ($page_number + 1)) . '">Next</a>';
        $nav = $h_prev . ' | ' . $h_index . ' | ' . $h_next;
        $page->add_block(new Block("Navigation", $nav, "left"));
    }
Example #6
0
 public function display_image(Page $page, Image $image)
 {
     global $config;
     $u_ilink = $image->get_image_link();
     if ($config->get_bool("image_show_meta") && function_exists("exif_read_data")) {
         # FIXME: only read from jpegs?
         $exif = @exif_read_data($image->get_image_filename(), 0, true);
         if ($exif) {
             $head = "";
             foreach ($exif as $key => $section) {
                 foreach ($section as $name => $val) {
                     if ($key == "IFD0") {
                         // Cheap fix for array'd values in EXIF-data
                         if (is_array($val)) {
                             $val = implode(',', $val);
                         }
                         $head .= html_escape("{$name}: {$val}") . "<br>\n";
                     }
                 }
             }
             if ($head) {
                 $page->add_block(new Block("EXIF Info", $head, "left"));
             }
         }
     }
     $html = "<img alt='main image' class='shm-main-image' id='main_image' src='{$u_ilink}' " . "data-width='{$image->width}' data-height='{$image->height}'>";
     $page->add_block(new Block("Image", $html, "main", 10));
 }
Example #7
0
 public function display_info_page(Page $page, $info)
 {
     $page->set_title("System Info");
     $page->set_heading("System Info");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Information:", $this->build_data_form($info)));
 }
Example #8
0
 public function display_aliases(Page $page, $aliases, $is_admin, $pageNumber, $totalPages)
 {
     if ($is_admin) {
         $action = "<th width='10%'>Action</th>";
         $add = "\n\t\t\t\t<tr>\n\t\t\t\t\t<form action='" . make_link("alias/add") . "' method='POST'>\n\t\t\t\t\t\t<td><input type='text' name='oldtag'></td>\n\t\t\t\t\t\t<td><input type='text' name='newtag'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Add'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     } else {
         $action = "";
         $add = "";
     }
     $h_aliases = "";
     $n = 0;
     foreach ($aliases as $old => $new) {
         $h_old = html_escape($old);
         $h_new = "<a href='" . make_link("post/list/" . url_escape($new) . "/1") . "'>" . html_escape($new) . "</a>";
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $h_aliases .= "<tr class='{$oe}'><td>{$h_old}</td><td>{$h_new}</td>";
         if ($is_admin) {
             $h_aliases .= "\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<form action='" . make_link("alias/remove") . "' method='POST'>\n\t\t\t\t\t\t\t<input type='hidden' name='oldtag' value='{$h_old}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t";
         }
         $h_aliases .= "</tr>";
     }
     $html = "\n\t\t\t<script>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#aliases\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t<table id='aliases' class='zebra'>\n\t\t\t\t<thead><tr><th>From</th><th>To</th>{$action}</tr></thead>\n\t\t\t\t<tbody>{$h_aliases}</tbody>\n\t\t\t\t<tfoot>{$add}</tfoot>\n\t\t\t</table>\n\t\t\t<p><a href='" . make_link("alias/export/aliases.csv") . "'>Download as CSV</a></p>\n\t\t";
     $bulk_html = "\n\t\t\t<form enctype='multipart/form-data' action='" . make_link("alias/import") . "' method='POST'>\n\t\t\t\t<input type='file' name='alias_file'>\n\t\t\t\t<input type='submit' value='Upload List'>\n\t\t\t</form>\n\t\t";
     $page->set_title("Alias List");
     $page->set_heading("Alias List");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Aliases", $html));
     if ($is_admin) {
         $page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
     }
     $this->display_paginator($page, "alias/list", null, $pageNumber, $totalPages);
 }
Example #9
0
 public function display_advanced(Page $page, $options)
 {
     global $user;
     $rows = "";
     $n = 0;
     ksort($options);
     foreach ($options as $name => $value) {
         $h_value = html_escape($value);
         $len = strlen($h_value);
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $box = "";
         if (strpos($value, "\n") > 0) {
             $box .= "<textarea cols='50' rows='4' name='_config_{$name}'>{$h_value}</textarea>";
         } else {
             $box .= "<input type='text' name='_config_{$name}' value='{$h_value}'>";
         }
         $box .= "<input type='hidden' name='_type_{$name}' value='string'>";
         $rows .= "<tr class='{$oe}'><td>{$name}</td><td>{$box}</td></tr>";
     }
     $table = "\n\t\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#settings\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t" . make_form(make_link("setup/save")) . "\n\t\t\t\t<table id='settings' class='zebra'>\n\t\t\t\t\t<thead><tr><th width='25%'>Name</th><th>Value</th></tr></thead>\n\t\t\t\t\t<tbody>{$rows}</tbody>\n\t\t\t\t\t<tfoot><tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr></tfoot>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\t";
     $page->set_title("Shimmie Setup");
     $page->set_heading("Shimmie Setup");
     $page->add_block(new Block("Navigation", $this->build_navigation(), "left", 0));
     $page->add_block(new Block("Setup", $table));
 }
Example #10
0
 public function display_results(Page $page, Image $image)
 {
     $page->set_title("Thumbnail Regenerated");
     $page->set_heading("Thumbnail Regenerated");
     $page->add_header("<meta http-equiv=\"cache-control\" content=\"no-cache\">");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Thumbnail", $this->build_thumb_html($image)));
 }
Example #11
0
 public function display_upload_results(Page $page)
 {
     $page->set_title("Adding folder");
     $page->set_heading("Adding folder");
     $page->add_block(new NavBlock());
     foreach ($this->messages as $block) {
         $page->add_block($block);
     }
 }
Example #12
0
 public function build_tagger(Page $page, $event)
 {
     // Initialization code
     $base_href = get_base_href();
     // TODO: AJAX test and fallback.
     $page->add_html_header("<script src='{$base_href}/ext/tagger/webtoolkit.drag.js' type='text/javascript'></script>");
     $page->add_block(new Block(null, "<script type='text/javascript'>\n\t\t\t\t\$( document ).ready(function() {\n\t\t\t\t\tTagger.initialize(" . $event->get_image()->id . ");\n\t\t\t\t});\n\t\t\t</script>", "main", 1000));
     // Tagger block
     $page->add_block(new Block(null, $this->html($event->get_image()), "main"));
 }
Example #13
0
 public function build_tagger(Page $page, $event)
 {
     global $config;
     // Initialization code
     $base_href = $config->get_string('base_href');
     // TODO: AJAX test and fallback.
     $page->add_header("<script src='{$base_href}/ext/tagger/webtoolkit.drag.js' type='text/javascript'></script>");
     $page->add_block(new Block(null, "<script type='text/javascript'>Tagger.initialize(" . $event->get_image()->id . ");</script>", "main", 1000));
     // Tagger block
     $page->add_block(new Block(null, $this->html($event->get_image()), "main"));
 }
Example #14
0
 public function display_upload_results(Page $page)
 {
     $page->set_title("Adding folder");
     $page->set_heading("Adding folder");
     $page->add_block(new NavBlock());
     $html = "";
     foreach ($this->messages as $block) {
         $html .= "<br/>" . html_escape($html);
     }
     $page->add_block(new Block("Results", $block));
 }
Example #15
0
 public function display_resize_page(Page $page, $image_id)
 {
     global $config;
     $default_width = $config->get_int('resize_default_width');
     $default_height = $config->get_int('resize_default_height');
     $image = Image::by_id($image_id);
     $thumbnail = $this->build_thumb_html($image, null);
     $html = "<div style='clear:both;'></div>\n\t\t\t\t<p>Resize Image ID " . $image_id . "<br>" . $thumbnail . "</p>\n\t\t\t\t<p>Please note: You will have to refresh the image page, or empty your browser cache.</p>\n\t\t\t\t<p>Enter the new size for the image, or leave blank to scale the image automatically.</p><br>" . make_form(make_link('resize/' . $image_id), 'POST', $multipart = True, 'form_resize') . "\n\t\t\t\t<input type='hidden' name='image_id' value='{$image_id}'>\n\t\t\t\t<table id='large_upload_form'>\n\t\t\t\t\t<tr><td>New Width</td><td colspan='3'><input id='resize_width' name='resize_width' type='text' value='" . $default_width . "'></td></tr>\n\t\t\t\t\t<tr><td>New Height</td><td colspan='3'><input id='resize_height' name='resize_height' type='text' value='" . $default_height . "'></td></tr>\n\t\t\t\t\t<tr><td colspan='4'><input id='resizebutton' type='submit' value='Resize'></td></tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t";
     $page->set_title("Resize Image");
     $page->set_heading("Resize Image");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Resize Image", $html, "main", 20));
 }
Example #16
0
 public function display_form(Page $page)
 {
     global $user;
     $html = "\n\t\t\t" . make_form(make_link("admin_utils")) . "\n\t\t\t\t<select name='action'>\n\t\t\t\t\t<option value='lowercase all tags'>All tags to lowercase</option>\n\t\t\t\t\t<option value='recount tag use'>Recount tag use</option>\n\t\t\t\t\t<option value='purge unused tags'>Purge unused tags</option>\n\t\t\t\t\t<option value='database dump'>Download database contents</option>\n\t\t\t\t\t<!--<option value='convert to innodb'>Convert database to InnoDB (MySQL only)</option>-->\n\t\t\t\t</select>\n\t\t\t\t<input type='submit' value='Go'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Misc Admin Tools", $html));
     /* First check
     		Requires you to click the checkbox to enable the delete by query form */
     $dbqcheck = "\n\t\t\tif(document.getElementById(&quot;dbqcheck&quot;).checked == false){\n\t\t\t\tdocument.getElementById(&quot;dbqtags&quot;).disabled = true;\n\t\t\t\tdocument.getElementById(&quot;dbqsubmit&quot;).disabled = true;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(&quot;dbqtags&quot;).disabled = false;\n\t\t\t\tdocument.getElementById(&quot;dbqsubmit&quot;).disabled = false;\n\t\t\t}";
     /* Second check
     		Requires you to confirm the deletion by clicking ok. */
     $html = "\n\t\t\t<script type='text/javascript'>\n\t\t\tfunction checkform(){\n\t\t\t\tif(confirm('Are you sure you wish to delete all images using these tags?')){\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t</script>" . make_form(make_link("admin_utils"), "post", false, false, "return checkform()") . "\n\t\t\t\t<input type='checkbox' id='dbqcheck' name='action' onclick='{$dbqcheck}'>\n\t\t\t\t<input type='hidden' name='action' value='delete by query'>\n\t\t\t\t<input type='text' id='dbqtags' disabled='true' name='query'>\n\t\t\t\t<input type='submit' id='dbqsubmit' disabled='true' value='Go'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Delete by Query", $html));
 }
Example #17
0
 public function display_bans(Page $page, $bans)
 {
     global $database, $user;
     $h_bans = "";
     $prefix = $database->get_driver_name() == "sqlite" ? "bans." : "";
     foreach ($bans as $ban) {
         $end_human = date('Y-m-d', $ban[$prefix . 'end_timestamp']);
         $h_bans .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td width='12%'>{$ban[$prefix . 'ip']}</td>\n\t\t\t\t\t<td>{$ban[$prefix . 'reason']}</td>\n\t\t\t\t\t<td width='10%'>{$ban['banner_name']}</td>\n\t\t\t\t\t<td width='10%'>" . substr($ban[$prefix . 'added'], 0, 10) . "</td>\n\t\t\t\t\t<td width='15%'>{$end_human}</td>\n\t\t\t\t\t" . make_form(make_link("ip_ban/remove")) . "\n\t\t\t\t\t<td width='8%'>\n\t\t\t\t\t\t\t<input type='hidden' name='id' value='{$ban[$prefix . 'id']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $html = "\n\t\t\t<a href='" . make_link("ip_ban/list", "all=on") . "'>Show All</a>\n\t\t\t<p><table id='bans' class='sortable zebra'>\n\t\t\t\t<thead><tr><th>IP</th><th>Reason</th><th>By</th><th>From</th><th>Until</th><th>Action</th></tr></thead>\n\t\t\t\t{$h_bans}\n\t\t\t\t<tfoot><tr id='add'>\n\t\t\t\t\t" . make_form(make_link("ip_ban/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='ip' value='" . html_escape(@$_GET['ip']) . "'></td>\n\t\t\t\t\t\t<td><input type='text' name='reason' value='" . html_escape(@$_GET['reason']) . "'></td>\n\t\t\t\t\t\t<td>{$user->name}</td>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td><input type='text' name='end' value='" . html_escape(@$_GET['end']) . "'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Ban'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t";
     $page->set_title("IP Bans");
     $page->set_heading("IP Bans");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Edit IP Bans", $html));
 }
Example #18
0
 public function display_image(Page $page, Image $image)
 {
     $ilink = $image->get_image_link();
     // FIXME: object and embed have "height" and "width"
     $html = "\n\t\t\t<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'\n\t\t\t        codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'\n\t\t\t\t\theight='{$image->height}'\n\t\t\t\t\twidth='{$image->width}'\n\t\t\t\t\twmode='opaque'\n\t\t\t\t\t>\n\t\t\t\t<param name='movie' value='{$ilink}'/>\n\t\t\t\t<param name='quality' value='high' />\n\t\t\t\t<embed src='{$ilink}' quality='high'\n\t\t\t\t\tpluginspage='http://www.macromedia.com/go/getflashplayer'\n\t\t\t\t\theight='{$image->height}'\n\t\t\t\t\twidth='{$image->width}'\n\t\t\t\t\twmode='opaque'\n\t\t\t\t\ttype='application/x-shockwave-flash'></embed>\n\t\t\t</object>";
     $page->add_block(new Block("Flash Animation", $html, "main", 10));
 }
Example #19
0
 public function display_mass_tagger(Page $page, Event $event, $config)
 {
     $data_href = get_base_href();
     $body = "\n\t\t\t<form action='" . make_link("mass_tagger/tag") . "' method='POST'>\n\t\t\t\t<input id='mass_tagger_activate' type='button' onclick='activate_mass_tagger(\"{$data_href}\");' value='Activate'/>\n\t\t\t\t<div id='mass_tagger_controls' style='display: none;'>\n\t\t\t\t\tClick on images to mark them. Use the 'Index Options' in the Board Config to increase the amount of shown images.\n\t\t\t\t\t<br />\n\t\t\t\t\t<input type='hidden' name='ids' id='mass_tagger_ids' />\n\t\t\t\t\tSet instead of add? <input type='checkbox' name='setadd' value='set' />\n\t\t\t\t\t<label>Tags: <input type='text' name='tag' /></label>\n\n\t\t\t\t\t<input type='submit' value='Tag Marked Images' />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t";
     $block = new Block("Mass Tagger", $body, "left", 50);
     $page->add_block($block);
 }
Example #20
0
 public function display_image(Page $page, Image $image)
 {
     $ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
     //		$ilink = $image->get_image_link();
     $html = "\n\t\t\t<object data='{$ilink}' type='image/svg+xml' width='{$image->width}' height='{$image->height}'>\n\t\t\t    <embed src='{$ilink}' type='image/svg+xml' width='{$image->width}' height='{$image->height}' />\n\t\t\t</object>\n\t\t";
     $page->add_block(new Block("Image", $html, "main", 0));
 }
Example #21
0
 public function display_image_banner(Page $page, Image $image)
 {
     global $config;
     $i_image = int_escape($image->id);
     $html = "\n\t\t\t<form action='" . make_link("image_report/add") . "' method='POST'>\n\t\t\t\t<input type='hidden' name='image_id' value='{$i_image}'>\n\t\t\t\t<input type='text' name='reason' value='Please enter a reason' onclick='this.value=\"\";'>\n\t\t\t\t<input type='submit' value='Report'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Report Image", $html, "left"));
 }
Example #22
0
 public function display_image(Page $page, Image $image)
 {
     $data_href = get_base_href();
     $ilink = $image->get_image_link();
     $html = "\n\t\t\t<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'\n\t\t\t        codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'\n\t\t\t\t\twidth='400' height='15'>\n\t\t\t\t<param name='movie' value='{$data_href}/ext/handle_mp3/xspf_player_slim.swf?song_url={$ilink}'/>\n\t\t\t\t<param name='quality' value='high' />\n\t\t\t\t<embed src='{$data_href}/ext/handle_mp3/xspf_player_slim.swf?song_url={$ilink}' quality='high'\n\t\t\t\t\tpluginspage='http://www.macromedia.com/go/getflashplayer'\n\t\t\t\t\twidth='400' height='15'\n\t\t\t\t\ttype='application/x-shockwave-flash'></embed>\n\t\t\t</object>\n\t\t\t<p><a href='{$ilink}'>Download</a>";
     $page->add_block(new Block("Music", $html, "main", 0));
 }
Example #23
0
 /**
  * Add a generic paginator
  */
 public function display_paginator(Page $page, $base, $query, $page_number, $total_pages)
 {
     if ($total_pages == 0) {
         $total_pages = 1;
     }
     $body = $this->build_paginator($page_number, $total_pages, $base, $query);
     $page->add_block(new Block(null, $body, "main", 90));
 }
Example #24
0
 public function links_block(Page $page, $data)
 {
     $thumb_src = $data['thumb_src'];
     $image_src = $data['image_src'];
     $post_link = $data['post_link'];
     $text_link = $data['text_link'];
     $page->add_block(new Block("Link to Image", "\n\t\t\t<table><tr>\n\n\t\t\t<td><fieldset>\n\t\t\t\t<legend><a href='http://en.wikipedia.org/wiki/Bbcode' target='_blank'>BBCode</a></legend>\n\t\t\t\t<table>\n\t\t\t\t" . $this->link_code("Link", $this->url($post_link, $text_link, "ubb"), "ubb_text-link") . $this->link_code("Thumb", $this->url($post_link, $this->img($thumb_src, "ubb"), "ubb"), "ubb_thumb-link") . $this->link_code("Image", $this->img($image_src, "ubb"), "ubb_full-img") . "\n\t\t\t\t</table>\n\t\t\t</fieldset></td>\n\n\t\t\t<td><fieldset>\n\t\t\t\t<legend><a href='http://en.wikipedia.org/wiki/Html' target='_blank'>HTML</a></legend>\n\t\t\t\t<table>\n\t\t\t\t" . $this->link_code("Link", $this->url($post_link, $text_link, "html"), "html_text-link") . $this->link_code("Thumb", $this->url($post_link, $this->img($thumb_src, "html"), "html"), "html_thumb-link") . $this->link_code("Image", $this->img($image_src, "html"), "html_full-image") . "\n\t\t\t\t</table>\n\t\t\t</fieldset></td>\n\n\t\t\t<td><fieldset>\n\t\t\t\t<legend>Plain Text</legend>\n\t\t\t\t<table>\n\t\t\t\t" . $this->link_code("Link", $post_link, "text_post-link") . $this->link_code("Thumb", $thumb_src, "text_thumb-url") . $this->link_code("Image", $image_src, "text_image-src") . "\n\t\t\t\t</table>\n\t\t\t</fieldset></td>\n\n\t\t\t</tr></table>\n\t\t\t", "main", 50));
 }
 /**
  * Add a generic paginator.
  *
  * @param Page $page
  * @param string $base
  * @param string $query
  * @param int $page_number
  * @param int $total_pages
  * @param bool $show_random
  */
 public function display_paginator(Page $page, $base, $query, $page_number, $total_pages, $show_random = FALSE)
 {
     if ($total_pages == 0) {
         $total_pages = 1;
     }
     $body = $this->litetheme_build_paginator($page_number, $total_pages, $base, $query, $show_random);
     $page->add_block(new Block(null, $body, "main", 90));
 }
Example #26
0
 public function display_bans(Page $page, $bans)
 {
     global $database, $user;
     $h_bans = "";
     $n = 0;
     $prefix = $database->engine->name == "sqlite" ? "bans." : "";
     $prefix2 = $database->engine->name == "sqlite" ? "users." : "";
     foreach ($bans as $ban) {
         $end_human = date('Y-m-d', $ban[$prefix . 'end_timestamp']);
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $h_bans .= "\n\t\t\t\t<tr class='{$oe}'>\n\t\t\t\t\t<td width='10%'>{$ban[$prefix . 'ip']}</td>\n\t\t\t\t\t<td>{$ban[$prefix . 'reason']}</td>\n\t\t\t\t\t<td width='10%'>{$ban['banner_name']}</td>\n\t\t\t\t\t<td width='15%'>{$end_human}</td>\n\t\t\t\t\t<td width='10%'>\n\t\t\t\t\t\t<form action='" . make_link("ip_ban/remove") . "' method='POST'>\n\t\t\t\t\t\t\t<input type='hidden' name='id' value='{$ban[$prefix . 'id']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $html = "\n\t\t\t<script>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#bans\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t<a href='" . make_link("ip_ban/list", "all=on") . "'>Show All</a>\n\t\t\t<p><table id='bans' class='zebra'>\n\t\t\t\t<thead><tr><th>IP</th><th>Reason</th><th>By</th><th>Until</th><th>Action</th></tr></thead>\n\t\t\t\t{$h_bans}\n\t\t\t\t<tfoot><tr>\n\t\t\t\t\t<form action='" . make_link("ip_ban/add") . "' method='POST'>\n\t\t\t\t\t\t<td><input type='text' name='ip'></td>\n\t\t\t\t\t\t<td><input type='text' name='reason'></td>\n\t\t\t\t\t\t<td>{$user->name}</td>\n\t\t\t\t\t\t<td><input type='text' name='end'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Ban'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t";
     $page->set_title("IP Bans");
     $page->set_heading("IP Bans");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Edit IP Bans", $html));
 }
Example #27
0
 public function display_login_block(Page $page)
 {
     global $config;
     $html = "\n\t\t\t<form action='" . make_link("user_admin/login") . "' method='POST'>\n\t\t\t<table summary='Login Form' align='center'>\n\t\t\t<tr><td width='70'>Name</td><td width='70'><input type='text' name='user'></td></tr>\n\t\t\t<tr><td>Password</td><td><input type='password' name='pass'></td></tr>\n\t\t\t<tr><td colspan='2'><input type='submit' name='gobu' value='Log In'></td></tr>\n\t\t\t</table>\n\t\t\t</form>\n\t\t";
     if ($config->get_bool("login_signup_enabled")) {
         $html .= "<small><a href='" . make_link("user_admin/create") . "'>Create Account</a></small>";
     }
     $page->add_block(new Block("Login", $html, "head", 90));
 }
Example #28
0
 public function display_doc(Page $page, ExtensionInfo $info)
 {
     $author = "";
     if ($info->author) {
         if ($info->email) {
             $author = "<br><b>Author:</b> <a href=\"mailto:" . html_escape($info->email) . "\">" . html_escape($info->author) . "</a>";
         } else {
             $author = "<br><b>Author:</b> " . html_escape($info->author);
         }
     }
     $version = $info->version ? "<br><b>Version:</b> " . html_escape($info->version) : "";
     $link = $info->link ? "<br><b>Home Page:</b> <a href=\"" . html_escape($info->link) . "\">Link</a>" : "";
     $doc = $info->documentation;
     $html = "\n\t\t\t<div style='margin: auto; text-align: left; width: 512px;'>\n\t\t\t\t{$author}\n\t\t\t\t{$version}\n\t\t\t\t{$link}\n\t\t\t\t<p>{$doc}\n\t\t\t\t<hr>\n\t\t\t\t<p><a href='" . make_link("ext_manager") . "'>Back to the list</a>\n\t\t\t</div>";
     $page->set_title("Documentation for " . html_escape($info->name));
     $page->set_heading(html_escape($info->name));
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Documentation", $html));
 }
Example #29
0
 public function display_untags(Page $page, $page_number, $page_count, $bans)
 {
     $h_bans = "";
     foreach ($bans as $ban) {
         $h_bans .= "\n\t\t\t\t<tr>\n\t\t\t\t\t" . make_form(make_link("untag/remove")) . "\n\t\t\t\t\t\t<td width='30%'>{$ban['tag']}</td>\n\t\t\t\t\t\t<td>{$ban['redirect']}</td>\n\t\t\t\t\t\t<td width='10%'>\n\t\t\t\t\t\t\t<input type='hidden' name='tag' value='{$ban['tag']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $html = "\n\t\t\t<table id='image_bans' class='zebra sortable'>\n\t\t\t\t<thead>\n\t\t\t\t\t<th>Tag</th><th>Redirect</th><th>Action</th>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<form action='" . make_link("untag/list/1") . "' method='GET'>\n\t\t\t\t\t\t\t<td><input type='text' name='tag' class='autocomplete_tags' autocomplete='off'></td>\n\t\t\t\t\t\t\t<td><input type='text' name='redirect'></td>\n\t\t\t\t\t\t\t<td><input type='submit' value='Search'></td>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t{$h_bans}\n\t\t\t\t<tfoot><tr>\n\t\t\t\t\t" . make_form(make_link("untag/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='tag' class='autocomplete_tags' autocomplete='off'></td>\n\t\t\t\t\t\t<td><input type='text' name='redirect'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Ban'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t";
     $prev = $page_number - 1;
     $next = $page_number + 1;
     $h_prev = $page_number <= 1 ? "Prev" : "<a href='" . make_link("untag/list/{$prev}") . "'>Prev</a>";
     $h_index = "<a href='" . make_link() . "'>Index</a>";
     $h_next = $page_number >= $page_count ? "Next" : "<a href='" . make_link("untag/list/{$next}") . "'>Next</a>";
     $nav = "{$h_prev} | {$h_index} | {$h_next}";
     $page->set_title("UnTags");
     $page->set_heading("UnTags");
     $page->add_block(new Block("Edit UnTags", $html));
     $page->add_block(new Block("Navigation", $nav, "left", 0));
     $this->display_paginator($page, "untag/list", null, $page_number, $page_count);
 }
Example #30
0
 protected function display_page_images(Page $page, $images)
 {
     if (count($this->search_terms) > 0) {
         $query = url_escape(implode(' ', $this->search_terms));
         $page->add_block(new Block("Images", $this->build_table($images, "#search={$query}"), "main", 10, "image-list"));
         $this->display_paginator($page, "post/list/{$query}", null, $this->page_number, $this->total_pages);
     } else {
         $page->add_block(new Block("Images", $this->build_table($images, null), "main", 10, "image-list"));
         $this->display_paginator($page, "post/list", null, $this->page_number, $this->total_pages);
     }
 }