<?php
header('Content-type: text/javascript; charset=iso-8859-1');
require_once('../../class/mysql.php');
$blogPageId = $mysql->get_array($mysql->query("value", "fs_settings", "name = 'blog_page' LIMIT 1"));
$host = str_replace("www.", "", $_SERVER['SERVER_NAME']);
$host = ($host == 'demo.freesites.com.au') ? 'demo.freesites.com.au' : 'www.'.$host;
$limit = ($_GET['limit'] > 0) ? $_GET['limit'] : 10;
$list .= '<ul id="recentBlogPosts">';
$query = $mysql->query("title,url_key", "fs_blog_entries", "status = 'Publish' ORDER BY stamp DESC LIMIT $limit");
while($data = $mysql->get_array($query))
{
$list .= '<li><a href="http://'.$host.'/'.$blogPageId['value'].'/'.$data['url_key'].'">'.$data['title'].'</a></li>';
}
$list .= '</ul>';
?>
document.write('<?=$list;?>');