[pmwiki-users] Yet another blogging question

Steve Glover steve at fell-services.net
Tue Aug 28 08:12:38 CDT 2007


On Tue, 2007-08-28 at 13:56 +0200, Thomas -Balu- Walter wrote:

> > I'd like to be able to take the date information from each page's name
> > and use it to display a date in a more human readable format within the
> > page - either at the top of each article as part of the header, or as
> > part of a "posted by UserName at..." string at the bottom.
> 
> {(ftime fmt="%d.%m.%Y %H:%M" when="{$Title}")}

That's fantastic, thanks. Once I worked out it was strftime and not date
formatting, I was able to include this in the blog templates for detail
and overview, as well as in the date sidebar:

blosxom news page: http://www.ukfederation.org.uk/news

Balu's blog equivalent: http://test.sdss.ac.uk/content/News 

> This works because the PHP strtotime() function tries to parse the title
> as a date string and it begins with an ISO formatted date. 

Cunning!

> A better way
> would be to use {(substr {$Title} 0 10)}, but that can not (yet?) be
> used as the when parameter.

> It also does not help to assign the substr value to a pagetext variable,
> because they can not be used in the when parameter too.

I did go (briefly) with having a manually-inserted pagetext variable,
but it was taking nearly as long as mucking around with unix timestamps.
Again, thanks.

> > I'd also like to be able to generate two pagelists that could be
> > displayed in a sidebar - one which would list (say) the last 5-10 news
> > items by date and title (with links to the complete story), and another
> > which lists just the year and month names for every month that has an
> > entry.
> 
> If noone else gives a hint I'll have a closer look at that too, but I'm
> a little low on time at the moment.

I've got the first one, and I suspect that if I work out how to hide an
instance of the date when I have more than one items on the same day,
I'll be almost all the way to the second.

Cheers

Steve

-- 
Steve Glover at                          email: steve at fell-services.net
SDSS, EDINA, University of Edinburgh,          tel: +44 (0)131-650 2908
Causewayside House, 160 Causewayside,          fax: +44 (0)131-650 3308
Edinburgh EH9 1PR                          mobile: +44 (0) 7961 446 902




More information about the pmwiki-users mailing list