Read the custom RSS directly from the settings

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold (BNoiZe)
2014-06-01 21:55:10 +02:00
parent 7d4ea57381
commit 38599ec4b9
4 changed files with 17 additions and 12 deletions

View File

@@ -16,6 +16,16 @@
*
*/
// Load the user settings
define('FROXLOR_INSTALL_DIR', dirname(dirname(__FILE__)));
if (!file_exists('./userdata.inc.php')) {
die();
}
require './userdata.inc.php';
require './tables.inc.php';
require './classes/database/class.Database.php';
require './classes/settings/class.Settings.php';
if(isset($_POST['action'])) {
$action = $_POST['action'];
} elseif(isset($_GET['action'])) {
@@ -25,8 +35,8 @@ if(isset($_POST['action'])) {
}
if ($action == "newsfeed") {
if (isset($_GET['url'])) {
$feed = $_GET['url'];
if (isset($_GET['role']) && $_GET['role'] == "customer") {
$feed = Settings::Get("customer.news_feed_url");
} else {
$feed = "http://inside.froxlor.org/news/";
}
@@ -35,9 +45,6 @@ if ($action == "newsfeed") {
die();
}
// get version
require './tables.inc.php';
if (function_exists('curl_version')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $feed);