'; function allhtmlentities($string,$decode_first=true) { // this is to ensure that any entities already coded are not "messed up" if($decode_first) $string = html_entity_decode($string); // "encode" return preg_replace( '/([^\x09\x0A\x0D\x20-\x7F]|[\x21-\x2F]|[\x3A-\x40]|[\x5B-\x60])/e' , '"&#".ord("$0").";"', $string); } function in_arrayi( $needle, $haystack ) { foreach( $haystack as $value ) if( strtolower( $value ) == strtolower( $needle ) ) return true; return false; } $query = "SELECT n.news_id, n.title, n.newsdate, date_format(n.newsdate,'%a, %e %b %Y %H:%i:%S GMT') AS 'newsdatef', n.newstype_id, n.summary, nt.name FROM " . $db_prefix . "news n LEFT JOIN " . $db_prefix . "newstypes nt ON n.newstype_id = nt.newstype_id WHERE n.visible = '1' ORDER BY n.newsdate DESC LIMIT 15"; $feedtitle = "Dunster Forest Energy articles"; $feeddesc = "The latest articles, news and information from Dunster"; $results = @mysql_query ($query) or die (mysql_error()); while ($row = @mysql_fetch_array ($results)) { $title = utf8_encode(allhtmlentities($row[title])); $titlef = preg_replace("/[^0-9a-z]/i",'-', strtolower($title)); $cat = $row['name']; $newslist .= "$titlehttp://www.dunster.biz/news/$row[news_id]/$row[newsdate]/$titlef$row[summary]$row[newsdatef]$cathttp://www.bracknellscuba.org.uk/news/$row[news_id]/$row[newsdate]/$titlef"; } ?> <?=$feedtitle?> http://www.dunster.biz en-gb hello@dunster.biz hello@dunster.biz