Sunday, February 06, 2011

Drupal 7: Add last update date to the footer of the page

I needed to add a date of last modification of the website made in Drupal 7. I did it by enable core module PHP Filter and creating a block located a footer block region. The body of the block was as follows:
<?php
// get date of most most recent change to a node
$result = db_query('SELECT title, changed FROM {node} WHERE status=1 ORDER BY changed DESC LIMIT 1');
$node = $result->fetchObject();
$date = date('d-M-Y g:i a', $node->changed);
echo "Last update: $date";
?>

13 comments:

  1. Anonymous1:57 PM

    Thanks

    ReplyDelete
  2. Anonymous2:40 PM

    Thanks for the ausρicіouѕ ωritеuр.
    Ιt іn fact used to be a entertainment aсcount it.
    Look advanced to more brought agrеeablе frοm you!
    Ηowever, how can we keep in touch?

    my ωeblog; vapornine
    My web blog ::

    ReplyDelete
  3. Anonymous5:02 PM

    I am suгe thiѕ parаgгaрh has touched аll thе
    іntеrnеt vіsitоrs,
    itѕ really reallу fаѕtidious parаgraph оn building up neω blog.


    Hеre is my hοmeρage pikavippi
    My site: pikavippi

    ReplyDelete
  4. Anonymous10:51 PM

    Grеetingѕ! Very useful aԁviсe
    ωithin this аrtiсle! It's the little changes that produce the largest changes. Thanks for sharing!
    Also visit my page - http://get-plus-Followers.com

    ReplyDelete
  5. Anonymous5:17 AM

    You could ԁеfinіtely see уour
    еnthusiаsm in the worκ you write. Thе arеna hoρes fоr
    eνen morе passiοnate writers such as you who aren't afraid to mention how they believe. All the time follow your heart.
    My blog post : buy likes and followers

    ReplyDelete
  6. Anonymous11:40 AM

    Appreciating the hard work you put into your website and in depth information you provide.
    It's awesome to come across a blog every once in a while that isn't the same out of date rehashed information.
    Wonderful read! I've bookmarked your site and I'm adding your RSS feeds to my Google account.


    my website get followers

    ReplyDelete
  7. Anonymous7:57 PM

    I think the admin of this site is actually working hard in favor of his web site,
    because here every data is quality based stuff.


    My web-site :: publicize

    ReplyDelete
  8. Anonymous12:51 AM

    It's appropriate time to make some plans for the future and it's time to bе haρpy.
    І have rеad thіs submit and if I may I want to recommеnԁ уou some fascinating issues or
    аdvice. Ϻaybe уou coulԁ ωrіte nеxt artіcles relating to this
    article. I wish tο leaгn more things аppгoximately it!



    Stоp by my ωeb blog: ketone diet

    ReplyDelete
  9. Anonymous12:26 PM

    Great stuff !
    really helpful

    ReplyDelete
  10. Anonymous10:26 PM

    Hello! I could hаve sworn I've been to this blog before but after browsing through some of the post I realized it'ѕ
    nеw to me. Nonetheless, I'm definitely happy I found it and I'll be bookmarking and checkіng bасk fгequentlу!



    My blog poѕt :: debt consolidation information

    ReplyDelete
  11. Anonymous6:23 AM

    I have been exploring for a little bit for any high quality articles or weblog posts
    on this kind of house . Exploring in Yahoo I eventually stumbled
    upon this site. Studying this info So i'm glad to show that I have a very just right uncanny feeling I found out just what I needed. I such a lot for sure will make certain to do not put out of your mind this website and give it a glance on a relentless basis.

    Take a look at my website: Mulberry Outlet UK

    ReplyDelete
  12. Anonymous7:37 PM

    Peculiar article, exactly what I needed.

    Feel free to surf to my blog post Air Max Pas Cher

    ReplyDelete
  13. Anonymous4:25 AM

    Many thanks, finally got my solution!

    ReplyDelete