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 .= "
";
$html .= $this->BBCode();
$html .= $this->HTML();
$html .= $this->PlainText();
$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 "\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;
}
}
?>