\n"; // used UTF-8 so flash will display special chars. print "\n"; print "\n"; if (($news = $MySQL->select_all("SELECT *,DATE_FORMAT(date,'%a, %d %b %Y 09:00:00 EST') as pubDate FROM news WHERE active=1 ORDER BY sort ASC,date DESC LIMIT 20")) !== false) { if (count($news)>0) { print"Rhinebeck At A Glance News\n"; print"http://www.rhinebeckataglance.com/\n"; print"".htmlentities("Rhinebeck At A Glance is your quick stop for information about Rhinebeck.")."\n"; print"en-us\n"; foreach ($news as $row) { print" \n"; print" ".htmlentities($row['title'])."\n"; // print" http://www.rhinebeckataglance.com/rhinebeck_news.php?nid=".$row['id']."\n"; $string = preg_replace('/[^(\x20-\x7F)]*/','', htmlentities($row['description'])); print" ".$string."\n"; print" ".$row['date']."\n"; print" ".$row['pubDate']."\n"; print" \n"; } } } else { } print"\n"; print"\n"; function convert_raw_utf8_smart_quotes($string) { $search = array('&','<','>','"',chr(212),chr(213),chr(210),chr(211),chr(209),chr(208),chr(201),chr(145),chr(146),chr(147),chr(148),chr(151),chr(150),chr(133), chr(0xe2) . chr(0x80) . chr(0x98), chr(0xe2) . chr(0x80) . chr(0x99), chr(0xe2) . chr(0x80) . chr(0x9c), chr(0xe2) . chr(0x80) . chr(0x9d), chr(0xe2) . chr(0x80) . chr(0x93), chr(0xe2) . chr(0x80) . chr(0x94), chr(0xe2) . chr(0x80) . chr(0xa6)); $replace = array('&','<','>','"','‘','’','“','”','–','—','…','‘','’','“','”','–','—','…', '‘', '’', '“', '”', '–', '—', '...'); return str_replace($search, $replace, $string); } //DO NOT ADD END PHP TAG HERE! It WILL break things!