Hi, I am modifying a theme and pulling data out of my PODS tables. I also have a custom DBTOXML.php file which is called from index.php using an AJAX call. Since this is a custom file that I put into my wordpress theme, it can't seem to find my Pod class and so I am not able to pull data out of my PODS tables. Any idea how I can make that 'DBTOXML.php' work with PODS?
Here is the complete code for DBTOXML.php
<?php
$rwhdata = new Pod('rainwater');
$p = $rwhdata->fetchRecords();
$dom = new DOMDocument("1.0");
$node = $dom->createElement("Markers");
$parnode = $dom->appendChild($node);
while ($p->fetchRecord()) {
$node = $dom->createElement("marker");
$newnode = $parnode->appendChild($node);
$locString = $p->get_field('location');
list($latitude,$longitude)=split(',',$locString);
$newNode->setAttribute("latLocation",$latitude);
$newNode->setAttribute("longitude",$longitude);
}
echo $dom->saveXML();
?>
and this is the jquery call...
$.ajax({
url:'<?php echo bloginfo('template_url').'/DBTOXML.php';?>',
type:'POST',
data:"",
success:function(results)
{
//Some work here
}
});