Updated Today

About the “Updated Today” Plugin:
This is a WordPress Plugin that will display a graphic in the upper left corner of the blog when the blog has been updated the day of the view. This is my first plugin and I intend to make more. If there are any problems with this plugin let me know in the comments. Any suggestions are welcome and comments please.

Download version 2.1

Compatability:
This is tested and written on my own WordPress install which is currently version 2.8.3. The minimum for this plugin is WordPress 2.7.1.

To install this plugin:
1. Download the .zip archive
2. Unzip and upload the “updatedtoday” folder to your “wp-content/plugins/” directory
3. Then simply Activate the Plugin
4. If it does not display be sure to check that this line of code is in the footer.php file of your theme:

<?php wp_footer(); ?>

Change Log:

–Version 2.0–
Added a ‘Settings’ page in which you can choose your image to display, the side of the page it displays on and allows the blogger to upload their own images to the specified folder.

–Version 1.8.1–
Cleaned up the whitespace on the CSS and added CSS to make the padding and margin on the image ‘0′.

–Version 1.8–
Modified database query to use the $table_prefix variable for databases containing multiple Wordpress installations as well as people who modified the $table_prefix on setup.
Big thanks to Georg and TeraS for their help on testing for this one!

–Version 1.6.1–
Fixed an error with some themes that made their header image use a Z-Index of 99, which matched that of the plugin. Changed the plugin Z-Index to 100. – thanks TeraS

–Version 1.6–
Fixed the banner from displaying when a draft was created by adding the post_status query to only include posts with the status of ‘publish’

–Version 1.4–
Fixed the issue with not displaying transparent in Internet Explorer
Fixed link of the banner to now go to the post id instead of the guid URI

–Version 1.3–
Plugin is now fully WC3 Compliant
Minor CSS style changes
Added configuration boolean (true/false) settings for placement, style, and pngfix.
Added link to the most current post
Known Issues:
When a picture is used in a post, that picture becomes the target of the link on the banner.

–Version 1.2–
Chromakode is now helping me out with some of the testing and coding.
Improved WC3 compatability (still one more issue to resolve with code placement)

–Version 1.1–
Included pngfix.js in to the plugin folder in order to make for an easier install. This allows for transparent png’s to be visable in Internet Explorer.
Thanks to http://homepage.ntlworld.com/bobosola/ for the PNGFIX code.

