How can I easily check on my zenphoto site if a new picture has been added?
I don't know what the official term for something like this is (that's why I'm not finding $#@! on google and need your help).
Ideal case I would like www.mysite.com/newpic.php to return either a number (# of pictures on the site), or a timestamp of latest picture added, or a hash value. I don't mind. But not a full page and preferably also not a RSS feed, it's for a mobile purpose.
Is there anything in zenphoto or out there as extension? Otherwise I'd have to do it myself...
thanks!
Comments
- Use the functions the image_album_statistics plugin provides to show latest images.
- Use the Zenpage CMS plugin with a supporting theme and its CombiNews mode to show images within the news section
Also there is of course RSS available.
If that all is easy depends on your knowledge of webtechniques. In any case it is recommended to get familiar with how Zenphoto themes work by reading the theming tutorial.
I might end up using PHP to md5 the latest image, not a bad idea.
There is also a flag_thumbnail that can flag (!) thumbs to mark them visually as new within albums. You can even set the date range something is considered new.
This php code, named "count_pictures.php" will display nothing but number of images registered in zenphoto. It is was I needed. (The output is less than 64 bytes)
`
<?php
$link = mysql_connect('localhost',....);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db(...)) {
die('Could not select database: ' . mysql_error());
}
$result = mysql_query("SELECT count(*) FROM <code>zp_images");
if (!$result) {
die('Could not query:' . mysql_error());
}
echo mysql_result($result, 0);
mysql_close($link);
?>
`
`$count = $_zp_gallery->getNumImages(0)`
http://www.zenphoto.org/documentation/classes/Gallery.html#methodgetNumImages
What list of includes are necessary, how would a standalone .php look like?