diff --git a/web/plugins/z#home/home.php b/web/plugins/z#home/home.php index 73d203eefb..4485ef8e87 100644 --- a/web/plugins/z#home/home.php +++ b/web/plugins/z#home/home.php @@ -200,7 +200,6 @@ public function execute($args=NULL) dataType: 'xml', maxItems: 5, clearOnSuccess: true, - useGoogleApi: false, generateItemHtml: 0 }; if(t) { @@ -208,7 +207,7 @@ public function execute($args=NULL) } var r = e(this).attr('id'); - if(n.useGoogleApi) + /*if(n.useGoogleApi) { e.ajax({ url: 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=' + n.maxItems + '&output=json&q=' + encodeURIComponent(n.feedUri) + '&hl=en&callback=?', @@ -228,7 +227,7 @@ public function execute($args=NULL) } }); } - else + else*/ { e.ajax({ url: n.feedUri, @@ -240,22 +239,35 @@ public function execute($args=NULL) e("#" + r).empty(); } - var xml = $(t); - var html = ""; - xml.find('item').slice(0, n.maxItems).each(function() { - var self = $(this), - item = { title: self.children('title').text(), - link: self.children('link').text(), - author: self.children('author').text(), - pubDate: self.children('pubDate').text(), - atomSummary: self.children('atom\\:summary').text(), - description: self.children('description').text(), - author: self.children('author').text() - } - html += n.generateItemHtml(n, item); - }); - + + if(n.dataType === 'xml') { + var xml = $(t); + xml.find('item').slice(0, n.maxItems).each(function() { + var self = $(this), + item = { title: self.children('title').text(), + link: self.children('link').text(), + author: self.children('author').text(), + pubDate: self.children('pubDate').text(), + atomSummary: self.children('atom\\:summary').text(), + description: self.children('description').text(), + author: self.children('author').text() + } + html += n.generateItemHtml(n, item); + }); + } + else if (n.dataType === 'json') { + for (var i = 0; i < n.maxItems && i < t.posts.length; ++i) { + var post = t.posts[i]; + item = { title: post.title, + link: post.url, + author: post.author.name, + publishedDate: post.date.substring(0, 10), + content: post.content + } + html += n.generateItemHtml(n, item); + } + } e('#' + r).append('
    ' + html + '
'); } }); @@ -300,10 +312,9 @@ public function execute($args=NULL) });*/ $('#column2').interpretFeed({ - feedUri: 'http://dengine.net/blog/category/news/feed', + feedUri: 'http://dengine.net/blog/category/news/?json=true', dataType: 'json', clearOnSuccess: false, - useGoogleApi: true, maxItems: 2, generateItemHtml: function (n, t) { var html = '

' + t.title + '

'; @@ -321,10 +332,9 @@ public function execute($args=NULL) }); $('#column1').interpretFeed({ - feedUri: 'http://dengine.net/blog/category/dev/feed', + feedUri: 'http://dengine.net/blog/category/dev/?json=true', dataType: 'json', clearOnSuccess: false, - useGoogleApi: true, maxItems: 1, generateItemHtml: function (n, t) { var html = '

' + t.title + '

'; diff --git a/web/plugins/z#home/html/socialbookmarks.html b/web/plugins/z#home/html/socialbookmarks.html index ccf30cfe59..1e12f47d2f 100644 --- a/web/plugins/z#home/html/socialbookmarks.html +++ b/web/plugins/z#home/html/socialbookmarks.html @@ -13,13 +13,13 @@
  • -
  • +
  • Get Doomsday Engine at SourceForge.net. Fast, secure and Free Open Source software downloads
  • \ No newline at end of file