Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Lock

    (@locksoft)

    nevermind, I’ve made a widget myself for that. 🙂
    have a nice day.

    Hi! Could you share how you achieved this? Thanks.

    Thread Starter Lock

    (@locksoft)

    Hi Brit,
    I’ ve simply made a wp widget myself. 🙂

    If you’re interested write me at raccspam@gmail.com and I’ll send you the files. I don’t feel to publish it on WordPress as I’ve not the time to maintain it, so I prefer to keep it private.

    Thread Starter Lock

    (@locksoft)

    Since I’m receiving lot of requests about this, I’m going to attach to this post my plugin along with instructions about configuring it.

    Keep in mind coding isn’t my world, so the result may be ugly, unoptimized and with no track about localization (but I’ll try to explain how to do that).

    I hope it could be useful. Sit in a comfortable seat and relax because it’s going to be a very long thing. 🙂

    Let’s start with file. Download this and read below:

    https://dl.dropboxusercontent.com/u/2449859/files/daily-quote.zip

    All you’ve to do is uncompress it and place the directory in your wp-contents/plugin directory, then it should appear in WordPress widgets area.

    I’m sorry there isn’t any localization and sadly the text is all in italian, but I’ll try to explain it at my best (also, sorry for my english, it’s not my native language).

    All settings are inside the widget, when you drag it to the secondary area (the right column) of the widget page. It may work on the bottom (footer) area too but I never tested it. This in case of a two widget area theme. I’m using a personalized version of twentythirteen. Just for reference you can see my site (and plugin in action) here:

    http://io.lemonskin.net

    Translations:

    Titolo = Title. 🙂
    Aggiornamento (update) = it’s the kind of visualizations you can have. “Giornaliero” means one quote for day. “Casuale” is random every time you refresh page.
    Condivisione Twitter = it adds a twitter link, to share the quote. I’ve added this feature but never used so not sure it will show correctly. Just leave it to “no” and everything will be ok.
    Sì = Yes
    No = No 😛

    Of course you can change the language opening the DaylyQuote.php page (more info about it below).

    All quotes are in DailyQuote.txt file. Sorry, I didn’t think anything complex to manage it (such as a SQL database). When I need to edit it I just open it and add quotes then save it.

    Format is a bit confusing but I’ll try to explain at my best.

    Every row is a quote, following this scheme:

    * QUOTE * AUTHOR * NOTE * URL

    “*” is the separation char, you can change it in PHP page if you don’t like it.

    Quote is mandatory, all the rest is optional.

    If an URL is provided, then the author name will have a link to that URL. If it’s empty then the plugin will try to compose it in a wikipedia URL (example: Oscar Wilde will automatically become http://it.wikipedia.org/wiki/Oscar_Wilde).
    Please note that wikipedia URL points to italian version, you need to change it to your country in PHP file (line 62).

    The page will always attempt to create a link to wikipedia unless you put a “-” or a “NO” in the section. For example:

    * Experience is simply the name we give our mistakes. * Oscar Wilde * this is a note * –

    if you don’t need the note just write:

    * Experience is simply the name we give our mistakes. * Oscar Wilde * * –

    Or in a more compact way:

    * Experience is simply the name we give our mistakes. * Oscar Wilde **-

    The starting * wasn’t really necessary but I’ve made it so I can add personal notes to the txt file without they’re processed:

    hmmm… not sure if I like this quote. * Experience is simply the name we give our mistakes. * Oscar Wilde

    I know, it’s a mess. But, as I already told you, it’s something I’ve made for myself because I didn’t find anything fitting my needs. 🙂
    I hope you can understand it, maybe looking at the code (there’s a lot of widget-oriented code but the part you need is between line 60 and 70).
    Also, having a look to “DailyQuote.txt” and experimenting a bit with it could make things more clear.

    Oh, another thing, at line 60 you need to change the text “Anonimo” with “Anonymous”. This will appear in case you don’t specify the author of the quote.

    Between line 84 and 97 you can localize the widget text in wordpress backoffice.

    how the plugin works:
    ————————-
    In txt file every quote is associated to a day of year. First one is 1st January, second is 2nd and so on. So you’re supposed to insert 365 lines. However I’ve added a function that, in case there are less quotes, once the plugin reaches the end of file, it will restart from beginning.
    For example, if there are 5 quotes and it’s 6th of January, the first row will be shown.

    If it could help you, you can check this page (not sure if you can access it, in case let me know), it’s the one I use to test all my quotes:

    http://www.lemonskin.net/io/wp-content/plugins/daily-quote/test_quotes.php

    You can see all my DailyQuote.txt file in action (too bad without CSS) and understand the parameter combinations.

    That’s all. Good luck, I think you’ll need it! 😛

    Anyway I’m here so, in case you need help, just ask. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘One quote for day’ is closed to new replies.