thumb_url : thumbnail url $this->thumb_path : thumbnail path on server **********************************************************************/ class pt_thumbnail { var $settings; var $arg; var $the_image; var $extension; var $thumb_url; var $thumb_path; var $sub_folder; var $alt_append; var $alt_append2; var $append; var $resize_width=0; var $resize_height=0; var $crop_x=0; var $crop_y=0; var $keep_ratio=false; var $rounded=false; var $base_name=false; var $textBox; var $text; var $dirname = false; var $width = 0; var $height = 0; var $use_png = false; var $use_jpg = false; var $error = false; var $defaultimg; var $wordtube_options=''; var $playertype=''; /****************************************************************/ /* Constructor /****************************************************************/ function pt_thumbnail ($settings, $img_url='', $arg='', $default = false) { $this->the_image = $img_url; $this->settings = $settings; $this->arg = $arg; $this->defaultimg = $default; $this->pt_parse_arg(); $this->pt_get_thumbnail(); unset($settings); } /****************************************************************/ /* Retrieve all parameters /****************************************************************/ function pt_parse_arg () { parse_str($this->arg, $new_args); $new_args = array_change_key_case($new_args, CASE_UPPER); if (isset($new_args['SUBFOLDER'])) $this->sub_folder = '/'.$new_args['SUBFOLDER']; else $this->sub_folder =''; $this->sub_folder = $this->test_folder($this->sub_folder); if (isset($new_args['DIRNAME'])) $this->dirname = true; if (isset($new_args['ALTAPPEND'])) $this->alt_append = $new_args['ALTAPPEND']; else $this->alt_append = $this->settings['append_text']; if (isset($new_args['APPEND'])) $this->append = ($new_args['APPEND']==1); else $this->append = ($this->settings['append'] == 'true'); if (isset($new_args['ADDAPPEND'])) $this->alt_append2 = $new_args['ADDAPPEND']; else $this->alt_append2 = ''; if (isset($new_args['WIDTH'])) $this->resize_width = $new_args['WIDTH']; else $this->resize_width = (int) $this->settings['resize_width']; if (isset($new_args['HEIGHT'])) $this->resize_height = $new_args['HEIGHT']; else $this->resize_height = (int) $this->settings['resize_height']; if (isset($new_args['HCROP'])) $this->crop_x = $new_args['HCROP']; else $this->crop_x = 0; if (isset($new_args['VCROP'])) $this->crop_y = $new_args['VCROP']; else $this->crop_y = 0; if (isset($new_args['KEEPRATIO'])) $this->keep_ratio = ($new_args['KEEPRATIO']==1); else $this->keep_ratio = ($this->settings['keep_ratio'] == 'true'); if (isset($new_args['MIME'])) { $this->use_png = ($new_args['MIME']=='png'); $this->use_jpg = ($new_args['MIME']=='jpg'); } else $this->use_png = ($this->settings['use_png'] == 'true'); if (isset($new_args['ROUNDED'])) $this->rounded = ($new_args['ROUNDED']==1); else $this->rounded = ($this->settings['rounded'] == 'true'); if ($this->rounded) $this->use_png = true; if (isset($new_args['BASENAME'])) $this->base_name = ($new_args['BASENAME']==1); else $this->base_name = false; if (isset($new_args['TEXTBOX'])) $this->textBox = ($new_args['TEXTBOX']==1); else $this->textBox = false; if (isset($new_args['TEXT'])) $this->text = $new_args['TEXT']; else $this->text = ''; } /****************************************************************/ /* Creates and returns thumbnail /****************************************************************/ function pt_get_thumbnail() { // First, replace domain by server path if image is on server $the_image_server = htmlentities(str_replace($this->settings['full_domain_name'], $this->settings['base_path'], $this->the_image)); $dest_path = pathinfo($the_image_server); $dest_path_temp['basename'] = $dest_path['basename']; if ($this->dirname) { $url_dec = explode('/', $dest_path['dirname']); $dirname = sanitize_file_name(end($url_dec)); } else $dirname=''; // Build dir to save thumbnail to $save_dir = $this->settings['base_path'].'/'.$this->settings['folder_name'].$this->sub_folder; // name to save to - Adds append text - Check extension if ($this->use_png) $this->extension = 'png'; elseif ($this->use_jpg) $this->extension = 'jpg'; else $this->extension = $dest_path['extension']; $filename = $dirname.substr($dest_path_temp['basename'], 0, strrpos($dest_path_temp['basename'], ".")); if ($this->defaultimg) $filename = $filename.$this->resize_width.'x'.$this->resize_height; if ($this->base_name) $rename_to = $this->alt_append.$this->alt_append2.'.'.$this->extension; elseif ($this->append == 'true') $rename_to = $filename.$this->alt_append.$this->alt_append2.'.'.$this->extension; else $rename_to = $this->alt_append.$filename.$this->alt_append2.'.'.$this->extension; $rename_to = str_replace ('%20', '_', $rename_to); $rename_to = str_replace ('%', '_', $rename_to); // checks if file already exists - returns location if it does // If basename, force thumbnail generation if (file_exists($save_dir.'/'.$rename_to) && (!$this->base_name)) { $this->thumb_url = $this->settings['full_domain_name'].'/'.$this->settings['folder_name'].$this->sub_folder.'/'.$rename_to; $this->thumb_path = $save_dir.'/'.$rename_to; } // check if image exists. If doesn't exist, can't do anything so return default image elseif (!remote_file_exists($this->the_image)) { $this->thumb_url = $this->settings['full_domain_name'].$this->sub_folder."/".$this->settings['default_image']; $this->thumb_path = $this->settings['base_path']."/".$this->settings['default_image']; } // if file has to be generated, generates thumbnails else { $this->thumb_url = $this->settings['full_domain_name']."/".$this->settings['folder_name'].$this->sub_folder."/".$rename_to; $this->thumb_path = $save_dir.'/'.$rename_to; // Create the image // $thumb = new ImageEditor($dest_path['basename'],$dest_path['dirname'].'/', '', $this->settings); if (!class_exists('ImageEditor')) include(PT_ABSPATH . 'lib/post-thumb-image-editor.php'); $thumb = new ImageEditor($this->the_image,'', '', $this->settings); if ($thumb->img_error || $thumb->error) { unset($thumb); $this->error = true; return false; } // Set output type if different from image if ($this->use_png) $thumb->setImageType('png'); if ($this->use_jpg) $thumb->setImageType('jpg'); // Resize image $thumb->resize($this->resize_width, $this->resize_height, $this->crop_x, $this->crop_y, $this->keep_ratio, $this->rounded); // Round corner if option is checked if ($this->rounded) { $thumb->setImageType('png'); $thumb->rounded($this->settings['corner_ratio']); } // Adds text box if option is checked if ($this->textBox && $this->text<>'') $thumb->AddBox (true, 0, 0, 0, 15, $this->text, 255, 255, 255, 15); if (!$thumb->error) { // If no error so far, saves thumbnail on server $thumb->outputFile($save_dir."/".$rename_to, "", $this->settings['jpg_rate'], $this->settings['png_rate']); // Get thumbnail size (may be different from resize size $this->width = $thumb->getWidth(); $this->height = $thumb->getHeight(); } else $this->error = true; unset($thumb); } } /****************************************************************/ /* Tests and creates sufolder. If cannot, return blank. /****************************************************************/ function test_folder($sub_folder) { if ($sub_folder == '/' || $this->settings['safe_mode']=='true') return ''; $tempdir = $this->settings['base_path'].'/'.$this->settings['folder_name'].$sub_folder; if (wp_mkdir_p($tempdir)) return $sub_folder; else return ''; /* if (is_dir($tempdir)) return $sub_folder; @mkdir($tempdir); @chmod($tempdir, 0777); if (is_dir($tempdir)) return $sub_folder; */ return ''; } } // End of pt_thumbnail class /********************************************************************** Class: pt_post_thumbnail Generate a html linked to a post. This html: - can contain a thumbnail from an image of the post - can show several informations from the post Returns: $this->html $this->thumb_url : thumbnail url $this->thumb_path : thumbnail path on server $this->the_image : url of the linked image **********************************************************************/ class pt_post_thumbnail { var $post; var $settings; var $arg; var $the_default_image; // Image to use first var $permalink; var $default_title; var $default_date; var $default_author; var $search; var $post_url; var $media_url; var $media_title; var $meta_content = false; var $the_image; var $extension; var $has_image = true; var $has_media = false; var $has_youtube = false; var $has_caption; var $thumb_url; var $thumb_path; var $html; var $title; var $alt_text; var $use_catname; var $show_title = ''; var $img_title; var $myclasshref = ''; var $myclassimg = ''; var $LB_effect = false; var $showpost = false; var $align = ''; var $nodef; var $def_image = false; // True if no image or media in post var $def_url; var $width; var $height; var $resize_width; /****************************************************************/ /* Constructor /****************************************************************/ function pt_post_thumbnail ($settings, $post='', $arg='', $default_image='', $default_media='', $permalink='', $title='', $date='', $author='', $search=true) { // Get all parameters $this->post = $post; $this->settings = $settings; $this->arg = $arg; $this->the_default_image = $default_image; $this->the_default_media = $default_media; $this->permalink = $permalink; $this->default_title = $title; $this->default_date = $date; $this->default_author = $author; $this->search = $search; unset($settings); unset($post); // Init local parameters $path = pathinfo($this->the_default_media); $this->has_media = ($this->the_default_media != '' && $path['extension']!=''); $this->has_youtube = ($this->the_default_media != '' && $path['extension']==''); $this->def_url = $this->settings['full_domain_name']."/".$this->settings['default_image']; $this->use_hs = ($this->settings['hs_use'] == 'true'); $this->use_tb = ($this->settings['tb_use'] == 'true'); if ($this->has_youtube) $this->arg .='&ADDAPPEND='.$this->the_default_media; // Sets title && use jLanguage if present if ($this->default_title != '') $this->title = $this->default_title; else $this->title = $this->post->post_title; if (function_exists('jLanguage_processTitle')) $this->title = jLanguage_processTitle($this->title); // Init permalink if ($permalink == '') $this->post_url = get_permalink($this->post->ID); else $this->post_url = $permalink; // Set all the parameter options $this->pt_parse_arg(); // Check if image should be retrieved first from meta data if ($this->settings['use_meta'] == 'true' && $this->search) $this->meta_content = get_post_meta($this->post->ID, 'pt_meta_thumb', true); // Get the image to thumbnailed if ($this->search) $this->pt_search_the_image(); else $this->pt_get_the_image(); // Generate thumbnail $t = new pt_thumbnail ($this->settings, $this->the_image, $this->arg, $this->def_image); if ($t->error) { unset($t); $t = new pt_thumbnail ($this->settings, $this->def_url, $this->arg, true); } $this->thumb_url = $t->thumb_url; $this->thumb_path = $t->thumb_path; $this->width = $t->width; $this->height = $t->height; unset($t); // Use $this->pt_GetImgHTML(); to get output string } /****************************************************************/ /****************************************************************/ function pt_parse_arg () { parse_str($this->arg, $new_args); $new_args = array_change_key_case($new_args, CASE_UPPER); if (isset($new_args['WIDTH'])) $this->resize_width = $new_args['WIDTH']; else $this->resize_width = (int) $this->settings['resize_width']; $this->nodef = isset($new_args['NODEF']); if (isset($new_args['ALTTEXT'])) $this->alt_text = str_clean ($new_args['ALTTEXT']); else $this->alt_text = $this->post->post_title; if (isset($new_args['USECATNAME'])) $this->use_catname = ($new_args['USECATNAME']==1); else $this->use_catname = ($this->settings['use_catname']=='true'); if (isset($new_args['SHOWTITLE'])) $this->show_title = $this->Return_Title($new_args['SHOWTITLE']); if (isset($new_args['CAPTION'])) $this->has_caption = ($new_args['CAPTION'] == 1); if (isset($new_args['TITLE'])) $this->img_title = $this->Get_Title($new_args['TITLE']); else $this->img_title = $this->title; if (isset($new_args['MYCLASSHREF'])) $this->myclasshref = $new_args['MYCLASSHREF']; if (isset($new_args['ALIGN'])) $this->align = ' align="'.$new_args['ALIGN'].'"'; if (isset($new_args['MYCLASSIMG'])) $this->myclassimg = ' class="'.$new_args['MYCLASSIMG'].'"'; if (isset($new_args['LB_EFFECT'])) $this->LB_effect = ($new_args['LB_EFFECT']==1); if (isset($new_args['SHOWPOST'])) $this->showpost = ($new_args['SHOWPOST']==1); } /****************************************************************/ /****************************************************************/ function pt_get_the_image() { // if image is already given if ($this->the_default_image != '') { $this->the_image = $this->the_default_image; } // If no image, return default image else { $this->the_image = $this->def_url; $this->has_image = false; $this->def_image = true; } } /****************************************************************/ /****************************************************************/ function pt_search_the_image() { // if image is already given if ($this->the_default_image != '') { $this->the_image = $this->the_default_image; } // finds an attachement to the post elseif ($this->meta_content !== false && $this->meta_content != '') { // put matches into recognizable vars $this->the_image = tb_thumb_absolute($this->meta_content); } // finds an image from the post content elseif (preg_match('//i', $this->post->post_content, $matches)) { // put matches into recognizable vars $this->the_image = tb_thumb_absolute($matches[2]); // detects if the image is already linked to a thumbnail $img_src = str_replace('/', '\/', $matches[2]); $pattern = '/(.*?)/i'; if (preg_match($pattern,$this->post->post_content,$matches)) $this->the_image = tb_thumb_absolute($matches[2].'.'.$matches[3]); } // If no image found in the post content - checks for video elseif ($this->use_catname) { $this->Get_DefaultCategory(); $this->image = $this->def_url; $this->has_image = false; } // If no image found in the post content - checks for video elseif (!empty($this->settings['video_regex']) && $this->pt_content_check_video()) { $this->the_image = $this->settings['full_domain_name']."/".$this->settings['video_default']; $this->has_image = false; } // If no image found yet - checks for videostream elseif ($this->settings['stream_check'] && $this->pt_content_check_stream()) { $this->the_image = $this->pt_check_stream(); $this->has_image = false; } // If really no image, return default image else { $this->the_image = $this->def_url; $this->has_image = false; $this->def_image = true; } } /****************************************************************/ /* Returns html string with link and thumbnail /****************************************************************/ function pt_GetImgHTML() { if ($this->def_image && $this->nodef) return ''; // Starts Highslide output if ($this->LB_effect && $this->use_hs) { // If showpost true, or post doesn't has picture, and post doesn't have media if ($this->showpost || (!$this->has_image && !$this->has_media && !$this->has_youtube)) { $h = new pt_highslide($this->post_url, $this->thumb_url, $this->title); $h->set_colors($this->settings['bgcolor']); $h->set_borders($this->settings['hsframe']); $h->set_href_text($this->img_title, $this->myclassimg.$this->align); $h->set_myclasshref($this->myclasshref); $h->set_bottom('Lien direct vers : '.$this->title, $this->post_url); $h->set_size(800, 600); $this->html = $h->highslide_link('iframe'); unset($h); } // If a media is given, links to the media elseif ($this->has_media) { $this->InitWordTube(); $this->html = $this->pt_GetVideo ($this->title, $this->the_default_media, $this->thumb_url, $this->settings['wordtube_pwidth'], $this->settings['wordtube_pheight']); } // If a media is given, links to the media elseif ($this->has_youtube) { $this->html = SetYoutubeVideo ($this->the_default_media, $this->title, $this->thumb_url, $this->settings, $this->myclassimg.$this->align); } // Otherwise, links to picture else { $h = new pt_highslide($this->the_image, $this->thumb_url, $this->title); $h->set_borders ($this->settings['ovframe']); $h->set_href_text('', $this->myclassimg.$this->align); $h->set_myclasshref($this->myclasshref); if ($this->has_caption) $h->set_caption($this->title); $this->html = $h->highslide_link('overlay'); unset($h); } } // Starts Thickbox output elseif ($this->LB_effect && $this->use_tb) { // If an image and showpost false if ($this->showpost || (!$this->has_image && !$this->has_media && !$this->has_youtube)) { $this->html = "\n".'html .= ' title="'.$this->title.'"'; if ($this->myclasshref !='') $this->html .= ' class="'.$this->myclasshref.'"'; $this->html .= '>'; $this->html .= "\n\t".''.$this->alt_text.'myclassimg != '') $this->html .= $this->myclassimg; $this->html .= ' />'."\n".''; unset($h); } // If a media is given, links to the media elseif ($this->has_media) { $this->InitWordTube(); $this->html = $this->pt_GetVideo ($this->title, $this->the_default_media, $this->thumb_url, $this->settings['wordtube_pwidth'], $this->settings['wordtube_pheight']); } // If a media is given, links to the media elseif ($this->has_youtube) { $this->html = SetYoutubeVideo ($this->the_default_media, $this->title, $this->thumb_url, $this->settings, $this->myclassimg.$this->align); } else { $h = new pt_thickbox ($this->the_image, $this->thumb_url, $this->title); $h->set_myclasshref($this->myclasshref); $this->html = $h->thickbox_link('overlay'); unset($h); } } // Starts output using no javascript library else { if ($this->showpost || !$this->has_image) $this->html = "\n".'html = "\n".'html .= ' title="'.$this->title.'"'; if ($this->myclasshref !='') $this->html .= ' class="'.$this->myclasshref.'"'; $this->html .= '>'; $this->html .= "\n\t".''.$this->alt_text.'html .= $this->myclassimg; $this->html .= $this->align; $this->html .= ' />'."\n".''; } if ($this->show_title != '') $this->pt_get_add_html(); return $this->html; } /****************************************************************/ /* Set additionnal html string with link and thumbnail /****************************************************************/ function pt_get_add_html() { $this->html .= $this->show_title; } /****************************************************************/ /* Check if there is a video in content using REGEX /****************************************************************/ function pt_content_check_video() { return (preg_match('/'.$this->settings['video_regex'].'/i',$this->post->post_content,$matches)); } /****************************************************************/ /* Returns adhoc thumbnail for videostream /****************************************************************/ function pt_check_stream() { $the_image = ''; if (strpos($this->post->post_content, 'http://www.youtube.com/watch') !== false) { $the_image = POSTTHUMB_URLPATH.'images/youtube.png'; } // Tag from post-thumb library elseif (!(strpos(strtoupper($this->post->post_content), '[YOUTUBE=(') === false)) { $the_image = POSTTHUMB_URLPATH.'images/youtube.png'; } // Tag from post-thumb library elseif (!(strpos(strtoupper($this->post->post_content), '[DAILYMOTION=(') === false)) { $the_image = POSTTHUMB_URLPATH.'/images/dailymotion.png'; } elseif (!(strpos($this->post->post_content, 'http://www.dailymotion.com/swf') === false)) { $the_image = POSTTHUMB_URLPATH.'/images/dailymotion.png'; } elseif (!(strpos($this->post->post_content, 'http://video.google.fr/videoplay') === false)) { $the_image = POSTTHUMB_URLPATH.'/images/gvideo.png'; } elseif (!(strpos($this->post->post_content, 'http://video.google.com/videoplay') === false)) { $the_image = POSTTHUMB_URLPATH.'/images/gvideo.png'; } elseif (!(strpos($this->post->post_content, 'http://video.google.com/videoplay') === false)) { $the_image = $this->settings['full_domain_name']."/".$this->settings['default_image']; } return $the_image; } /****************************************************************/ /* Returns adhoc thumbnail for videostream /****************************************************************/ function pt_content_check_stream() { $test = $this->pt_check_stream(); return ($test != ''); } /***********************************************************************************/ /* Test if image in content /* $img_only = true : return true if an image is found in the current post /* $img_only = false : return true if an image or a video is found in the current post /***********************************************************************************/ function pt_post_content_test($img_only=false) { // find an image from the post content if (preg_match('/post->post_content,$matches)) return true; else { if (!empty($this->settings['video_regex']) && (!$img_only) && $this->pt_content_check_video()) return true; if (($this->settings['stream_check']) && (!$img_only) && ($this->pt_content_check_stream())) return true; return false; } } /****************************************************************/ /* Add post-thumb option SHOWTITLE /****************************************************************/ function Return_Title ($showtitle='') { $arg = strtoupper($showtitle); $ret = "\n".'
    '; $sep = ', '; while ($arg <>'') : if (strlen($arg)==1) $sep = ''; $option = substr($arg, 0, 1); $ret .= $this->Return_TitleOption ($option, $sep); $arg = substr($arg, 1); endwhile; $ret .= "\n".'
'; return $ret; } /****************************************************************/ /* Add post-thumb option TITLE /****************************************************************/ function Return_TitleOption ($option, $sep) { switch ($option) : case 'A': if ($this->default_author == '') $ret = "\n\t".'
  • '.get_author_name($this->post->post_author).$sep.'
  • '; else $ret = "\n\t".'
  • '.$this->default_author.$sep.'
  • '; break; case 'D': if ($this->default_date == '') $ret = "\n\t".'
  • '.substr($this->post->post_date, 0, 10).$sep.'
  • '; else $ret = "\n\t".'
  • '.substr($this->default_date, 0, 10).$sep.'
  • '; break; case 'E': $ret = "\n\t".'
  • '.excerpt_revisited($this->post->post_content, 40, $this->post_url).$sep.'
  • '; break; case 'T': $ret = "\n\t".'
  • '.$this->title.''.$sep.'
  • '; break; endswitch; return $ret; } /****************************************************************/ /* Add post-thumb option TITLE /****************************************************************/ function Get_Title ($title='') { $arg = strtoupper($title); switch ($arg) : case 'C': $ret = htmlspecialchars(excerpt_revisited($this->post->post_content, -1)); break; case 'E': $ret = htmlspecialchars(excerpt_revisited($this->post->post_content, 40)); break; case 'T': $ret = htmlspecialchars($this->post->post_title); break; endswitch; return $ret; } /****************************************************************/ /* Get category image /****************************************************************/ function Get_DefaultCategory () { if (get_bloginfo('version')>='2.1') $myposts = wp_get_post_categories($this->post->ID); else $myposts = wp_get_post_cats('1', $this->post->ID); $array_def = pathinfo($this->def_url); $filename = substr($array_def['basename'], 0, strrpos($array_def['basename'], ".")); foreach ($myposts as $mypost) : $new_def = $array_def['dirname'].'/'.$filename.'cat-'.$mypost.'.'.$array_def['extension']; if (remote_file_exists($settings['full_domain_name']."/".$new_def)) { $this->def_url = $new_def; break; } endforeach; } /****************************************************************/ /* Init wordTube options /****************************************************************/ function InitWordTube ($wordtube_options='', $playertype='') { if ($this->wordtube_options == '') { if ($wordtube_options == '') $this->wordtube_options = get_option('wordtube_options'); else $this->wordtube_options = $wordtube_options; } if ($this->playertype == '') { if ($playertype == '') { // checks for player type and prefers the mediaplayer $wordtube_abspath = ABSPATH.'/wp-content/plugins/' . $this->wt_path.'/'; if (file_exists($wordtube_abspath.'mediaplayer.swf')) $this->playertype = 'mediaplayer.swf'; elseif (file_exists($wordtube_abspath.'mp3player.swf')) $this->playertype = 'mp3player.swf'; elseif (file_exists($wordtube_abspath.'flvplayer.swf')) $this->playertype = 'flvplayer.swf'; else $this->playertype = false; } else $this->playertype = $playertype; } } /****************************************************************/ /* Get category image /****************************************************************/ function pt_GetVideo ($name, $file, $image, $play_width, $play_height) { // Init parameters $settings = ''; $path = pathinfo($file); $extension = strtoupper($path['extension']); $hs_width = $play_width+20; $ID = 'v'.rand(); // Prepare the script string if ($extension == "FLV") $text = $this->settings['wordtube_vtext']; elseif ($extension == "MP3") $text = $this->settings['wordtube_mtext']; // Prepare highslide html if (class_exists('pt_highslide')) { $replace = SetWordTubeMedia ($file, $image, $play_width, $play_height, $ID, $extension, $this->playertype, $this->wordtube_options); $h = new pt_highslide('#', $this->thumb_url, $name); $h->set_colors($this->settings['bgcolor']); $h->set_borders($this->settings['hsframe']); $h->set_size($play_width, $play_height); $h->set_href_text($name, $this->myclassimg.$this->align); $h->set_myclasshref($this->myclasshref); $h->set_size($hs_width); $highslide = $h->highslide_link('swfObject', 'so'.$ID); unset($h); $replace .= $highslide; } elseif (class_exists('pt_thickbox')) { $replace = SetWordTubeMedia ($file, $image, $play_width, $play_height, $ID, $extension, $this->playertype, $this->wordtube_options, true); $h = new pt_thickbox('', $this->thumb_url, $name); $h->set_size($play_width+5, $play_height+10); $h->set_href_text($name); $h->set_body($replace); $replace = $h->thickbox_link('swfObject', $ID); } return $replace; } } // End of pt_post_thumbnail class ?>