<?php
function cleanXML($str)
{
$str = stripslashes(strip_tags($str));
$str = str_replace(array("<",">","\"", "'", "-", "\r\n"), array("&lt;", "&gt;", "&quot;", "&apos;", "&#45;", ""), $str);
return $str;
}
include('../../class/mysql.php');
include('../../class/site.php');
include('../../functions.php');
$host = str_replace("www.", "", $_SERVER['SERVER_NAME']);
$host = ($host == 'demo.freesites.com.au') ? 'demo.freesites.com.au' : 'www.'.$host;
$b = settings('shop_page');
if($b['shop_page'] > 0)
{
$seo_pageTitle = seo_str($site->pageTitle($b['shop_page']));
echo "id\ttitle\tdescription\tlink\tprice\tcondition\timage link\tmpn\tproduct type\n";
$query = $mysql->query("ID,cat,name,description,thumb_image,price,sale_price,url_key", "fs_shop_products", "hide = 'n' AND cat > 0 ORDER BY ID DESC");
while($data = $mysql->get_array($query))
{
$price = ($data['sale_price'] > 0) ? $data['sale_price'] : $data['price'];
$calevels = '';
$levels = explode("\n", $site->cat_levels($data['cat']));
foreach($levels as $key => $val)
{
list($k, $name) = explode("#", $val);
$calevels .= (!empty($name)) ? trim($name).' > ' : '';
}
$calevels = substr($calevels, 0, -3);
echo $data['ID']."\t";
echo cleanXML($data['name'])."\t";
echo '"'.cleanXML($data['description'])."\"\t";
echo 'http://'.$host.'/'.$b['shop_page'].'/'.$seo_pageTitle.'/'.$data['url_key']."\t";
echo $price."\t";
echo "new\t";
echo 'http://'.$host.'/inc/shop/images/'.$data['thumb_image']."\t";
echo $data['ID']."\t";
echo '"'.$calevels."\"\n";
}
}
?>