My First Plugin
I created my first plugin today, thanks to some help in #wordpress. Thanks guys. The plugin is simple, displays links to Wikipedia and BBC to show what happened on the date of that post.
Installation is simple and is explained in the readme.txt file. Any problems or questions, let me know.
This Date in History/This Day in History
Also, feel free to donate for my hosting costs.
A very nice plugin:)
Thanks for sharing.
Very cool. I’m trying my best to gather 365 quotes for my Movie Quote one. Do you know if there is a certain code or command that would randomize the quotes I have so I don’t need 365?
I have a question: Do you have this plugin activated somewhere? I’d like to see it in action.
Also, in the readme.txt, it says insert this line of code in The Loop. Well, I’m confused. Am I looking for a filename called theloop or what is the filename?
Thanks,
Thomas
I’ve got the same Thomas’ question.
you can see it in action on the main page, next to the comment link, it says On This Date:
as for the loop, http://codex.wordpress.org/The_Loop explains what the loop is better than i could.
also check: http://wordpress.org/support/topic.php?id=30528 for updates and problems with the plugin.
I like this plugin! I just installed in on my site. Thank you.
Great idea! I have just installed it at my site (with some slight modifications…)
Caleb, there is a plugin called ‘Random Quote of the Day’ that will randomize any number of quotes. You simply enter the quotes and then add a PHP statement outside The Loop to display a quote at random. The name is a bit of a misnomer as it actually displays a different quote each time you reload the page. Random Quote of the Day is found at http://www.mcmike.nl/
Nice plugin!
Thus it runs also in Germany
<?php
/* <WP plugin data>
* Plugin Name: This Date in History
* Version: 1
* Description: Displays a link to what happened on this date in history
* Author: Mike Schepker
* Author URI: http://www.pieceofshep.com/
* special thanks to skippy and bigjibby
* fuer Deutschland modifiziert von http://www.poeti.de
* add the following to the Loop: this_day(get_the_time(‘Y-m-j’));
*/
function this_day($date)
{
$timestamp = strtotime($date);
setlocale(LC_TIME, “de_DE”);
$day = date(j,$timestamp);
$upper_month = strftime(“%B”, $timestamp);
$month = date(m, $timestamp);
$year = date(Y, $timestamp);
$url_date = $day.”._”.$upper_month;
echo “<a href=”http://www.welt.de/data/$year/$month/$day/” title=”Die Meldungen dieses Tages in der Welt”>Heute</a> “;
echo “<a href=”http://www.wikipedia.de/wiki/$url_date” title=”Die geschichtlichen Ereignisse dieses Tages bei Wikipedia.de”>Geschichte</a>”;
}
?>
i use your plugin on comments! stays very nice.
tks!
Thanks for this plugin (and for the german translation, of course). I use it for my site now!
Nice plugin ! I enjoyed it so much I translated it to french, adding some extra options.
French people, feel you free to visit this_day in history en français.
Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in .. ?
immi, php’s date function doesn’t go back past 1970.
Nice one – I’ve got it on my blog at
http://nixit.co.nz/wordpress
it works on WP 2.0 Beta too:
http://nixit.co.nz/new
Although, what I’d like to know is why the date is 18 days out?
I put the same code on both of my blogs and on the WP2.0 beta site the date is correct but on my main blog I am living historically.
Any ideas
Although, what I’d like to know is why the date is 18 days out?
I put the same code on both of my blogs and on the WP2.0 beta site the date is correct but on my main blog I am living historically.
Any ideas?
nix, i noticed that too. i’m not sure why it’s doing that. the way it works is it automatically links to the day of whatever post it appears on. maybe because the plugin isn’t running from each post, but instead your sidebar, it’s causing a problem. email me if you like (use contact form) and i might be able to look at your code.
cheers man.
The script doesn’t seem to work on the Spanish version of WordPress available at http://wordpress-es.sourceforge.net, so I did a WP es_ES version:
*/
function this_day($dia,$mes) {
$fecha = $dia."_de_".strtolower($mes);
echo "según la Wikipedia";
}
?>
Thank you for the great idea though ;)
Hi Mike,
Inspired by your plugin, I made some modifications and turned it into a widgetized current day sidebar plugin.
You can check it out http://jeroenonstenk.nl/maakt/wordpress/1/