Würzblog
Das läuft gerade bei Radio Würzblog: „Endorphine“ von Jazz Ohne Strazz

WordPress-Plugin: A Year Before

| 204 Kommentare

With »A Year Before« you can show the tit­les of the arti­cles, which were writ­ten a cer­tain time ago. So you can show in a »his­to­ri­cal cor­ner«, what hap­pend in your blog e.g. 30 days, 6 months or a year before.

Instal­la­tion

Down­load the plu­gin and unzip the fol­der <em>a-year-before</em> in the plugin-folder of your WordPress-installation. Then activate the plugin.

If you use a theme which sup­ports wordpress-widget, then sim­ply go to the widget-administration and pull the wid­get on the sidebar.

If you want to use the plu­gin by php-code, then open your template-file — e.g. the side­bar — where you can insert the fol­lo­wing PHP-code:

<?php if (function_exists("ayb_posts")) { ?>
<div class="box">
<h2>Posts a year ago</h2>
<ul>
<?php ayb_posts(); ?>
</ul>
</div>
<?php } ?>

Con­fi­gu­ra­tion of the php-code

You can pass some para­me­ters in this scheme
parameter1=value1&parameter2=value2&parameter3=value3 ...

You can use the fol­lo­wing parameters

  • day : the num­ber of days ago you want to show the articles.
  • month : the num­ber of month ago you want to show the articles.
  • year : the num­ber of years ago you want to show the articles.
  • before : piece of HTML to insert before the title of the arti­cles. Default <li>
  • after: piece of HTML to insert after the title of the arti­cles. Default </li>
  • show­date: shows the date (showdate=1) before every title or not (showdate=0)
  • datefor­mat : datefor­mat as used by PHP. Default ist the ger­man short­form »d.m.y«
  • not­found: the text the plu­gin will out­put, if no arti­cle is found on the defined date.
  • range: num­ber of days the plu­gin will search back in the future (rela­tive to the values of day, month and year above) for an arti­cle. Meant as a „round about this day”-feature. Default 0
  • anni­versary: if set to 1, the plu­gin will dis­play all arti­cles ever blog­ged with the same num­ber of day and month. The para­me­ters „day”, „month”, „year” and „range” will be igno­red if used.

Exam­ples

ayb_posts("day=30&before=&after=&showdate=0");
Shows the tit­les of the arti­cles writ­ten 30 days ago wit­hout showing the date. The arti­cles will not been showed as a HTML-list but sim­ply sepe­ra­ted by a linebreak.

ayb_posts("month=6&day=14&notfound=Nothing blogged on this day.");
The tit­les of the arti­cles writ­ten half a year and two weeks before, also showing the date . If there was no arti­cle writ­ten on that day, the out­put will be »Not­hing blog­ged on this day.«

If you like CSS, you can style the date with the class ayb_date, the link of the arti­cle with the class ayb_link and the notfound-message by using the class ayb_notfound.

Chan­ge­log

0.7.1

  • fix: due an issue with the gettext-function in PHP/Apache some ser­ver will out­put an warning/error-message. because of that error, the trans­la­ti­ons of the plu­gin will not lon­ger work, but the plu­gin will.

0.7

  • anniversary-mode
  • range-parameter
  • Timezone-support
  • Bug­fi­xes

0.6.1

  • Bug­fix for side­bars not named „sidebar”

0.6

  • Widget-function added
  • Loca­liza­tion

0.5.3

  • XHTML-Bugfix (unne­cessary span)
  • Bug­fix PHP 5 Error with empty function-parameter

0.5.2

  • Bug­fix for more tole­rant date-values (e.g. day > 364). Thanks to Alo­haDan for hin­ting and testing.

0.5.1

  • Adjust­ment for MySQL-versions older than MySQL 4.1.1

0.5

  • First public beta

Down­load

a-year-before.zip (Ver­sion 0.7.1)

