Need help? Check out our Support site, then


Displaying a single random quote

  1. Hello, I've searched and searched but I can find nothing on this topic, but apologies if this is a repeat.

    I would like to display a random line of text (quotes from friends, random thoughts etc.) on my sidebar. So far, I've set up a database and added some quotes, which display randomly, one-at-a-time, when using the following link:

    http://baseportal.com/cgi-bin/baseportal.pl?htx=/missmoopants/Feed

    How can I display the output in my sidebar "legally"?

    Thanks,
    Wendy.

  2. Does it come in html code? You can add the html code into a text widget and place it into your sidebar. But javascript code isn't allowed due to security issues.

  3. I can set it up to output to an absolute link on wordpress, but I don't know how to make an absolute link for a widget. I'm sure there's an easy way to just display this text, but it's something I have no idea about.

  4. Have they given you code to put in your sidebar? Can you post it here for us to see?

    Inserting an absolute link in a widget is the same as normal, just put it in a text widget, save it and drag it to the appropriate place on the sidebar.

    As nosy says though, if it's javascript you haven't got a hope.

    Collin

  5. Hmm, having had a quick look at the overview on baseportal they want the user to paste HTML code into a file/webpage.

    I have a feeling that some of the code used will be stripped by wp.com as "unsafe". Unfortunately this means that it won't work. Best thing to do is try it.

    Example of the code I found:

    <code>html></head><title>Highscore</title></head><br /> <body bgcolor=ffffff><br /> <h2>Highscore</h2><br /> <include src=introduction><br /> <do action=all><br /> <table width=90% border=1><br /> <tr><td>Name</td><td>Punkt</td><br /> <loop sort=- range=0,10 code=perl><br /> out "<tr><td><b>$Name</b></td><td>$Score</td></tr>";<br /> $overall+=$Score;<br /> if($Score>$max) { $max=$Score; $maxName=$Name; }<br /> </loop><br /> </table><br /> Overall: $overall<br><br /> Highest Score: $max by $maxName<br><br /> Average: <perl>out $overall/10;</perl><br /> </body></html></code>

  6. Thanks for that. I tried it and I failed. I tried variations, but WordPress strips out some of the required code. Why is it that the things that seem like the should be the easiest are always the hardest????

  7. Right. Workaround time. I have now outputted the file as an xml page so I can use an RSS feed instead. It's half working. I now have the title field from the DB xml displaying as the title of my RSS widget, but the random quote does not show, but it does appear as a tooltip when I hover my mouse over the text.

    Also, it's not randomly picking a quote: just putting the same entry from the db in, even though the page at the DB end displays different quotes.

    I'm still working on it, so what I've described above maybe slightly out if you view my blog.

    Any help is greatly appreciated.

    Below is the code I've used to create the xml:

    <?xml version="1.0"?>
    <rss version="2.0">
    <channel>
    <loop Id==? db=main>
    <title>Random Quotes</title>
    <description>$Text</description>
    <font color="white"><link>http://google.com</link></font&gt;
    </loop>
    </channel>
    </rss>

  8. Yet another update. I now have two RSS feeds: one that kind of works the way I want it to and the one with the code above (not quite right).

    It does randomly change, but only about once an hour, Ctrl-Shift-Refresh does not change it. Why would this be?

  9. The sidebars are cached. They only update every so often.

  10. Oh. That's annoying.

    Thanks for letting me know about that.

    So, the workaround to the workaround won't work the way I want it to either. Will anything???

  11. In a word "no".

  12. Well, I'm out of ideas then. How can I get some text to appear randomly on a page or the sidebar at each refresh?

    I really don't want to have to link off to another site if possible.

  13. This isn't possible at wordpress.com

  14. Not a lot is...

  15. No, but then the service doesn't disappear like certain others we could mention either...

    ;)

  16. True...it just seems that the most basic of functions is impossible. I still have no idea about page hits (as opposed to blog entry hits, and I hate that I have to put up with pre-designed templates that you can't over-ride with basic HTML (like letters appearing automatically in upper case).

    Swings and roundabouts I guess. Just very frustrating when trying to figure out what *is* possible and wasting too much time on it in the process.

  17. I understand your frustration. That's why I kept my hosted blog rather than move it all here. It's more work but I can do whatever I want with it. :)

  18. I've left a comment on missmoopants' blog to let her know about "twitter"
    http://wordpress.com/forums/topic.php?id=5772&replies=7

  19. Thanks very much for that timetheif, but I don't think that's what I'm after. That seems to revolve around friends, SMSing and instant updates. I just want to display a random quote from a database/list of random quotes that refreshes each time the screen is refreshed. Am I missing something with Twitter?

  20. I haven't used "twitter" and I guessed it wouldn't be a perfect fit for what you wanted at all but I thought I should share its existence with you any way. :) http://wordpress.com/forums/topic.php?id=5772&replies=9

  21. Yeah, it looks quite cool for other purposes. Not quite sure I could make it fit mine :o/

    But thanks :O)

    The hunt continues...

  22. The only thing I can think of is making such a widget and getting staff to install it. You would still run into the cached sidebars issue though. (The cache is created by the underlaying software, not something wp.com does itself)

  23. Well since the cached sidebars are the issue, I may as well just refine what I already have, as this way, I at least have all the flexibility I can have...thanks everyone...

  24. Any chance of getting this widget added to the list of widgets?
    http://ifacethoughts.net/2006/08/24/random-quote-widget-for-wordpress/

  25. Mmmm, that would be nice...

  26. I would suggest sending in a feedback but still you would have to deal with the cached sidebar issue though.

Topic Closed

This topic has been closed to new replies.

About this Topic