We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Cory - Addition requested to your RSS Feed code; random sources
Topic Started: Jul 18 2013, 11:40 PM (262 Views)
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
Board Address: Great Escape
Board Software: ZetaBoards
Description: Sometimes different RSS feeds are wanted, but deleting the old link and putting in a new link (and risking having to search for the old link when one wants to go back to it) can be a pain.

I was wondering if it would be possible to modify the code you wrote HERE (news bar ticker) to accept more than one RSS link... maybe separated by commas in the "My RSS Preference" field, or maybe three different fields (IE: "My First RSS Preference", "My Second RSS Preference", "My Third RSS Preference")?... and then, once accepted, randomly choose one on every page load where a RSS feed is shown (there'd still only be one feed at any one time on the page... it would just be randomly picked from the feeds listed on the profile).

Thanks in advance for considering this!
Edited by RichardInTN, Jul 18 2013, 11:48 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Use this instead:
Code:
 
<script type="text/javascript" src="http://z3.ifrm.com/63/1/0/f673511/jqueryzrssfeedmin.js"></script>

<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
var pField = 'PROFILE_FIELD_NAME';
var uID = $.zb.stat.mid;

$.get(main_url + 'profile/' + uID + '/?force_ads', function (data) {
var pFieldData = $('table.profile td.c_desc:contains(' + pField + ')', data).next('td').html().split('<br>');
var rssIndex = Math.floor(Math.random() * pFieldData.length);

$('#rss').rssfeed(pFieldData[rssIndex], {
limit: 5
});

function nextMessage() {
$('li.rssRow:visible').hide().next('li.rssRow:hidden').fadeTo('slow', 1.0);

if ($('li.rssRow:visible').length === 0) {
$('li.rssRow:eq(0)').fadeTo('slow', 1.0);
}
}

window.setInterval(nextMessage, 5000);
});
$.get(location.href);
});
//]]>
</script>
You'll have to use a Textbox profile field instead of a 1 line text profile field and you'll have to instruct your users to insert one RSS feed URL per-line in the textbox.
Offline Profile Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
Works perfectly Cory. You rock!
Offline Profile Goto Top
 
Moonface
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic