I want to show the section of MyAlbum in a custom block elsewhere on my site but I'm not sure how to do it.
It's the bit where it says : "There are X photos in our Database". I want that same line to feature in a block on my home page somewhere so that it queries that database for the total number of photos and displays it on the homepage. What HTML would I have to write to achieve that (I do not want to make the module as the starting module for my site)?
Does anyone know how I do that?
Thank you
Ted
The easiest way...
custom block (PHP)
$db =& Database::getInstance();
list( $count ) = $db->fetchRow( $db->query( "SELECT COUNT(*) FROM ".$db->prefix("myalbum_photos")." WHERE status>0" ) ) ;
echo 'number :' . $count ;
Excellent GIJOE, thank you.