Hello everyone,
I am looking for a way to include the date that a page was first created on the page. I have already found the magic word {{REVISIONTIMESTAMP}} and the other related magic words. Are there equivalent magic words that return the timestamp for the first revision of a page? If not, is there a way to add this information through an existing extension?
Thanks and kind regards, Jan-Paul
Jan-Paul wrote:
Hello everyone,
I am looking for a way to include the date that a page was first created on the page. I have already found the magic word {{REVISIONTIMESTAMP}} and the other related magic words. Are there equivalent magic words that return the timestamp for the first revision of a page? If not, is there a way to add this information through an existing extension?
Thanks and kind regards, Jan-Paul
You could subst REVISIONTIMESTAMP on the first edit or otherwise add it with some hook on page creation. Adding it on created pages is harder. Mediawiki doesn't have any notion of the "first edit" of a page, you'd need to query all the revisions to get the oldest, which is not too efficient.
Adding it on created pages is harder. Mediawiki doesn't have any notion of the "first edit" of a page, you'd need to query all the revisions to get the oldest, which is not too efficient.
Yeah, but I think it could be doable. The time of first edit for an article doesn't really change much, so it could be memcached (would need to account for when a page is moved, or a revision deleted).
Also, the revision table is indexed on the rev_page and rev_id columns respectively, so a query like this shouldn't be too bad:
$dbr =& wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'revision', 'rev_timestamp', array( 'rev_page' => $page_id ), __METHOD__, array( 'ORDER BY' => 'rev_id ASC' ) ); if ($row) { doWhatever($row->rev_timestamp); }
-- Jim R. Wilson (jimbojw)
On Wed, Jul 30, 2008 at 8:30 AM, Platonides Platonides@gmail.com wrote:
Jan-Paul wrote:
Hello everyone,
I am looking for a way to include the date that a page was first created on the page. I have already found the magic word {{REVISIONTIMESTAMP}} and the other related magic words. Are there equivalent magic words that return the timestamp for the first revision of a page? If not, is there a way to add this information through an existing extension?
Thanks and kind regards, Jan-Paul
You could subst REVISIONTIMESTAMP on the first edit or otherwise add it with some hook on page creation. Adding it on created pages is harder. Mediawiki doesn't have any notion of the "first edit" of a page, you'd need to query all the revisions to get the oldest, which is not too efficient.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org