All pastes #896776 Raw Edit

Stuff

public text v1 · immutable
·published 2008-02-08 23:05 UTC
rendered paste body
<?php
	if (get_post_meta($post->ID, 'image_caption', 'true')!="") {
		$caption = get_post_meta($post->ID, 'image_caption', 'true');
		$captionfinal = "<p>".get_post_meta($post->ID, 'image_caption', 'true')."</p>";
	} else {
		$caption = "";
		$captionfinal = "";
	}
	if (get_post_meta($post->ID, 'left_image', 'true')!="") {
		$floatclass = "leftpic";
		if (is_home()) {
			$origimgurl = get_post_meta($post->ID, 'left_image', 'true');
			$imageurl = str_replace(".jpg", ".thumbnail.jpg", $origimgurl);
		}
		if (is_single()) {
			$imageurl = get_post_meta($post->ID, 'left_image', 'true');
		}
		$result = "<div class=\"".$floatclass."\"><img src=\"".$imageurl."\" alt=\"".$caption."\">".$captionfinal."</div>";
		echo $result;
	} elseif (get_post_meta($post->ID, 'right_image', 'true')!="") {
		$floatclass = "rightpic";
		if (is_home()) {
			$origimgurl = get_post_meta($post->ID, 'right_image', 'true');
			$imageurl = str_replace(".jpg", ".thumbnail.jpg", $origimgurl);
		}
		if (is_single()) {
			$imageurl = get_post_meta($post->ID, 'right_image', 'true');
		}
		$result = "<div class=\"".$floatclass."\"><img src=\"".$imageurl."\" alt=\"".$caption."\">".$captionfinal."</div>";
		echo $result;
	}	
?>