Read the custom RSS directly from the settings
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
@@ -93,8 +93,6 @@ if ($page == 'overview') {
|
|||||||
if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI";
|
if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI";
|
||||||
$services_enabled = implode(", ", $se);
|
$services_enabled = implode(", ", $se);
|
||||||
|
|
||||||
$news_feed_url = Settings::Get('customer.news_feed_url');
|
|
||||||
|
|
||||||
eval("echo \"" . getTemplate('index/index') . "\";");
|
eval("echo \"" . getTemplate('index/index') . "\";");
|
||||||
} elseif ($page == 'change_password') {
|
} elseif ($page == 'change_password') {
|
||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
|
|||||||
17
lib/ajax.php
17
lib/ajax.php
@@ -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'])) {
|
if(isset($_POST['action'])) {
|
||||||
$action = $_POST['action'];
|
$action = $_POST['action'];
|
||||||
} elseif(isset($_GET['action'])) {
|
} elseif(isset($_GET['action'])) {
|
||||||
@@ -25,8 +35,8 @@ if(isset($_POST['action'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "newsfeed") {
|
if ($action == "newsfeed") {
|
||||||
if (isset($_GET['url'])) {
|
if (isset($_GET['role']) && $_GET['role'] == "customer") {
|
||||||
$feed = $_GET['url'];
|
$feed = Settings::Get("customer.news_feed_url");
|
||||||
} else {
|
} else {
|
||||||
$feed = "http://inside.froxlor.org/news/";
|
$feed = "http://inside.froxlor.org/news/";
|
||||||
}
|
}
|
||||||
@@ -35,9 +45,6 @@ if ($action == "newsfeed") {
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get version
|
|
||||||
require './tables.inc.php';
|
|
||||||
|
|
||||||
if (function_exists('curl_version')) {
|
if (function_exists('curl_version')) {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $feed);
|
curl_setopt($ch, CURLOPT_URL, $feed);
|
||||||
|
|||||||
8
templates/Sparkle/assets/js/main.js
vendored
8
templates/Sparkle/assets/js/main.js
vendored
@@ -28,11 +28,11 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Load Newsfeed
|
// Load Newsfeed
|
||||||
var ajax_load = "<div id='newsitem'>Loading newsfeed...</div>";
|
var ajax_load = "<div id='newsitem'>Loading newsfeed...</div>";
|
||||||
var url = "";
|
var role = "";
|
||||||
if (typeof $("#newsfeed").data("url") !== "undefined") {
|
if (typeof $("#newsfeed").data("role") !== "undefined") {
|
||||||
url = "&url=" + $("#newsfeed").data("url");
|
role = "&role=" + $("#newsfeed").data("role");
|
||||||
}
|
}
|
||||||
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed" + url, function() {
|
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed" + role, function() {
|
||||||
if ($("#newsfeeditems").html().length > 0) {
|
if ($("#newsfeeditems").html().length > 0) {
|
||||||
$(window).trigger('resize');
|
$(window).trigger('resize');
|
||||||
$("#newsfeed").slideDown();
|
$("#newsfeed").slideDown();
|
||||||
|
|||||||
2
templates/Sparkle/customer/index/index.tpl
vendored
2
templates/Sparkle/customer/index/index.tpl
vendored
@@ -150,7 +150,7 @@ $header
|
|||||||
|
|
||||||
<div class="grid-u-1-2">
|
<div class="grid-u-1-2">
|
||||||
<if Settings::Get('customer.show_news_feed') == '1'>
|
<if Settings::Get('customer.show_news_feed') == '1'>
|
||||||
<table class="dboarditem full" id="newsfeed" data-url="{$news_feed_url}">
|
<table class="dboarditem full" id="newsfeed" data-role="customer">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>News</th>
|
<th>News</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user