diff --git a/contrib/link_image/main.php b/contrib/link_image/main.php index 5e23027b..d738b18f 100644 --- a/contrib/link_image/main.php +++ b/contrib/link_image/main.php @@ -1,27 +1,12 @@ - * Link: http://artanis.00.googlepages.com/linktoimage - * License: ? - * Description: Creates a new block under comments in image view that contains - * insertion code for forums and websites. Similar to how other image hosts - * offer pre-formatted code for insertion on other websites. - * - * Base URL must be set and used ($base) in the Image Link, Short Link, and - * Thumb Link fields. for the generation to function properly. - * Data URL you might as well set while you're at it. - * - * v0.1.2 - textboxes now select all when they gain focus. - * v0.1.1 - fixed thumbnail link code (image tag was getting html escaped twice, - * resulting in '>' and '<' being replaced with '&lt;' and '&gt;') - * v0.1.0 - release - */ class LinkImage extends Extension { //event handler public function receive_event($event) { if(is_a($event, 'DisplayingImageEvent')) { global $page; + global $config; + $data_href = $config->get_string("data_href"); + $page->add_header("",0); $page->add_main_block(new Block("Link to Image", $this->get_html($event->image))); } if(is_a($event, 'SetupBuildingEvent')) { @@ -51,36 +36,18 @@ class LinkImage extends Extension { $text_link = $this->parse_link_template($config->get_string("ext_link-img_text-link_format"),$image); - $html = "
"; + $html = ""; @@ -89,6 +56,7 @@ class LinkImage extends Extension { } private function ubb_url($link,$content) { + if ($content == NULL) { $content=$link; } return "[url=".$link."]".$content."[/url]"; } private function ubb_img($src) { @@ -96,6 +64,7 @@ class LinkImage extends Extension { } private function html_url($link,$content) { + if ($content == NULL) { $content=$link; } return "".$content.""; } private function html_img($src) { @@ -104,7 +73,7 @@ class LinkImage extends Extension { private function link_code($label,$content,$id=NULL) { $control = "\n"; - $control .= "\n"; + $control .= "\n"; $control .= "
\n\n"; return $control; }