Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Pimp My Site! > RSS Feeds
1 2 3 4 5 6 7Next
Beerninja (Guild Admin) 4/30/2008 4:48 AM EST : RSS Feeds
Beerninja
Posts: 547
Zomgawsh Poster

Is anyone else having trouble with RSS feeds or is it just me? I have treid several different feeds and none of them seem to work in fact most of them won't even save I get a box saying these feeds were tried by others and they didn't work. Any tips or places where I can find some working rss feeds relating to mmo's or AoC? Thank you in advance
Photobucket

"I Don’t Practice What I Preach, Because I’m Not The Kind Of Person I’m Preaching To."
TopBottom

Mottie (MVP) 6/2/2008 5:36 PM EST : RE: RSS Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Yeah, I had this same problem. I wanted more choices and more control over the actual feed. So I found out a nice script that google provides. I'm still exploring and learning, but similar scripts can be used to display a search box, a calendar, a map or even images. Check out the site here.

I copied their Feed API and modified it slightly to work with Guild Portal. It should works with all standard formated RSS feeds.

It will display the Feed Title and the news items (with links), when you hover over the news item a tooltip will pop up and show the date & time of the post along with a description.

Add the script below to get it to work.

"feedTitle" is the color of the Title text
"feedText" is the color of the linked news item title
"feedDate" and "feedDesc" are the colors of the text inside the tooltip

"feedURL" is the URL of the feed you want
"feedShown" is the number of news items you want to show

PLEASE USE THE SCRIPT IN THE NEXT POST...


If you want to have more than one RSS Feed on your page, read the post below
, it is possible, but you'll need to change the name of pretty much every variable used in the script above 

You can see this script in action on my test site (link in my sig)

I hope this helps! 

Edit (9/7/08): Changed all [ i ] into [j], since it wasn't showing up in the code
TopBottom

Mottie (MVP) 6/6/2008 4:16 AM EST : RE: RSS Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

RSS Feed Box v1.1 | RSS Feed Box v1.2 | RSS Feed Box v1.3 | RSS Feed Box v1.4

RSS Feed Box v1.1 (version 1.0 was over-written)

Ok I tweeked it so now you can display multiple RSS feeds in a single box, if you want to put multiple boxes on the same page, you'll have to change the ID of the div box in the script (in blue).

