Quoteoftheday v1.0

Release Notes

This plugin adds a quote of the day/week/month feature that is driven by the users.  Users can submit their own quotes and rate other user's submitted quotes.  Each day/week/month (admin can choose) the quote with the highest rating will be featured.  You can display the featured quote anywhere on your site (for example, the index page) by calling "get_featured_quote_entity();"

Screenshot:

Screenshot

 

New in this version:

  • Plugin works on Elgg 1.5
  • River feed works correctly
  • River Icon added
  • The widget view is greatly improved and has multiple user settings
  • Cron job support

Note:

There may be bugs as I haven't tested this on a live site yet.  Please report/send me any bugs or language translations and I will promptly update/add them to the next version.  As always, suggestions for improvement are always welcome, thanks!

Enjoy

- Jonesy

  • Wow, great! Thank you, good job, nice appearance!

  • Just to let you know, I am getting 2 errors when I try to install this.

    1.  Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/xxxx/public_html/mysite.com/mod/quoteoftheday/languages/en.php on line 59


    2. Parse error: syntax error, unexpected $end, expecting ')' in /home/xxxx/public_html/mysite.com/mod/quoteoftheday/languages/en.php on line 59

    [line 59] 'quoteoftheday:rating:popup' => 'Rate this quote either up or down',

  • Well, I am not erroring out any more.  I changed all of the " in the en.php to ' and it worked.  Also the same error on line 71.

  • How do you make a quote the "Featured Quote"?

  • Crusader, thanks for the tip, I'll remove all the double quotes in the next version. 

    I forgot to mention, you need to have your cron jobs setup in order for quotes to become featured.  If you select the quotes to be featured "daily", the next quote will be featured when the next "Daily" cron job runs.  Same for the plugin's weekly and monthly settings.

  • Thanks for the nice plugin.

    I get this message each time I enable the plugin:

    quoteoftheday is a misconfigured plugin.

  • @Anas : The 'quoteoftheday' folder has another folder names 'quoteoftheday'  move the inner-most one to the mod directory - not the one that comes out of the zip file.  If you navigate to/mod/quoteoftheday, you should see a start.php file.

  • Is there any way to 'batch upload' a bunch of quotes I have?  I'd like to see the plugin rotate through the hundred or so I have in a text file.  Any thoughts?

  • Good question, oldzephead.   If I were to do it, I would temporarily change the page handler in start.php to something like the following:

        function quoteoftheday_init_page_handler($page)
        {
          //  gatekeeper();//THIS PREVENTS INTRUSION
            global $CONFIG;
            if(isset($page[0]))
                set_input("quote", $page[0]);
            if(isset($page[1]))
                set_input("agreement", $page[1]);

            include($CONFIG->pluginspath . "quoteoftheday/actions/add.php");
        }

    Then run a shell script and for each quote in your list, call "GET www.yourwebsite.com/pg/quoteoftheday/[thequote]/1" where [thequote] is the next quote in your list.  Make sense? I haven't actually tried this, but it should work.  Just make sure you're logged in under the same IP as your script or remove the isloggedin() code from add.php and set the 'owner_guid' of the quote to your GUID (also in add.php).

  • Nice!  I'll give it a run later tonight and let you know how it goes..

  • How should we configure crontab to work w/Quote of the Day?

  • Azion, in the administrator plugin panel there's a settings section for the Quoteoftheday plugin.  One of the options is how frequently you want the featured quote to be updated (daily/weeky/monthly).   Whichever option you choose, you need to make sure you have your elgg cron jobs setup for the matching frequency.   So, if you choose to update the featured quote "Every Day", you need to have your elgg's "daily" cron job working, if you select "Every Week", you need to have your elgg's "weekly" cron job working.  Make sense?   Here's more info on elgg's cron system http://docs.elgg.org/wiki/Cron

  • OK, I've got Quote of the Day integrated w/crontab. Now, where the heck do I get it integrated w/the river? I certainly don't see any 'River Icon' in the applet. Sorry for being so thick... it's been a long day.

  • When a user submits a  new quote, a "create" event should show up on their river feed.  That's the only river integration. 

  • Got it... that, I see. What kind of code might I use to put a block alongside of the river showing the currently-featured quote?

  • OK, take 2...

    How would I add code to display the Quote of the Day in a box along with the newest users + wire widget on the river dashboard? I see that, to display the quote, you call "get_featured_quote_entity();", but I'm not sure how to integrate this w/the elgg_echo commands in the /var/www/mod/riverdashboard/index.php file.

  • Well, I don't really know how the riverdashboard works these days, I've been using my own custom views since Elgg 1.0 so I'm not familar with the newer elgg designs.   You can display the quote as it would be displayed in the widget by calling "elgg_view_entity(get_featured_quote_entity())"

    Other than that, you're on your own for how you want to display it.  If you look at "actions/add.php" in the plugin folder you can see all the metadata names for a given quote entity.  You could theoretically pull any of those values and display them as you wish.

  • I cannot see where to submit a quote. On the QOTD Home I see " Submit your own quote" but no textbox or a "Submit" button.

  • I just installed it and it works great,I'm gonna try and put it on the main page.

    "I cannot see where to submit a quote. On the QOTD Home I see " Submit your own quote" but no textbox or a "Submit" button."  go to your tools menu on the top of your page,and you'll see the link to add a quote

  • Here's what I did to add QOTD to the River Dashboard. I added the following to the /var/www/mod/riverdashboard/index.php:

                            //Quote of the Day

    $body .= elgg_view_entity(get_featured_quote_entity());

     

    I put this just after the code which adds the newest members + your latest wire post to the left of the dashboard (using the $areal command) and the Welcome + site messages to the main body (using the $body command).

     

    What I'd like to do now is change this code so that it presents the QOTD w/a wrapper similar to the Welcome message above it. Any suggestions?

     

    -Z

  • Is there an easy fix to make the (maximum of 250 characters) up to 500 or so?I'm not sure if I can edit just one page,well I can't find it anyway...

  • Patriot, check out "quoteoftheday\views\default\quoteoftheday\forms\submit.php" around line 30 you'll see a line that contains the code "'maxlength' => 250".   That's the max character limit.  I placed a limit on it because lengthy quotes may not display well in widgets, just keep that in mind.

  • Thanks,it's works fine,I also changed the language file to match it.I really appreciate the info and the plugin...I'll try one with 500 to see what it does.

  • One more thing,I'm using the vasco mainpage plugin,I'm guessing It won't work on that at this point.

  • Ok, so I have the plugin installed and everything seems to work great at first glance. So that's a good start!

    Now I want to run a cron for the featured quote on a daily basis. I read up on the cron implementation, but it was like speaking to me in Farsi... just didn't get it.

    So here is a screen of the Direct Admin panel on my server and the cron deployment. Who can tell me how to setup the needed cron?

    (right click, view image to enlarge)

    image

Stats

  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 5201
  • Recommendations: 5

Other Projects

View Jonesy's plugins