Is there any easily accesible variable that one can access from within a node (being run through PHP parser) that tells when that node was last updated? Or is my only way out to query the database directly?

I've looked and searched in handbooks, forums and API reference, but haven't found anything I could use.

I'm using 4.6.

Comments

JPV’s picture

We can't be the only one who are more interested in the last time a node was updated than when it was created. Ideally there should be options for each note type to display: 1) create date, 2) last edit date or 3) both.

I know if I have access to edit, I can see the edit or track tabs, but how can anonymous or non-privileged users easily see when the last edit was?

Are we missing something easy?

behindthepage’s picture

I want access to all the node variables from within a node. So I will be watching this post to see what I can learn.

As No. Five said "Need input!"

gpdinoz

"If we can see further it is because we stand on the shoulders of giants"

Regards
Geoff

yelvington’s picture


<code>
<?php print_r($node); ?>

behindthepage’s picture

Thanks for your reply yelvington but I all get in the html is

<code>

from this snippet. I even tried global $node; I reckon this should to the trick but I can't get it to work. Any suggestions?

gpdinoz
"If we can see further it is because we stand on the shoulders of giants"

Regards
Geoff

yelvington’s picture

Are you using phptemplate? global $node should be available for any page/component that is a node. If it's not a node, then it won't be.

shouchen’s picture

Hopefully, this will make it into 4.7!

http://drupal.org/node/32036