pubDateFix (publication date / last-modified date) - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: pubDateFix (publication date / last-modified date) (/showthread.php?tid=1853) |
pubDateFix (publication date / last-modified date) - Carlos - 2011-06-16 [Update: Now available for download in Extend] This plugin changes the behaviour of GetSimple's page date field (pubDate), making it fixed, working like a real publication date (it will not change when you edit and save a page again). You can also edit the date under page Options. (Very basic editor, no date picker and it doesn't warn if date entered is invalid, e.g. "2010-09-31", or "aaaa" -- it would save it as the current time.) This plugin also adds a new field, lastUpdate, that works like GS's default pubDate (last saved/modified). You can display it with function get_page_lastupdate(), that works like GS's get_page_date() pubDateFix (publication date / last-modified date) - mvlcek - 2011-06-16 Carlos Wrote:This plugin changes the behaviour of GetSimple's page date field (pubDate), making it fixed, working like a real publication date (it will not change when you edit and save a page again). Nice functionality, but I'm not sure if changing the meaning of a field is the best way to do it. The I18N Custom Fields plugin does it the other way: it leaves the pubDate as is and automatically adds a new field creDate with the creation date. Also the I18N search plugin allows sorting by pubDate and creDate (if it exists). pubDateFix (publication date / last-modified date) - Carlos - 2011-06-17 I see your point, but I don't agree that it's changing the meaning of the field. "pubDate" is widely used (RSS, etc.) as a posted/publication date, not as a last saved one. And get_page_date()'s meaning is generic. However it's true that it's changing the expected behaviour for both for those who know GetSimple. Before developing this plugin, I had experimented making a similar (easier) one, that I have not released: PublicDate. The editable field was publicDate, to be called by function get_page_publicdate(). However, I thought it could be more interesting to be able to directly use the -let's call it- publication date with GS's own get_page_date(). Also, I liked seeing the publication date instead of the last-modified one in the Page Management list, without having to patch /admin/pages.php Another advantage was that pubDate is indexed automatically by Mike's PagesXML plugin and future GS 3.1, useful for doing things like my dirty would-be plugin "Recent Pages". Thanks a lot for your opinion. (What about others...?) I may try to do something similar using creDate (I knew about that)... Though perhaps the best would be that GetSimple's core had a creation/publication date (like creDate -- no need to be editable, that can be done with plugins). pubDateFix (publication date / last-modified date) - kinata - 2012-06-05 Simple and good plugin, thanks pubDateFix (publication date / last-modified date) - islander - 2012-10-29 Would you mind providing an example of what would be placed in the template? Apparently my brain is not working today :/ Something like: Code: <p>Updated on: <?php get_page_lastupdate($dateformat); ?> </p> pubDateFix (publication date / last-modified date) - Carlos - 2012-10-29 Replace $dateformat by a string using the same format as GS's get_page_date(), e.g.: Code: <?php get_page_lastupdate('Y-m-d'); ?> Code: <?php get_page_lastupdate('F jS, Y - g:i A'); ?> pubDateFix (publication date / last-modified date) - islander - 2012-10-29 Gracias Carlos, I new my brain wasnt working right. Is it possible to have both a published date and an updated date, or does this replace the published date? pubDateFix (publication date / last-modified date) - Carlos - 2012-10-29 This plugin adds a new field, lastUpdate, that works like GS's pubDate did without the plugin (its value is changed everytime you re-save the page). Use get_page_date() to echo the publication/post/public date, and get_page_lastupdate() to echo the last saved/updated date. pubDateFix (publication date / last-modified date) - islander - 2012-10-29 This doesn't seem to be working properly for me. I have in the template now: Code: <p>Published on <time datetime="<?php get_page_date('Y-m-d'); ?>" pubdate><?php get_page_date('F jS, Y'); ?></time><br> In "data/pages/index.xml" I can see: Code: <pubDate>Wed, 02 Sep 2009 03:35:00 +0200</pubDate><lastUpdate>Sun, 28 Oct 2012 20:50:41 +0100</lastUpdate> But on the page its self it only displays pubDate for both areas. pubDateFix (publication date / last-modified date) - Carlos - 2012-10-29 Ah yes. Will fix it, thanks for reporting. [update] Edit pubdatefix.php line 51, change Code: if (isset($data_edit->lastUpdate)) { Code: if (isset($data_index->lastUpdate)) { pubDateFix (publication date / last-modified date) - islander - 2012-10-29 Thanks for the update, all is working properly now. pubDateFix (publication date / last-modified date) - Carlos - 2012-10-29 PubDate Fix, version 0.2:
RE: pubDateFix (publication date / last-modified date) - Carlos - 2015-03-20 PubDate Fix, version 0.3:
|