Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
[plugin] [ORPHAN] rss_posted
Based on an idea from one of my favorite textpatterners I put together an alternative to the standard <code><txp:posted/></code> tag. The major addition is that each part of the date (year, month and day) will be hyperlinked.
This can be used to link to an archive or other page that supports filtering by date. Coincidentally, this can be done using the latest version (0.14) of the rss_suparchive and you can see this in use on the posted dates on my site.
Given an example date of March 28, 2005, 3 hyperlinks will be created:
- 2005 will be hyperlinked to /section/2005
- March will be hyperlinked to /section/2005/03
- 28 will be hyperlinked to /section/2005/03/28
Offline
Re: [plugin] [ORPHAN] rss_posted
works beautifully. thanks Rob :)
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: [plugin] [ORPHAN] rss_posted
quick question RE this plug-in and your suparchive_menu… how do I make my archives page ‘data aware’? At present it returns nothing but an empty html and body tag when I try to browse it using http://nathanpitman.com/archives/2005/04 for example.
:)
Cheers.
Offline
Re: [plugin] [ORPHAN] rss_posted
There is nothing special you should have to do. The filtering happens automatically based on your URL. What version of the plugin and Textpattern are you using?
Offline
Re: [plugin] [ORPHAN] rss_posted
TXP latest build, downloaded this AM (RC3).
rss_suparchive, 0.14
:)
Offline
Re: [plugin] [ORPHAN] rss_posted
Could anyone please give some styling advice for this plugin? Thank you! :)
Offline
Re: [plugin] [ORPHAN] rss_posted
My friend Lexxus has made a bugfix (with 1-9 days) and added a support for different languages (here you can see a Russian version, used on cpr.wandy.ru):
function rss_posted($atts) {
global $thisarticle;
extract($atts);
$monthformat = isset($monthformat) ? $monthformat : “n”;
$dateformat = isset($dateformat) ? $dateformat : “j”;
$yearformat = isset($yearformat) ? $yearformat : “Y”;
$formatmode = isset($formatmode) ? $formatmode : “DATE”;
$sep1 = isset($sep1) ? $sep1 : “ “;
$sep2 = isset($sep2) ? $sep2 : “, “;
$linktosection = isset($linktosection) ? $linktosection.”/” : “”;
$order = isset($order) ? $order : “M,D,Y”;
$linkDateFormat = ‘d’;
$linkMonthFormat = ‘m’;
$linkYearFormat = ‘Y’;
$pdate = $thisarticle[“posted”];
$darr = array(
‘pdate’ => $pdate,
‘linktosection’ => $linktosection,
‘monthformat’ => $monthformat,
‘dateformat’ => $dateformat,
‘yearformat’ => $yearformat,
‘linkMonthFormat’ => $linkMonthFormat,
‘linkDateFormat’ => $linkDateFormat,
‘linkYearFormat’ => $linkYearFormat
);
$sarr = array($sep1,$sep2);
return implode(‘’, $ddate);
}
function rss_fmt ($darr, $type) {
$rus_month = array (’ ‘, ‘января’, ‘февраля’, ‘марта’, ‘апреля’, ‘мая’, ‘июня’, ‘июля’, ‘августа’, ‘сентября’, ‘октября’, ‘ноября’, ‘декабря’);
extract($darr);
switch ($type) { case “M”: return href($rus_month[date($monthformat, $pdate)], hu.$linktosection.date($linkYearFormat, $pdate).”/”.date($linkMonthFormat, $pdate)); break; case “D”: return href(date($dateformat, $pdate), hu.$linktosection.date($linkYearFormat, $pdate).”/”.date($linkMonthFormat, $pdate).”/”.date($linkDateFormat, $pdate)); break; case “Y”: return href(date($yearformat, $pdate), hu.$linktosection.date($linkYearFormat, $pdate)); break; default: return; }}
There are 10 types of people in the world – those who understand binary and those who don’t.
Offline
Re: [plugin] [ORPHAN] rss_posted
wilshire wrote:
Based on an idea from one of my favorite textpatterners I put together an alternative to the standard <code><txp:posted/></code> tag. The major addition is that each part of the date (year, month and day) will be hyperlinked.
Any chance or an option to have the output of the tag be runned thorugh htmlentities. A textpattern site is in UTF8 and in Denmark some of the months name are using HTML entities, so I like to enscape the month names before outputting them.
so a htmlentities=“1” option would be super nice!
Offline
Pages: 1