Sample PHP Template

<?
/* Set the path for all public, private, and subdomain files */
ini_set("include_path", "/home/www:/home/private:/home/:.");
ini_set("error_log", "php_errors.log");
ini_set("default_charset", "UTF-8");
ini_set("log_errors", TRUE);
ini_set("display_errors", "stderr");
ini_set("html_errors", FALSE);
ini_set("file_uploads", FALSE);

/* Turn off error reporting */
error_reporting(0);

/* Turn on caching and gzip compression */
include("cache.php");

$script = "";
$keywords = "";
$description = "";
$sitemap = "";
$footer = "&#169; 2000 - 2009 XYZ; ";
$keys_array = array();
$desc_array = array();

include("parse_seo_xml.php");

/* Convert the path of the current page into its HTML display equivalent */
$pagename = ucwords(preg_replace('/(^\/) | (\/.*) | (-)/x',' ', getenv('SCRIPT_NAME') ) );

/* Convert the path of the current page to it's XML equivalent name */
$path = preg_replace('/(^\/) | (\/.*) /x','', getenv('SCRIPT_NAME') );
$seo_data = seo_data($path);

/* Loop through the parsed XML results and get all the SEO data */
foreach ($seo_data['keywords'] as $keys)
  {
  $keys_array[] = $keys;
  }
foreach ($seo_data['description'] as $desc)
  {
  $desc_array[] = $desc;
  }

/* Convert the array of SEO data into a comma delimited string */
$keywords = implode(",", $keys_array);
$description = implode(",", $desc_array);

$xml = new DOMDocument;
$xml->load('../sitemap.xml');

$xsl = new DOMDocument;
$xsl->load('../sitemap.xsl');

/* Initialize the XSL Transformer */
$xmltohtml = new XSLTProcessor;

/* Attach the XSL Rules */
$xmltohtml->importStyleSheet($xsl); 

$sitemap = $xmltohtml->transformToXML($xml);
?>

TrackBack URI

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.