Content Box
(free form HTML)
<style type="text/css">
.feedTitle { color: #ffffff; }
.feedDate { color: #aaaaaa; }
.feedDesc { color: #00c000; padding: 5px; }
.feedDesc img { max-width: 550px; }

#feedText1 a:link { color: #ffcc00; text-decoration: none; }
#feedText1 a:visited { color: #ffcc00; text-decoration: none; }
#feedText1 a:hover { color: #ffffff; text-decoration: none; }
#feedText1 a:active { color: #cccc00; text-decoration: none; }
</style>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("feeds", "1");
$(document).ready(function() {
var myfeeds = new Array();

var tooltipWidth = 560;

myfeeds.push (["Digg Stories/Popular","http://www.digg.com/rss/index.xml",5]);
myfeeds.push (["WoW Blues Comments","http://www.wowblues.com/feed.xml",6]);
myfeeds.push (["New Movies this week","http://us.rd.yahoo.com/movies/rss/thisweek/?http://rss.ent.yahoo.com/movies/thisweek.xml",7]);
myfeeds.push (["Warhammer Current News","http://feeds.warhammeronline.com/warherald/RSSFeed.war?type=current",10]);

// **************************************
// Do not change anything below this line
// **************************************
 for (var k = 0; k < myfeeds.length; k++) {
  feedResult(myfeeds[k]);
 }
function feedResult(currentFeed) {
 var feed = new google.feeds.Feed(currentFeed[1]);
 feed.setResultFormat(google.feeds.Feed.XML_FORMAT);
 feed.setNumEntries(currentFeed[2]);
 feed.load(function(result) {
  if (!result.error) {
   var ftitle = (currentFeed[0] == "") ? (result.xmlDocument.getElementsByTagName("title")[0].firstChild.nodeValue) : (currentFeed[0]);
   var feedText = "<div class='feedTitle'>" + ftitle + "</div>";
   var items = result.xmlDocument.getElementsByTagName("item");

   for (var j = 0; j < items.length; j++) {
    var titleElement = items[j].getElementsByTagName("title")[0];
    var xtitle = titleElement.firstChild.nodeValue;

    var titleElement = items[j].getElementsByTagName("link")[0];
    try {var xlink = titleElement.firstChild.nodeValue;} catch(e) {xlink = "";}

    var titleElement = items[j].getElementsByTagName("pubDate")[0];
    try {var pubDate = titleElement.firstChild.nodeValue;} catch(e) {pubDate = "";}

    var titleElement = items[j].getElementsByTagName("description")[0];
    try {var descript = titleElement.firstChild.nodeValue;} catch(e) {descript = "";}

    pubDate = pubDate.replace(/'/g,"&rsquo;").replace(/\"/g,"&quot;");
    descript = descript.replace(/'/g,"&rsquo;").replace(/\"/g,"&quot;");

    var feedPopup = '<div class=feedDate>' + pubDate + '</div><div class=feedDesc>' + descript + '</div>';

    feedText += (j % 2 == 0) ? '<div class="NormGridRow">' : '<div class="AltGridRow">';
    feedText += '<a =\"ddrivetip(\'' + feedPopup + '\', ';
    feedText += '\'\', \'' + tooltipWidth + '\');\" ="hideddrivetip();" href="' + xlink + '">' + xtitle + '</a></div>';
   }
   feedText += '<br>';
   document.getElementById("feedText1").innerHTML += feedText;
  } else { alert ("feed error from " + currentFeed[0]); }
 });
 }
});
</script>
<div id="feedText1"></div>
Customizing the Code
  • Change the CSS styles in purple to match your site.
  • "feedText1" (in blue) should be changed if you use this code more than once on a page.
  • Adjust the "tooltipWidth" value (in red) to your desired tooltip width. Note the ".feedDesc img" class a "max-width" to limit the size of any images that may be included in the feed - make this slightly smaller than your tooltipwidth value.
  • Add your feed RSS links as follows:

    feeds.push (["Feed Title","Feed URL",#]);

    • To add more feeds, add a block that looks like the above example
    • Replace the text in (orange) with your feed RSS URL.
    • Replace the number (in red) with the number of lines from each feed you want to display.
Edit (9/7/08): Changed all the [ i ] into [j], since it wasn't showing up in the code.
Edit (10/10/08): Updated the code: Combined the CSS with the script, corrected some CSS classes and a few minor code changes.
Edit (10/10/08): Updated the code to allow you to name each feed.
Edit (10/11/08): Opps, fixed the code since somehow I posted an older one.
Edit (10/14/08): Added "NormGridRow" and "AltGridRow" classes to the feed lines to help style them for your site.
Edit (10/23/08): Rewrote the script to fix a problem with headers not matching the feeds (only in IE).
TopBottom

Fagulhas (Guild Admin) 9/7/2008 10:16 AM EST : RE: RSS Feeds
Fagulhas
Posts: 1859
Zomgawsh Poster

Sorry to bump this, but having some problems with this custom RSS code.

Copied exactly the code to try it on our website (planning to use a RSS to display upcoming raids of phpraider) tho nothing shows up.

Was able to see this error:

Error: items.getElementsByTagName is not a function
Source File: http://ni.guildportal.com/Guild.aspx?GuildID=51848&TabID=453954
Line: 477


So...the google API code ain't getting loaded? Still a bit newb on this rss thing.


Any help would be appreciated. Thanks

TopBottom

Mottie (MVP) 9/7/2008 11:07 AM EST : RE: RSS Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Sorry, I see the problem...

Whenever you post a "" (<- see!!, but if you reply to this post, it'll show up!) in the forums it hides it... thats a "[ i ]"... I need to go in and change them all to [j]

Give me a min to fix it.

Edit: Fixed both posts above and tested... works fine now, thanks for catching that 

LOL I just figured it out.. [ i ] is BB code for italics LMAO... oh well
TopBottom

Fagulhas (Guild Admin) 9/8/2008 9:56 AM EST : RE: RSS Feeds
Fagulhas
Posts: 1859
Zomgawsh Poster

Mottie said:
LOL I just figured it out.. [ i ] is BB code for italics LMAO... oh well


Learning everyday


Great work as usual mottie, check out the result if you like, made some changes, including 2 lined titles and icons linked to the actual feed content.

Now just need to insert raid data on tooltip, but that's another day


Again, thank you very much!


Knights of Ni Website!

TopBottom

Avandius (New Admin) 10/9/2008 6:35 AM EST : RE: RSS Feeds
Avandius
Posts: 337
Fingers of Fury!

Alright i have an issue with herald.warhammeronline.com RSS. When i use the single code for it, they don't always show up in the tooltip and some times they include images and  the like making a HUGE tooltip.. test it out with the RSS:

http://feeds.warhammeronline.com/warherald/RSSFeed.war?type=current

What do i need to do to get it to work properly with the tooltips?

Also, is there a way to use this for recent posts in the forum section or any recent post box? Would love to hover over and see a clipping/whole message in the tooltip.

Thanks for all the help Mottie!
TopBottom

Mottie (MVP) 10/10/2008 4:20 AM EST : RE: RSS Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hey Avandius,

After looking over this code, I realized it needed a little cleanup. Especially the original, which I removed because the second post basically does the same thing, but was easier to clean up.

So I fixed the problem with the tooltips not showing up. It also limits the size of the image inside the tooltip. The only problem I've run into is the "Hot Fixes - 10/08/2008" feed from Warhammer, it's HUGE! - the tooltip goes off the top of the page. The tooltip was only meant to show a preview.... but I added a tooltip width adjustment.  Also this same feed contains a lot of Microsoft tags (it was saved from M$ Word) - so the tooltip gets cut off when viewing it in Firefox, but shows everything with IE & Chrome. I have no idea how to fix that.

In reference to you asking me about making a tooltip show an entire message in the tooltip of the recent posts section... I couldn't make this work because I have no idea how to access the forum post from another page (nor do I know how to use AJAX). Sorry, all that stuff is on the server side and I don't know how to access it.
TopBottom

Avandius (New Admin) 10/10/2008 7:17 AM EST : RE: RSS Feeds
Avandius
Posts: 337
Fingers of Fury!

Awesomeness!!

You are the best Mottie! Wish i knew half of what you did. I'm just an artist and publisher.. but as much fun as im having i think i shoulda went web design!

If you ever need some graphics ill try my best.

Do you know if there is a way to shorten the title? Would love it to be just WARhammer News.. rather than 2 lines of text. If not thats fine.
TopBottom

Mottie (MVP) 10/10/2008 12:32 PM EST : RE: RSS Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Ok.. now you can add your own title for the feed! LOL
TopBottom

1 2 3 4 5 6 7Next
Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%