From 54502378690b09204ed9c21dcb50304e6d4daa96 Mon Sep 17 00:00:00 2001 From: Artanis Date: Tue, 29 May 2007 20:02:18 +0000 Subject: [PATCH] == Version 0.2.0 == * Changed the HTML generation to use a prototype theme engine. All HTML generation is now contained within {{{link_image.html.php}}}, which may be copied to the current theme folder and edited from there. git-svn-id: file:///home/shish/svn/shimmie2/trunk@147 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/link_image/link_image.html.php | 83 ++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 contrib/link_image/link_image.html.php diff --git a/contrib/link_image/link_image.html.php b/contrib/link_image/link_image.html.php new file mode 100644 index 00000000..a13bd6c9 --- /dev/null +++ b/contrib/link_image/link_image.html.php @@ -0,0 +1,83 @@ +post_link = $post; + $this->image_src = $img; + $this->thumb_src = $thumb; + $this->text_link = $text; + } + + public function getHTML () { + $html = ""; + +/* Rearrange or add to the code sections here. (BEGINNER) * + * Please do not edit anything outside the following section. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + $html .= ""; +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + return $html; + } + +/* Section Construction (INTERMEDIATE) * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + private function BBCode() { + return $this->section("BBCode", + $this->link_code("Text Link", $this->ubb_url($this->post_link, $this->text_link), "ubb_text-link"). + $this->link_code("Thumbnail Link",$this->ubb_url($this->post_link, $this->ubb_img($this->thumb_src)),"ubb_thumb-link"). + $this->link_code("Inline Image", $this->ubb_img($this->image_src), "ubb_full-img")); + } + + private function HTML() { + return $this->section("HTML", + $this->link_code("Text Link", $this->html_url($this->post_link, $this->text_link), "html_text-link"). + $this->link_code("Thumbnail Link", $this->html_url($this->post_link,$this->html_img($this->thumb_src)), "html_thumb-link"). + $this->link_code("Inline Image", $this->html_img($this->image_src), "html_full-image")); + } + + private function PlainText() { + return $this->section("Plain Text", + $this->link_code("Post URL",$this->post_link,"text_post-link"). + $this->link_code("Thumbnail URL",$this->thumb_src,"text_thumb-url"). + $this->link_code("Image URL",$this->image_src,"text_image-src")); + } + + private function section ($legend, $content) { + return "
$legend$content
\n\n"; + } + +/* Text and Textbox Construction (ADVANCED) * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + private function ubb_url($link,$content) { + if ($content == NULL) { $content=$link; } + return "[url=".$link."]".$content."[/url]"; + } + private function ubb_img($src) { + return "[img]".$src."[/img]"; + } + + private function html_url($link,$content) { + if ($content == NULL) { $content=$link; } + return "".$content.""; + } + private function html_img($src) { + return ""; + } + + private function link_code($label,$content,$id=NULL) { + $control = "\n"; + $control .= "\n"; + $control .= "
\n"; + return $control; + } +} +?> \ No newline at end of file