<?php $d = 0; // search depth; while (!file_exists(str_repeat('../', $d) . 'wp-config.php')) if (++$d > 99) exit; $wp_config = str_repeat('../', $d) . 'wp-config.php'; require_once($wp_config); $url_base = get_bloginfo('template_directory'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> .title {background-color:#000; color:#fff; padding:5px;} .headdiv { width:650px; height:211px; margin-bottom:10px;} </style> </head> <body style="background-color:#fff;margin-left:20px;"> <h2>Squeeze Page Header Images</h2> <p>The images shown below are the built-in header images. They are all designed for use with the default 650 pixel page width.</p> <?php $foldername = 'squeezeheaders'; $dirPath = dir(TEMPLATEPATH .'/images/' . $foldername . '/'); $imgArray = array(); while (($file = $dirPath->read()) !== false) { if (substr($file, -3)=="png" || substr($file, -3)=="jpg" || substr($file, -3)=="gif") { $imgArray[ ] = trim($file); } } $dirPath->close(); sort($imgArray); $c = count($imgArray); for($i=0; $i<$c; $i++) { $imagename = $imgArray[$i]; if (get_option($value['id']) == $imagename) { $selected='selected=\"selected\"'; } else { $selected = ''; } echo "<div class=\"headdiv\" style=\"background: url(" . $url_base . "/images/" . $foldername . "/" . $imagename . ") no-repeat center 25px;\"><div class=\"title\">" . $imagename . "</div></div>"; } ?> </body> </html>