Results 1 to 6 of 6

Thread: gAjax RSS Feeds Displayer script customization

  1. #1
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default gAjax RSS Feeds Displayer script customization

    1) Script Title: gAjax RSS Feeds Displayer

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

    3) Describe problem: Thank you for the great script! My questions are more on script customization.

    I'm using Example 2, and would like to know if the square bracket for the label can be removed or replaced by two forward slashes, for example.

    Also, I understand the body of the RSS is a "snippet"... is the a way to modify how many characters are being displayed? is looks like the code displays the first sentence of the original post, and I'd like to extend it by at least one more sentence.

    Thank you!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try the below attached .js file. It does two things:

    1) Removes the square brackets from the labels: [label] is shown just as label
    2) When the display option is set to "description" instead of "snippet", it displays the first 200 characters of the full description (after stripping it of any HTML tags). The display option is set in the following line inside your initialization code:

    Code:
    "
    "
    newsfeed.displayoptions("datetime description") //show the specified additional fields
    newsfeed.setentrycontainer("p") //Display each entry as a paragraph
    newsfeed.filterfeed(8, "date") //Show 8 entries, sort by date
    newsfeed.init() //Always call this last
    To change the 200 character limit to something else, inside the .js file, you'd change 200 below to another number:

    Code:
    		itemdescription=itemdescription.replace(re, "").substring(0, 200)
    		if (itemdescription.length==200)
    			itemdescription+='...'
    DD Admin

  3. #3
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much! I'll get to work right away

  4. #4
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    DD Admin,
    I've originally used an example with two RSS feeds. If I wanted to have the script display one more or two more RSS feeds that'll be added to the mix, do I need to change this line:

    var socialfeed=new gfeedfetcher("example2", "example2class", "_new")

    to

    var socialfeed=new gfeedfetcher("example3", "example3class", "_new")

    plus add socialfeed.addFeed (); ?

    Thank you,
    Irina

  5. #5
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Alphabetical order

    Hello,
    This time my question to you is this:
    With RSS Feed Displayer script, I have:

    <script type="text/javascript">

    var socialfeed=new gfeedfetcher("example2", "example2class", "_new")
    socialfeed.addFeed("CXC News", "http://...")
    socialfeed.addFeed("CXC Elite Blog", "http:/...")
    socialfeed.addFeed("CXC Adaptive News", "http:...")
    socialfeed.displayoptions("label datetime description")
    socialfeed.setentrycontainer("div") //Display each entry as a DIV
    socialfeed.filterfeed(8, "label") //Show 6 entries, sort by label
    socialfeed.init() //Always call this last

    </script>

    On the display priority list "CXC News" are #1, "CXC Elite Blog" is #2, and "CXC Adaptive News" is #3. The script, however, displays "CXC Adaptive News" first and "CXC News" last - I'm guessing basing it on alphabetical order. Is there any way to assign the order to the deeds?

    Thanks a lot!
    Irina

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Irina, in the future, please start a new thread when asking a new question, even about the same script.

    To your question, sort by label is based on the ascending alphabetical order of the labels. I reckon you're asking how to sort by descending alphabetical order instead? If so, try finding the below line inside the .js file, and add to it the line in red:

    Code:
    gfeedfetcher._sortarray(feeds, this.sortstring)
    feeds.reverse()
    DD Admin

  7. The Following User Says Thank You to ddadmin For This Useful Post:

    cxcskiing (10-20-2010)

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
  •