[pmwiki-users] RFC: An improved (:attachlist:) - (:filelist:)

The Editor editor at fast.st
Fri Mar 24 07:25:14 CST 2006


Neil,

Here is some information Hans was helping me with that explains how to
set various page variables such as the file creation date, or file
last modified date, and use them in a page.  It works pretty easy. 
The reference to php.net gives even more info.  It only answers one or
your question, but it's probably a similar method to do file size. 
(Thanks again Hans!)

Cheers,
Caveman


Thursday, March 23, 2006, 8:46:34 PM, The Editor wrote:
> What variable should I replace $LastModified with to get Date not Date/Time
> And is there a page created date?  It looks great already!

you need to use page variables. look at blogsimple.php script for some
date variables i use in the blog. look at the recent posting with Neil
where he wanted a time.

If you want a different format change it inside the strftime function,
see http://uk.php.net/strftime

time() retruns current server system time.
$page["ctime"] returns page creation time.
$page["time"] return page last modified time.

Best,
 Hans

	
The Editor to Hans
I looked at the documentation and guess I got close, but no cigar.  I tried this

$FmtPV['$LastDateModified'] = 'strftime("%Y-%m-%d", $LastModified )';

Problem is, it gave me 1969-12-31 as the date for every entry!  It was
a good stab at it!

Cheers,
Caveman


On 3/23/06, Hans <design at softflow.co.uk> wrote:

try

## add pagevariable {$LastDateModified}
$FmtPV['$LastDateModified'] = 'strftime("%Y-%m-%d", $page["time"] )';



On 3/23/06, Neil Herber <nospam at eton.ca> wrote:
> At 2006-03-24  12:25 AM +0100, christian.ridderstrom at gmail.com is
> rumored to have said:

> Something that would be even *more* useful on my wikis is
> "AttachVerbose:" that would at least show the size of the attached
> file. I have a series of PDFs that range in size from  96,000 bytes
> to 17,829,000 bytes and there is no way to warn potential downloaders
> that they have picked a big one.
>
> Even if I could have some other markup (FileSize:??) then I could do this:
>
> Attach:How The Heck Big Can Files Get.pdf  (FileSize:How The Heck Big
> Can Files Get.pdf)
>
> Any takers on giving me the PHP needed??
>
> A much lower priority, but a nice-to-have would be the file date.
> (FileInfo:???)
>
>
> Neil
>




More information about the pmwiki-users mailing list