204 Kommentare

  1. hallo ralf,

    danke für das plugin.

    1. wäre es mög­lich, dein plu­gin so zu nut­zen (ein­zu­stel­len), dass bei­spiels­weise alle arti­kel des aktu­el­len monats vor einem jahr gelis­tet wer­den?
    2. ich würde das ergeb­nis hin­ter dem aus­ga­be­da­tum gern auf eine neue zeile brin­gen.
    bei­spiel:
    nicht so — 14.02.2011 Keine Bei­träge an die­sem Tag.
    son­dern so — 14.02.2011
    Keine Bei­träge an die­sem Tag.
    wo muss ich das br-tag set­zen?
    3. um das wig­det optisch ein wenig auf­zu­peppe, würde ich gern unter der widget-überschrift eine kleine gra­fik ein­fü­gen.
    wo genau in der ayb_posts.php muss ich das img-tag einfügen?

  2. Hi, ich habe ein Pro­blem mit der Dar­stel­lung:
    Ich nutze den PHP-Bereich. Dann möchte ich einer­seits das Datum unter­drü­cken — was lei­der nicht so funzt wie gewünscht und zum ande­ren hätte ich den Wunsch ent­we­der Excerpt oder den gan­zen Arti­kel anzu­zei­gen.
    Wie bringe ich es da rein? Kannst Du bitte kurz hel­fen?
    Danke

  3. Ich habe ein Pro­blem mit der Darstellung!

    Und zwar möchte ich, das die Arti­kel ohne Auf­zäh­lungs­zei­chen oder Nume­rie­rung ange­zeigt werden.

    Ändere ich die ayb_posts.php daher ent­spre­chend in Zeile 156 von in habe ich plötz­lich statt der deut­schen Aus­gabe ›Am … Lies‹ die eng­li­sche ›On … Read‹.

    Und dann bin ich auch irgend­wie zu begriffs­stut­zig, um das excerpt ein­zu­bin­den! Wie muss da ein ent­spre­chen­der Befehl lauten?

  4. Ich mag die­ses Plu­gin. Es ist fast genau das, was ich brau­che. Aller­dings würde Ich mag, um es Liste Bei­träge in nur eine Kate­go­rie. Ich habe ver­sucht, den Code in das Plu­gin zu ändern, aber es hat nicht funk­tio­niert. Könn­ten Sie die­sen Para­me­ter, um das Plu­gin hin­zu­ge­fügt wer­den? Ich bin mit dem PHP-Code, nicht das Widget.

  5. Hmpf. Dann halt ohne Klam­mern ;)

    Damit:
    php if (function_exists(„ayb_posts”)) {
    php ayb_posts();
    php }

  6. Hmmm. Das letzte Update ist mei­nem Blog nicht gut bekom­men. Den zwei­ten Bei­trag zeigt er an, denn ers­ten nicht!?

    Warning: Mis­sing argu­ment 1 for ayb_posts(), cal­led in /home/www/web1/html/hisky.de/wp-content/themes/i3theme-1–7-classic/sidebar-left.php on line 12 and defined in /home/www/web1/html/hisky.de/wp-content/plugins/a-year-before/ayb_posts.php on line 372

    Am 11.10.2010: Lies Wenn in so man­chem Hirn ein Licht auf­geht wirds gefähr­lich… (11.10.2010)

  7. Es sieht so aus, als ob die Aus­wahl der Arti­kel im Anniversary-Modus Zeitzonen-korrekt ist, aber die Anzeige des Datums (sofern man den Tag anzei­gen lässt) nicht. Bei­spiel: Ein Arti­kel vom 4.10.XX, 0:37, wird am 4.10. kor­rekt aus­ge­wählt, ange­zeigt wird aber das Datum 3.10.XX.

  8. Pingback: » Ältere Artikel in der Sidebar anzeigen [WordPress Plugin] web-newspaper

  9. I really like this plu­gin. It is almost exactly what I need. Howe­ver, I would like to have it list posts from only one cate­gory instead of all of them. I tried to change the code wit­hin the plu­gin, but it didn’t work. Is there a chance this could be added to the para­me­ters? I am using the php code, not the widget.

    I am try­ing to do a „this day in history” post list on my home page that shows any posts from the cur­rent day for a spe­ci­fic cate­gory. Help?

  10. Hi Ralf,
    hab Dein Plu­gin aktua­li­siert und die Mus­ter ›%date%: %title% (%link%) ‹ ver­wen­det — aller­dings ist dann das, was ange­zeigt wird, nicht mehr als Link klick­bar? Hab ich was vergessen?

  11. Ich hab mir gerade die Lösung gebastelt.

    Soll ich dir das mailen?

  12. Besteht eigent­lich auch die Mög­lich­keit, einen Aus­zug der Arti­kel mit anzu­zei­gen? Bräuch­ten ja ›nur‹ die ers­ten 10 Wör­ter sein!

  13. Pingback: Wordpress Plugins | Angelslayers Rumpelkammer

  14. Pingback: Wordpress Community - WP Gemeinschaft | Blog | WordPress-Plugin: A Year Before » Beiträge, Plugin, Jahr, Version, Beitrag, Datum » Würzblog

  15. Pingback: Welche Plugins installieren? « web log buch

  16. Pingback: WordPress-Plugins - Ein Blick hinter die Kulissen | Nilas Blog

  17. Pingback: Januar 2010: Eine Übersicht der benutzten Plugins auf meinem Blog // hombertho.de

  18. Hey, sehr schö­nes Plugin.

    Sag mal, gibts die mög­lich­keit die „Pages” (Also die erstell­ten Sei­ten) aus der Auf­lis­tung zu ent­fer­nen?
    Ich möchte nur die gepos­te­ten Arti­kel im Blog ange­zeigt bekommen.

    • Ich habe ges­tern auf Word­Press 3.1.3 aktua­li­siert, und nun zeigt er für vor einem Monat mehr­fach die Begriffe ›Recent Posts‹ und Slide®-x (x steht für eine fort­lau­fende Zahl) an.

      Wo könnte der Feh­ler liegen?

  19. Pingback: Wegilinks: Zeitmanagement für Trailer | Just WeGi

  20. Pingback: Unter der Motorhaube #6 » F!XMBR

  21. Pingback: Unter der Motorhaube #5 » F!XMBR

  22. Pingback: Heute vor einem Jahr | _n1Ls_

  23. Pingback: » Plugins auf Web-Newspaper web-newspaper

  24. Ich kann das bestä­ti­gen, Ralf, es funk­tio­niert pro­blem­los auf der 2.9.1er Ver­sion! Bes­ten Dank für die Mühe und für das Plugin!

    Gruss
    Ivo

  25. @ivo: Stimmt, das Chan­ge­log gibt es nur hier: http://wordpress.org/extend/pl.….changelog/

    Ich habe das Wuerz­blog heute aus 2.9.1 „geup­dated”, wie erwar­tet scheint das Plu­gin zu funk­tio­nie­ren. :-)
    Eine neue AYB-Version kommt bald …

  26. Hallo!

    Ich bin über meine WP-Plugin Seite zu dir gestos­sen und sehe, dass es kei­nen Chan­ge­log für die aktu­elle 0.7.2 Ver­sion gibt.

    Da ich WP 2.9.1 instal­liert habe, würde es mich freuen zu wis­sen, ob es da Pro­bleme gibt.

    Bes­ten Dank für einen kur­zen Feedback

  27. Dem Wunsch würde ich mich auch mit etwas Ver­spä­tung anschlie­ßen wollen

  28. @ #161 Day­Light: Ja, das bräuchte ich auch, bitte!

  29. Hey Ralf, kannst du mal ein a-year-ago-2 plu­gin ent­wer­fen? Also das glei­che Plu­gin das ein­fach nur unter ande­rem Namen läuft?
    Würde gerne noch eine zweite Rubrik bei mir im Blog ein­stel­len: 2 years ago
    Das geht aber net so ein­fach :-D

  30. Pingback: CSS-Geschmack, Typografie und Neue Plugins – Spontis Weblog

  31. Pingback: Posts from years before | Eric Cheng’s Journal

  32. You don’t need to post my pre­vious com­ment I just wan­ted to let you know the issue. I fixed the issue by run­ning a query to set all publis­hed post_date_gmt that were ›0000–00-00 00:00:00′  to the post_date.

  33. I am using ver­sion 0.7.2 of „A Year Before” and love it. It is a great and use­ful plu­gin. There was one issue I came across. It deals with posts that I impor­ted from blog­ger. It seems that their post_date_gmt was strip­ped and was set to „0000–00-00 00:00:00″ This cau­ses the post to be found but to show up as 31 Decem­ber 1969. Just wan­ted to let you know because it could be easily fixed by che­cking for that and using post_date instead. Thanks again for all your hard work on this plugin!

  34. Ja, der Bug­fix ist dir gewid­met. ;-)

  35. @Rechts­lupe: Ok, kann ich machen. Die neue Ver­sion steht auch schon halb in den Start­lö­chern, aber der Bug­fix war jetzt dringender.

  36. Hallo,

    danke für das nette Plu­gin. Wir haben es inzwi­schen auf meh­re­ren Blogs lau­fen und es ist immer wie­der erstaun­lich, was dabei an alten Bei­träge zutage kommt.

    Eine kleine Bitte wäre da jedoch für die nächste Ver­sion: Es wäre schön, wenn die Links noch mit einem title-Tag ver­se­hen würden.

    Ist nur eine Ände­rung in Zeile 169:
    echo $before.$pdate.‹<a href=„›.$plink.‹” class=„ayb_link” title=„›.$ptitle.‹”>‹.$ptitle.‹</a>‹.$after.”\r”;

  37. Hi Ralf,

    nur keine Eile! Ich denke (hoffe!), dass hier jeder ver­steht, dass deine Frei­zeit kost­bar und knapp ist, das kennt sicher jeder. :)
    Abge­se­hen davon, bei mir dau­ert es eh noch ein paar Monate, bis das erste Jahr voll ist, also von mei­ner Seite her gaaar kein Streß. ;)

    Liebe Grüße, Manuel

  38. Ich muss euch noch etwas ver­trös­ten, mein Job braucht gerade mal all meine Zeit. Ich hoffe nächste Woche komme ich dazu. Viel­leicht auch schon am Wochen­ende. Sorry.

Hinterlasse eine Antwort

Pflichtfelder sind mit * markiert.

*