2010-09-22, 16:26:08
I'm currently working on my first GS site. Just wanted to let you know how useful this was. Made a minor edit to strip the <p> tags added by the editor (because I was calling the content into a pre-existing <p> tag)
thanks so much
Code:
<?php
function get_content($page){
$path = "data/pages";
$thisfile = @file_get_contents('data/pages/'.$page.'.xml');
$data = simplexml_load_string($thisfile);
echo stripslashes(htmlspecialchars_decode($data->content, ENT_QUOTES));;
}
function get_naked_content($page){
$path = "data/pages";
$thisfile = @file_get_contents('data/pages/'.$page.'.xml');
$data = simplexml_load_string($thisfile);
echo strip_tags(stripslashes(htmlspecialchars_decode($data->content, ENT_QUOTES)), '<h1><h2><h3><a><b><i><strong><em>');;;
}
?>
thanks so much