set_borders ($outlineType=''); $h->set_title ($title); $h->set_href_text($alt_text=''); $h->set_size ($objectWidth=0, $objectHeight=0); $h->set_colors ($bgcolor, $hdcolor='', $ftcolor=''); $h->set_myclasshref ($myclasshref = '') { $h->set_body ($body_text = ''); $h->set_bottom ($bottom_text = '', $bottom_url=''); $h->set_caption(); $return_str = $h->highslide_link($objectType, $so=''); /****************************************************************/ class pt_highslide { // The six parts of the code var $href_text = ''; var $header; var $has_bottom=false; var $bottom=''; var $has_caption=false; var $caption=''; // The parameters var $objectType; var $ID; var $outlineType = "outlineType: 'drop-shadow'"; // var $align= "position: 'center center'"; var $align= "align: 'center'"; var $objectWidth = 0; var $objectHeight = 0; var $objectLoadTime = "objectLoadTime: 'after'"; var $contentId; var $bgcolor = '#FFF'; var $hdcolor; var $ftcolor; var $move_text = 'Move'; var $close_text = 'Close'; var $width = 0; var $height = 0; var $img_url; var $thumb_url = ''; var $link_url; var $src_url = ''; var $title = ''; var $alt_text = ''; var $main_div; var $body=''; var $padding = 'padding: 0;'; var $myclass = 'highslide'; /****************************************************************/ /* Constructor /****************************************************************/ function pt_highslide ( $main_url, $thumb_url, $main_text = '', $src_url = '' ) { $this->ID = 'a'.mt_rand(0,10000); $this->img_url = $main_url; $this->link_url = $main_url; $this->thumb_url = $thumb_url; $this->src_url = $src_url; $this->title = $main_text; $this->alt_text = $main_text; } /****************************************************************/ /* This chooses the border type and set the close/move text /****************************************************************/ function set_borders ($outlineType='') { if ($outlineType != '') $this->outlineType = "outlineType: '".$outlineType."'"; if ($outlineType == 'windows') { $this->move_text = ''; $this->move_text .= 'Move'; $this->move_text = ''; $this->close_text = ''; $this->close_text .= 'Close'; } else { $this->close_text = 'Move'; $this->move_text = 'Close'; } } /****************************************************************/ /* This sets the title /****************************************************************/ function set_title ($title) { $this->title = $title; } /****************************************************************/ /* This sets the size of the frame /****************************************************************/ function set_html_size ($width=0, $height=0) { $this->width = $width; $this->height = $height; } /****************************************************************/ /* this sets the display part, wether a thumbnail or a text /****************************************************************/ function set_href_text ($alt_text='', $add_tags='') { if ($alt_text == '') $alt_text = __('Click to enlarge: ', 'post-thumb').$this->title; if ($this->thumb_url=='') $this->href_text = $alt_text; else { if ($this->width == 0) $tag_width = ''; else $tag_width = ' width="'.$this->width.'"'; if ($this->height == 0) $tag_height = ''; else $tag_height = ' height="'.$this->height.'"'; $this->href_text = "\n\t".''.$this->title.''; } $this->href_text .= "\n".''; } /****************************************************************/ /* This sets the size of the frame /****************************************************************/ function set_size ($objectWidth=0, $objectHeight=0) { $this->objectWidth = $objectWidth; $this->objectHeight = $objectHeight; } /****************************************************************/ /* This sets the colors of the frame /****************************************************************/ function set_colors ($bgcolor, $hdcolor='', $ftcolor='') { $this->bgcolor = $bgcolor; if ($hdcolor=='') $this->hdcolor= $bgcolor; else $this->hdcolor=$hdcolor; if ($ftcolor=='') $this->ftcolor= $bgcolor; else $this->ftcolor=$ftcolor; } /****************************************************************/ /* This sets the content of the frame. /****************************************************************/ function set_body ($body_text = '') { $this->has_body = true; $this->body = $body_text; } /****************************************************************/ /* This sets the bottom part of the frame /****************************************************************/ function set_bottom ($bottom_text = '', $bottom_url = '') { $this->has_bottom = true; $this->bottom = "\n\t".'
'; if ($bottom_url == '') $this->bottom .= "\n\t\t".''.$bottom_text.''; else $this->bottom .= "\n\t\t".''.$bottom_text.''; $this->bottom .= "\n\t".'
'; } /****************************************************************/ /* this sets the caption (for overlay only) /****************************************************************/ function set_caption ($caption_text = 'Lien direct') { $this->has_caption = true; $this->caption ="\n".'
'. "\n\t".$this->title. "\n".'
'; } /****************************************************************/ /* this sets the caption (for overlay only) /****************************************************************/ function set_myclasshref ($myclasshref = '') { if ($myclasshref != '') $this->myclass .= ' '.$myclasshref; } /****************************************************************/ /* Returns html code /****************************************************************/ function highslide_link($objectType='overlay', $so='') { $href = $this->pt_highslide_href ($objectType, $so); if ($objectType == 'swfObject') $this->padding = 'padding: 0 10px 10px 10px;'; switch ($objectType) : case 'iframe' : case 'ajax' : case 'swfObject' : case 'html' : $this->highslide_main_div(); $html_string = $href.$this->href_text.$this->main_div; break; default : $html_string = $href.$this->href_text.$this->caption; endswitch; return $html_string; } /****************************************************************/ /* Sets the a tag part of the HS code /****************************************************************/ function pt_highslide_href ($objectType, $so='') { $var_caption = ''; switch ($objectType) : case 'iframe' : case 'ajax' : $link_url = $this->link_url; $expand = 'htmlExpand'; $var_contentId = "contentId: 'html-".$this->ID."', "; $var_align = $this->align.', '; $var_objectType = "objectType: '".$objectType."', "; $var_objectWidth = 'objectWidth: '.$this->objectWidth.', '; $var_objectHeight = 'objectHeight: '.$this->objectHeight.', '; // Check if ($this->src_url == '') $var_srcurl = pt_return_get($this->link_url); else $var_srcurl = $this->src_url; $var_srcurl = "src: '".$var_srcurl."', "; $var_allowSizeReduction = ''; $var_objectLoadTime = $this->objectLoadTime; break; case 'swfObject' : $link_url = $this->link_url; $expand = 'htmlExpand'; $var_contentId = "contentId: 'html-".$this->ID."', "; $var_align = $this->align.', '; $var_objectType = 'swfObject: '.$so.', '; $var_objectWidth = 'objectWidth: '.$this->objectWidth.', '; $var_objectHeight = 'objectHeight: '.$this->objectHeight.', '; // Check $var_srcurl = ''; $var_allowSizeReduction = 'allowSizeReduction: false, '; $var_objectLoadTime = $this->objectLoadTime; break; case 'html' : $link_url = '#'; $expand = 'htmlExpand'; $var_contentId = "contentId: 'html-".$this->ID."', "; $var_align = $this->align.', '; $var_objectType = ''; $var_objectWidth = 'objectWidth: '.$this->objectWidth.', '; $var_objectHeight = ''; $var_srcurl = ''; $var_allowSizeReduction = ''; $var_objectLoadTime = ''; break; default : $link_url = $this->img_url; $expand = 'expand'; $var_contentId = ''; if ($this->has_caption) $var_caption = "captionId: 'caption".$this->ID."', "; $var_align = $this->align.''; $var_objectType = ''; $var_objectWidth = ''; $var_objectHeight = ''; $var_srcurl = ''; $var_allowSizeReduction = ''; $var_objectLoadTime = ''; endswitch; return "\n".''; } /****************************************************************/ /****************************************************************/ function highslide_main_div ($so='') { $this->main_div = "\n".'
'; $this->main_div .= "\n\t".'
'; $this->main_div .= "\n\t\t".$this->move_text; $this->main_div .= "\n\t\t".$this->close_text; $this->main_div .= "\n\t".'
'; $this->main_div .= "\n\t".'
'.$this->body.'
'; $this->main_div .= $this->bottom; $this->main_div .= "\n".'
'; } } // End of pt_highslide class /****************************************************************/ /* Return a highslide string to display icon and html /****************************************************************/ function pt_thumbed_link ($hs_style, $hs_url, $hs_width, $hs_height, $hs_ID, $hs_text, $hs_image='', $hr_text='', $hr_title='') { if ($hr_text == '') $hr_text = $hs_text; if ($hr_title == '') $hr_title = $hr_text; if ($hs_image=='') $hs_image = POSTHUMB_ABSPATH.'images/pong.gif'; // gather icon html $hs_link = pt_get_effect ('hs_newwindow', $hs_style, $hs_url, $hs_width, $hs_height, $hs_ID, $hs_text, $hs_image); // gather text html $hr_link = '
'.$hr_text.''; return $hs_link.' '.$hr_link; } ?>