Not signed in (Sign In)

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

    • CommentAuthorthebluebus
    • CommentTimeJun 18th 2008
     
    This isn?t strictly a plogger issue, but I?m hoping someone can help me out. I?m currently using the star rating system discussed in this thread:

    http://plogger.org/forum/discussion/1208/rating-system/#Item_10

    It works well but what this script really needs is a 'top 10 rated images' bit. I?ve been playing around with some mysql and php but I?m a bit out of my depth as I?m trying to teach myself. So far I?ve managed to create this:

    http://www.scenemeup.com/test.php

    it pulls in the picture ID and the average rating out of ten next to it. I need to somehow convert this to actually show the images, or even better show the thumbnails associated with the images, linked to the main one. Can anyone help me out a bit with where to go next? This is the code I?ve got so far.

    ----------------------------------------
    <?php
    $host=" ";
    $username=" ";
    $password=" ";
    $database=" ";
    $imagepath="http://www.scenemeup.com/index.php?level=picture&id=";

    //Database Connection
    $connection = mysql_connect($host, $username, $password);
    $db = mysql_select_db($database);

    $query = "SELECT * FROM rating ORDER BY average DESC LIMIT 30";

    $result = mysql_query($query) or die(mysql_error());
    while($row = mysql_fetch_array($result)){
    echo $imagepath, $row['id']. " - ". $row['average'];
    echo "<br />";
    }
    ?>
    • CommentAuthorthebluebus
    • CommentTimeJun 19th 2008
     
    ok, i've now come up with

    http://www.scenemeup.com/test2.php

    which lists the top rated images, and gives a link. I'm sure theres an easier way to go about doing this......