Node - show last updated by user/date
I know this is possible but how is it done.
By default Story Nodes display at the top of the post 'Submitted by user on date/time'. What I would also like to appear is "Last updated by user on date/time" and "number of updates (revisions)". This to only appear if an update has occurred.
I know I can turn on 'view revisions' which allows users to view revisions and the reasons why revisions were made and this will be activated. I also know that the 'revisions' tab will not display unless there is a revision.
I merely want a simple indicator, displayed at the top of the post, that informs the reader there are in fact revisions and the last being on the 'last update' date. If no revisions, leave it as normal.
How can I get this up and running.
Any help much appreciated.

Any
Any clues?
___________________________
Steven Taylor
Melbourne, Australia.
http://superjacent.net/cms
last updated by user
I was recently looking for a solution for this as well. I got it to work, but I'm pretty sure this is the incorrect place to put the code and/or the incorrect way to do the whole thing. I'm not a php programmer and I would really appreciate if someone would offer their suggestions on how to do this the right way.
I have about this node module http://drupal.org/project/about_this_node enabled and I stole part of the code for it and put it in node.tpl.php.
<?php if ($submitted): ?>
<span class="submitted"><?php print t(' Posted: ') . format_date($node->created, 'custom', "F jS, Y") . " " . t(' by ') . theme('username', $node) . " | "; ?></span>
<span class="submitted"><?php print t(' Modified: ') . format_date($node->changed, 'custom', "F jS, Y") . " " . t(' by ');?></span>
<?php
// Gather last updated author info
$update_author_uid = db_result(db_query('SELECT nr.uid FROM {node_revisions} nr INNER JOIN {node} n ON n.vid = nr.vid WHERE n.nid = %d', $node->nid));
$update_author = '';
$update_author_output = '';
if ($update_author_uid == '0') { // Check if author is anonymous
$update_author_output = variable_get('anonymous', 'Anonymous');
}
else {
$update_author = user_load(array('uid' => $update_author_uid));
$update_author_output = l($update_author->name, 'user/'. $update_author_uid);
}?>
<span class="submitted"><?php print $update_author_output; ?></span>
<?php endif; ?>
override this instead of
override this instead of change the core file, I did this when I was new to Drupal and you do not want to hack the core files...bad bad bad
Drupal 6
Better to do this processing in the _preprocess_node() stage, in your template.php file.
And that uid is already available as 'revision_uid', so there's no need for the query.
<?php
function mytheme_preprocess_node(&$variables) {
// [...]
// Gather last updated author info
$revision_uid = !empty($node->revision_uid) ? $node->revision_uid : 0;
if (!$revision_uid) {
$revision_username = variable_get('anonymous', 'Anonymous');
}
else {
$revision_user = user_load(array('uid' => $revision_uid));
if ($variables['is_admin']) {
$revision_username = l($revision_user->name, 'user/'. $revision_uid);
}
else{
$revision_username = $revision_user->name;
}
}
$variables['revision_username'] = $revision_username;
?>
Then just
<?php print $revision_username; ?>in your .tpl files.