File "headers.php"
Full path: /home5/hallettsvillepow/public_html/wp-content/themes/flexsqueeze151/images/headers/headers.php
File
size: 1.7 KB B
MIME-type: text/x-php; charset=us-ascii
Charset: utf-8
Download Open Edit Advanced Editor Back
<?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:920px; height:175px; border:solid 2px #000; margin-bottom:10px;}
</style>
</head>
<body style="background-color:#fff;margin-left:20px;">
<h2>Header Images</h2>
<p>The images shown below are the built-in header images. The images with the red backgrounds are transparent PNGs which allow your chosen header color to show through.</p>
<?php
$foldername = 'headers';
$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: #900 url(" . $url_base . "/images/" . $foldername . "/" . $imagename . ") no-repeat center 25px;\"><div class=\"title\">" . $imagename . "</div></div>";
}
?>
</body>
</html>