* @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package AJAX * */ if(isset($_POST['action'])) { $action = $_POST['action']; } elseif(isset($_GET['action'])) { $action = $_GET['action']; } else { $action = ""; } if ($action == "newsfeed") { $feed = "http://forum.froxlor.org/index.php/rss/forums/1-froxlor-announcements/"; if (function_exists("simplexml_load_file") == false) { die(); } if (ini_get('allow_url_fopen')) { $news = simplexml_load_file($feed, null, LIBXML_NOCDATA); } else { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $feed); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $news = simplexml_load_file(trim($output)); } if ($news !== false) { for ($i = 0; $i < 3; $i++) { $item = $news->channel->item[$i]; $title = (string)$item->title; $link = (string)$item->link; $content = preg_replace("/[\r\n]+/", "", strip_tags($item->description)); echo "
" . $title . "
" . $content . "
"; } } else { echo ""; } } else { echo "No action set."; }