Archive for January, 2009

WP-Syntax Test

  • bagheadinc
  • | January 5th, 2009 | 12:06 am
<?php
	$allowed_mimes=array("image/jpeg","image/gif","image/png");
	$dirPath = "./";
	$imglist = array();
	if ($handle = opendir($dirPath)) {
		while (false !== ($file = readdir($handle))) {
			$imageinfo = @getimagesize($file);
			if(in_array($imageinfo["mime"], $allowed_mimes))
				$imglist[] = $file;
		}
		closedir($handle);
	}
 
	$rand = rand(0,count($imglist)-1);
	$file = $imglist[$rand];
	$imageinfo = @getimagesize($file);
 
	switch($imageinfo["mime"]) {
		case "image/jpeg":
			$image = imagecreatefromjpeg($file);
			header("Content-type: image/jpeg");
			imagejpeg($image);
			break;
		case "image/gif":
			$image = imagecreatefromgif($file);
			header("Content-type: image/gif");
			imagegif($image);
			break;
		case "image/png":
			$image = imagecreatefrompng($file);
			imagealphablending($image,false);
			imagesavealpha($image,true);
			header("Content-type: image/png");
			imagepng($image);
			break;
	}
	imagedestroy($image);
?>

Exec-PHP Test

  • bagheadinc
  • | January 3rd, 2009 | 2:59 am

This text is generated with a php echo statement.

Framework

  • bagheadinc
  • | January 2nd, 2009 | 9:52 am

Currently testing out a theme framework I’m developing. Hopefully when I’m finished it will be simple enough to style with ease but still look good with no modifications.