–Version 1.0–
This is the initial release of the plugin.
Possible issues:
Not certain if every WordPress install uses the same field names for the post_date and same table names.


  1. July 3rd, 2009 at 14:50 | #1

    I have a great problem. Even when i activate the Plugin it dont work and display at the end of page:
    Theme: INOve and the same problem with BlogPimp

    Warning: mysql_query() [function.mysql-query]: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) in /mnt/web2/…/wp-content/plugins/updated-today-plugin/updated-today.php on line 46

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /mnt/web2/…/wp-content/plugins/updated-today-plugin/updated-today.php on line 46

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/web2/…/wp-content/plugins/updated-today-plugin/updated-today.php on line 47

  2. July 3rd, 2009 at 15:51 | #2

    @Joerg Schueler
    Everything I can find related to this error suggest that you may need to contact your hosting provider or server administrator concerning a possible Database issue. I am running the same theme you are with Inove without error at this time. Some more detail might be helpful. What version of Wordpress, the theme, and also if you have any specific settings you needed to do to get your hosting account to run Wordpress that were different from a standard installation. I’ll be glad to see if I can help you out just need a little more information as this seems very localized to your installation.

  3. July 4th, 2009 at 02:39 | #3

    First: sorry about my crazy english ;-)

    I don’t think it a provider problem becaus it works first time.
    Now i deaktivate every plugin and locate the problem with then “ChCounter Widget” Version 2.6.2 by Kolja Schleich http://kolja.galerie-neander.de/plugins/chcounter-widget/

    Perhaps you have a hint or alternate for me.

  4. July 4th, 2009 at 15:21 | #4

    Sorry. i forgot the WP Version is 2.8 standard installation and inove version is 1.4.5
    Thanks a lot for you help.

  5. July 4th, 2009 at 20:20 | #5

    @Joerg Schueler
    Ok, after some further review, it looks like that plugin you are using requires a connection to a separate database than Wordpress’ to do it’s counter calculations because chCounter requires it’s own MySQL database to connect. If you disable only the chCounter does it work fine? If it does then there is your problem. What is probably happening is that the chCouter plugin is running it’s database connection string and then my plugin is running a query, assuming that the only active MySQL connection is the Wordpress connection (as follows Wordpress codex) and so my plugin is trying to query your chCounter database which does not work.

  6. July 5th, 2009 at 02:21 | #6

    Thanks for your help, now i fix it down to only one error line by adding “$chCounter_force_new_db_connection = FALSE;” to the chCounter Script. So the script use the existing database connection.
    Btw. the chCounter database is the same as WordPress used only his own tables.

    Perhaps you have a solution for this last error line to fix because my knowing about php and databases is very low.

    The last error:
    (Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/web2/41/06/518806/htdocs/joergschueler/wp-content/plugins/updated-today-plugin/updated-today.php on line 47)

  7. July 5th, 2009 at 06:20 | #7

    @Joerg Schueler
    That error is getting caught on the following section but specifically line 47:

            global $table_prefix;
            $today = date("Y-m-d");
            $status = 'publish';
            $query = MySQL query removed for length
            $results = mysql_query($query);
    47      $num_results = mysql_num_rows($results);
    

    This is valid even according to the PHP manual:
    http://www.php.net/manual/en/function.mysql-num-rows.php

    It may be due to the global $table_prefix; if you have not yet defined the table prefix value in the wp-config.php file.

  8. July 5th, 2009 at 14:58 | #8

    Problem seem to be fixed and i send you changes code by email.

    thanks for your really good support and help.

  9. July 10th, 2009 at 18:35 | #9

    Just a quick hi and hope all is kk with you Chris! Tera

  10. Wayne
    July 28th, 2009 at 13:40 | #10

    Thanks for the update Chris. Especially appreciate the new settings page. Great job!!

  11. August 3rd, 2009 at 09:13 | #11

    Missing file question mark icon appears in upper left corner.

    On Settings page I found this:

    Fatal error: Call to undefined function: scandir() in /home/content/ [ ... ] /plugins/updated-today-plugin/updated-today.php on line 88

  12. August 3rd, 2009 at 17:13 | #12

    @Paul Moxon
    Can I get some information about what type of server you are hosting this on? As long as it has PHP you should have the scandir() function accessible. Let me know and I’ll see if there is something I can do to resolve it on my end.

    Also if you could let me know of the permissions you have on your ‘plugins’ directory.

    Thanks.

  13. August 3rd, 2009 at 17:57 | #13

    I have since upgraded to 2.8.3 and no longer see the question mark nor the banner.

    OS Linux
    Server Apache
    PHP v4.3.11
    MYSQL v4.0.27-max-log

    By permissions do you mean are there other administrators?

  14. August 3rd, 2009 at 18:37 | #14

    Correction: the question mark shows in Safari but not Firefox

  15. August 4th, 2009 at 05:42 | #15

    The new version fixed it. Chris K. rocks!

  16. September 5th, 2009 at 05:09 | #16

    nice
    very good
    but how i can but it in the rigth side

  17. September 5th, 2009 at 05:16 | #17

    nice
    very good
    but how i can but it in the right side

  18. September 23rd, 2009 at 11:13 | #18

    Problem returns. Question mark instead of .png graphics in Options (and blog pages).
    Deleted plugin from server, then uploaded new copy. No improvement. No error messages. http://thinkletterpress.com/

  19. October 7th, 2009 at 08:47 | #19

    @Paul Moxon

    Hey Paul, sorry I missed your comment. Are you still having issues? Let me know I’ll go ahead and see what I can find out. Just email me with any details chris [at] chriskdesigns [dot] com

  20. October 19th, 2009 at 11:35 | #20

    Thank you
    And is available in Arabic on this link

    http://www.ma7abah.com/blog/?p=128

  21. January 25th, 2010 at 09:10 | #21

    I have a problem. I activate this plugin. All my banner lost, include template banner. Please to help me. Thank you.

  22. January 25th, 2010 at 09:16 | #22

    @eko prasetyo

    I looked at the URL you provided http://ekopras.com/ and the banner displays as well as your header. It does appear you need to set the position to ‘Left’ instead of ‘Right’. If you have a different URL you are having issues with let me know.

    Thanks!

Comment pages
  1. May 11th, 2009 at 03:57 | #1
  2. July 28th, 2009 at 02:10 | #2
  3. September 8th, 2009 at 20:56 | #3
  4. September 8th, 2009 at 20:58 | #4