Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorpetrence
    • CommentTimeJun 12th 2008
     
    Hello All,

    Can anyone of you here give me a little help, how to let my visitors know the total number of collections, albums and pictures?
    I mean, i'd like to post some information somewhere in the upper body of the index page:

    This site contains A collections, B albums, and C pictures.

    I also want to know, how hard i do, and visitors can feel, this site is taken care well :)
    I'm using the Air Theme with Plogger 3.2.

    I feel some simple PHP script need to paste, what has some query from the mysql database, but i'm not that smart guy to do that.

    Thank you guys for your help:

    pet
    • CommentAuthorpetrence
    • CommentTimeJun 16th 2008 edited
     
    hi guys,

    since no answer came to my post, i wrote this php code to solve my problem. i guess it can be useful for almost all of you, so please feel free to use it. the only todo is to change your username and password, and paste the code into the body of your your index.php.

    <?php
    mysql_connect("localhost", "user", "pass") or die(mysql_error());
    mysql_select_db("data_base") or die(mysql_error());

    $adat1 = mysql_query("SELECT count(id) FROM `plogger_collections`") ;
    $sor1=mysql_fetch_row($adat1);

    $adat2 = mysql_query("SELECT count(id) FROM `plogger_albums`") ;
    $sor2=mysql_fetch_row($adat2);

    $adat3 = mysql_query("SELECT count(id) FROM `plogger_pictures`") ;
    $sor3=mysql_fetch_row($adat3);

    print "<br>The site contains " . '<font size="7">' . $sor1[0] . '</font>' . " collections, " . '<font size="7">' . $sor2[0] . '</font>' . " albums and " . '<font size="7">' . $sor3[0] . '</font>' . " pictures. ";

    ?>

    i hope it will be useful for you!

    pet