getting count of tidypics images into stats on vazco_mainpage

HI on the tidy pics stats page it lists how many albums and images are on the site I was wondering how I would get this onto the stats box in vazco_mainpage I have copied across the php from the stats box on tidypics to the file that displays the stats on vazco but after adding my homepage is completely blank and white out if anyone could help it would be much appreciated or point me in the right direction!

  • DjSupport, if you need help with adding widget itself, there is a tutorial on how to add a widget to vazco_mainpage on Elggdev.com, in plugin's forum. If you have problem with php code being executed, please make sure you turn off cache and check wether the code you use don't need external libraries.

  • @Mike: could you point me to this tutorial? I've searched for it on Elggdev but haven't found it...

  • Mike Caching's already off and not to sure if it need other librarys as Ive just more or less pasted the code in and it doesn't say Require once etc etc in the code that I assume you need for that in fact the whole code in the tidy pics image status is : <?php

    $img_type = get_subtype_id('object', 'image');
    $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
    $total = get_data_row($query);
    $num_images = $total->total;

    $img_type = get_subtype_id('object', 'album');
    $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
    $total = get_data_row($query);
    $num_albums = $total->total;

    $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
    $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');

    $num_views = count_annotations(0, 'object', 'image', 'tp_view');

    if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
    $num_tags = count_annotations(0, 'object', 'image', 'phototag');
    }
    ?>
    <p>
    <br />
    Photos: <?php echo $num_images; ?><br />
    Albums: <?php echo $num_albums; ?><br />
    Comments on photos: <?php echo $num_comments_photos; ?><br />
    Comments on albums: <?php echo $num_comments_albums; ?><br />
    Total views: <?php echo $num_views; ?><br />
    <?php
    if ($num_tags) {
    ?>
    Photo tags: <?php echo $num_tags; ?><br />
    <?php
    }
    ?>
    </p>
    and like iionly where is this tutorial oh and does anyone know how to add extra dashboard widgets?