";
$html .= "
";
$html .= $image->GetImgRef($href, get_settings('pp_thumb_size'));
$html .= "
";
$html .= preg_replace($pp_pict_pat, '', $child->post_content);
$html .= "
";
}
}
return $html;
}
// Generate thumbnail for picture post
//
function pp_get_thumb ($url) {
global $wpdb, $pp_page_gen_pat, $pp_pictpress_dir, $pp_children;
$id = url_to_postid ($url);
if (!$id)
return "";
$postdata = wp_get_single_post($id, ARRAY_A);
$parent = $postdata['post_parent'];
$title = stripslashes($postdata['post_title']);
// If main post, generate thumbnail for first child
if ($parent == 0) {
pp_get_children($id);
if (count($pp_children) > 0) {
$postdata = wp_get_single_post(
url_to_postid($pp_children[0]),
ARRAY_A);
}
}
$content = $postdata['post_content'];
if (preg_match($pp_page_gen_pat, $content, $m)) {
include_once (ABSPATH . "$pp_pictpress_dir/class.image.php");
$image = new Image($m[1], $id);
$r = get_permalink($id);
return pp_expand_subtitles($image->GetThumbnail($r));
} else {
// No picture found, just return title + link
return "