Problems with $staticpage_lastchange

Creating and modifying plugins.
Post Reply
T
Regular
Posts: 48
Joined: Tue Feb 20, 2007 11:24 pm

Problems with $staticpage_lastchange

Post 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,
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problems with $staticpage_lastchange

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post 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.
Ciao, Stephan
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

@Garvin: Please cancel this change!

with theses change everey static page shows the actual date of the moment of viewing the page!
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I see. Yes, you're right. I'll revert the change and introduce a new field for it.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Committed new version, please check.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post 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
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Good suggestion, committed.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply