Page 1 of 1
Problems with $staticpage_lastchange
Posted: Wed Jul 04, 2007 5:06 pm
by T
Hi!
I'm have two questions that are somewhat connected to each other, as they're both about the static page plugin.
1) The $staticpage_lastchange variable seems to always display the same date (the creation date) of a SP, regardless of how many times I have edited it after that. I need it to display the last edit-date.
2) Is there a way of letting the Static Page List-plugin show the last N static pages that have been created? Or, for that matter, edited? I don't need the tree-view etc., just a plain list.
Thanks in advance, I'm an avid fan of Serendipity.
Regards,
Re: Problems with $staticpage_lastchange
Posted: Thu Jul 05, 2007 12:23 pm
by garvinhicking
Hi!
1. Indeed, the timestamp is not updated on a change of the page. I've just committed a patch to version 3.51 of the plugin that will fix this:
http://php-blog.cvs.sourceforge.net/php ... 4&r2=1.105
2. That's only possible by patching/editing the staticpage plugin file or creating your own sidebar plugin based on it...did you have a look at the plugin file, it's quite easy to adapt even with little knowledge.
Best regards,
Garvin
Posted: Thu Jul 05, 2007 3:50 pm
by stm999999999
(timestamp)
this problem is not new:
http://board.s9y.org/viewtopic.php?t=70 ... iten+datum
And in these thread it was not clear whether this variable should contain "last changed" or "created at". So, I do not know if it would be better to add a field "last_change" in the sql-table.
Posted: Thu Jul 05, 2007 3:57 pm
by stm999999999
@Garvin: Please cancel this change!
with theses change everey static page shows the actual date of the moment of viewing the page!
Posted: Thu Jul 05, 2007 3:59 pm
by garvinhicking
Hi!
I see. Yes, you're right. I'll revert the change and introduce a new field for it.
Regards,
Garvin
Posted: Thu Jul 05, 2007 4:04 pm
by garvinhicking
Hi!
Committed new version, please check.
Regards,
Garvin
Posted: Thu Jul 05, 2007 8:30 pm
by stm999999999
it seems to work.
But the modified-date is not displayed on the plugin-attached tpl-files.
I would do a change to your code:
Code: Select all
$pagevar . 'lastchange' => $this->get_static('timestamp'),
$pagevar . 'lastmodified' => $this->get_static('last_modified'),
the variable "lastchange" is used in the plugin attached tpl-files. And the name "lastchange" is simillar to "lastchange" - I think everyone using the standard-plugin-tpls or a self-modified one with this variable, they all want to get the date of the last change/modification. So my idea:
Code: Select all
$pagevar . 'created_on' => $this->get_static('timestamp'),
$pagevar . 'lastchange' => $this->get_static('last_modified'),
most people get automatically the intended date of last change, and everyone who really wants to output the day of creation can use $staticpage_created_on, what is self-explanatory
Posted: Fri Jul 06, 2007 11:06 am
by garvinhicking
Hi!
Good suggestion, committed.
Regards,
Garvin