Results 1 to 3 of 3

Thread: rss pausescroller : Need to remove \n

  1. #1
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default rss pausescroller : Need to remove \n

    1) Script Title: rss pausescroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pausescroller/

    3) Describe problem: This might be quite simple but I just can't figure it out without getting javascript errors left and right. As you know when it displays a feed entry it will display the entry and then the date it was added. However I'm trying to get rid of the \n (new line) so that the feed and date remains on 1 line.

    So instead of this:

    Feed entry 1
    Dec 9, 2009 1:2 AM

    I would like it to display this:
    Feed entry 1 - Dec 9, 2009 1:2 AM


    Thanks for anyone who can figure this out because I sure cant

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Find this near the top of the rsspausescroller.js file:

    Code:
    //Advanced users: Edit below function to format the RSS feed output as desired
    //formatrssmessage(divid, message_index_within_array, linktarget, logicswitch)
    
    function formatrssmessage(divid, msgnumber, linktarget, logicswitch){
    var rsscontent=rsscontentdata[divid][msgnumber]
    var linktitle='<span class="rsstitle"><a href="'+unescape(rsscontent.link)+'" target="'+linktarget+'">'+unescape(rsscontent.title)+'</a></span>'
    var description='<div class="rssdescription">'+unescape(rsscontent.description)+'</div>'
    var feeddate='<span class="rssdate">'+unescape(rsscontent.date)+'</span>'
    if (logicswitch.indexOf("description")!=-1 && logicswitch.indexOf("date")!=-1) //Logic switch- Show description and date
    return linktitle+"<br />"+feeddate+description
    else if (logicswitch.indexOf("description")!=-1) //Logic switch- Show just description
    return linktitle+"<br />"+description
    else if (logicswitch.indexOf("date")!=-1) //Logic switch- Show just date
    return linktitle+"<br />"+feeddate
    else
    return linktitle //Default- Just return hyperlinked RSS title
    }
    
    //////NO NEED TO EDIT BEHIND HERE///////////////////////////
    Change the highlighted line to:

    Code:
    return linktitle+" - "+feeddate+description
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many thanks! Works

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •