Possible to display an "album updated" indicator?

Are there existing functions that would allow me to add a graphic indicator for albums that are newly-added or recently-updated?

Comments

  • acrylian Administrator, Developer
    There are only functions availabe to show them separate with the image_album_statistics plugin but none to indicate them within the normal albums loop. Maybe that will do the trick?

    Depending on your knowledge you could write something yourself by checking the id or the date for newly added ones. You may be able to adapt parts of the code for the latestupdated albums around 159-174 of that plugin to write a custom function to indicate them.
  • This actually turned out to be pretty straight forward, though I am no programmer and I am POSITIVE that there is a better way to do this.

    That being said, I simply did some math against the current date and the return from the getAlbumDate() function, using the Unix epoch format to make it simple. I chose to display a "NEW!" tag for any album updated in the last week, which comes to 604800 seconds. So, I inserted the php below into the album.php file.

    <?php
    if ((date(U) - getAlbumDate("%s")) < 604800){
    echo "NEW!";
    }
    ?>
  • Thanks, I was just starting to search for this solution when I spotted it. I think showing a "New!" button or text communicates much better to users than a long date string.
Sign In or Register to comment.