Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: user choice of rss feed in pausing rss scroller

  1. #1
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question user choice of rss feed in pausing rss scroller

    Hi there,

    I successfully added an rss scroller (from here) into my document.

    What I would like to do now is add some radio buttons that give the browser a choice of which rss feed, from a small predefined set, gets scrolled.

    This is kind of new to me - is there a way to destroy the original one, and create a new one with a different first argument? How do I link the radio buttons to the new object?

    I appreciate any pointers to relevant tutorials/examples.

  2. #2
    Join Date
    Apr 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Just so they don't tell you.....follow this format for questions!

    Hey, make it easy on admin follow this post guide:
    http://www.dynamicdrive.com/forums/showthread.php?t=6

    EXAMPLE:
    -------------

    Script: DD Tab Menu
    http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

    Rest of your question here...

    -------------

    This makes it a lot easier for others (like Admin) to quickly see which script you're referring to.

  3. #3
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default can we talk about scripting now?

    sad to see back seat moderation instead of discussion. A mouseover on my previous post's link would give all this information, but here it is:

    --------------------------------------
    Script: rsspausescroller
    http://www.dynamicdrive.com/dynamici...ller/index.htm
    --------------------------------------

    question is in first post above.

  4. #4
    Join Date
    Apr 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Good luck to you...
    and i bow lowly at your feet in apologies that you find it "sad to see back seat moderation instead of discussion. "

    "back seat moderation.... " and I was only trying to help!

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hey, relax guys. He's just trying to help, Dster. Looks like the link WAS in the first post, though, sig.

    So... for your problem:

    you need to pick javascript vs. php (or asp, etc).

    javascript is live... that's the only advantage.

    php is pretty nice though.

    here's what I'd do:
    this is php, but the js would be fairly similar, overall.

    Setup your radio buttons. Add a submit button (or, if you're suggesting having it change onclick, then you do need to use javascript)
    make the value relate to an rss feed, hopefully with just value="something" where you want "something.rss" as the feed.

    Then, use php at the top to:
    1. check if the value has been sent (if ($_POST['radioname']) {...)
    2. use: <?php echo $_POST['radioname']; ?> within your rss scroll script... wherever the url/href/src of the page is stored. (something like href="blah/blah/<?putphphere?>.rss")
    note: if you need it more complex than just the name of the rss feed, like a full url, use php if statements (if 'google', then 'google.com/rss.rss' or whatever)
    3. store cookies if you want... might be helpful to store their preference... (or sessions)

  6. #6
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33
    Then, use php at the top to:
    1. check if the value has been sent (if ($_POST['radioname']) {...)
    2. use: <?php echo $_POST['radioname']; ?> within your rss scroll script... wherever the url/href/src of the page is stored. (something like href="blah/blah/<?putphphere?>.rss")
    note: if you need it more complex than just the name of the rss feed, like a full url, use php if statements (if 'google', then 'google.com/rss.rss' or whatever)
    3. store cookies if you want... might be helpful to store their preference... (or sessions)
    Thanks for the help - I really appreciate it.

    I think this is a little beyond me.

    Right now I am having trouble changing the feed of an instance of the rsspausescroller.

    I figure that before I go messing around, I ought to be able to first have in the scripting portion of the file, after the

    mypausescroller = new rsspausescroller("cnn", "pscroller2", "rssclass", 3000, "", "date+description");

    line, another line that changes its feed. I can't seem to figure out what line of code would do that, though. Any thoughts?

  7. #7
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok, I'm trying a new approach.

    Let's say I have a .php file "foo" containing some stuff.

    Then, in another file, I call "foo" with a parameter.

    Later, if the user does something, then I want to replace what was added during the last "foo" call with a new "foo" call.

    This would solve my problem - but maybe I should be asking about this in a php forum. I appreciate any suggestions.

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well... you said it's beyond you. Just take a look around php.net to get some ideas about how it all works.

    your questions are pretty general, and it's hard to answer without specifics in this case, plus, really, I don't know Javascript very well. So... I could help out some with the php, but not sure about the JS.

    One easy way to do it would be an iframe.

    With an iframe, all you'd need is JS that would change onClick depeding on which radio button. Then the frame would display the right rss.

    OR the url of the rss could be stored in a variable that is changed by the onClick command of the buttons... that would work.

    How to do this, I dunno.

    The more I think about this, you could do a complex php way, but it would make more sense with JS as it's pretty much a client side thing.
    You cna use cookies in JS. Or, you could have some php parts, but mainly base it in JS.
    You could look into ajax which is basically trikcing the system into using php live... by using JS to refresh the php page and getting the result.
    this is, though, above me (as of yet), but others know it. There are some scripts to look at as well... fairly complex though, especially to modify for this.

  9. #9
    Join Date
    Apr 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Check this out, and until you figure out a way to use radio buttons this may work...
    http://www.bcacricket.org/news/index.htm

    And seeing as how Dster and I are best buddies, I know he'll take a look...

  10. #10
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yay -

    I figured it out!

    Forget about the radio buttons, pull down menus to get the user to choose which RSS feed they want. That I can figure out later, and has nothing to do with the particularities of the rsspausescroller script.

    I just wanted to

    -create a method for changing the rss feed
    -call the method at a point after the initial rsspausescroller was created

    it turns out this is super easy, once you learn that javascript is, in many ways, completely unlike Java. If anyone cares, I can post the code I used.
    Last edited by Dster; 05-02-2006 at 07:10 PM.

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
  •