Location: PHPKode > projects > Content*Builder > modules/article/rating.inc
<?
        /* vim: set expandtab tabstop=4 shiftwidth=4: */
        // +----------------------------------------------------------------------+
        // | Netbuilder 2.0beta - rating-include                                  |
        // +----------------------------------------------------------------------+
        // | Copyright (c) 2001, Stefan Ernst                                     |
        // +----------------------------------------------------------------------+
        // | Author: Stefan Ernst <hide@address.com>                      |
        // +----------------------------------------------------------------------+
        //

foreach($HTTP_POST_VARS as $k => $value) {
                ${$k} = $value;
}

        require("../libraries/rating.class.php");
$rating = new Rating;
        if(isset($submit)) {
                $rating->rate($id,$votescore);
        }
$rate = $rating->getScores($id);

?>
<form action="<? echo $PHP_SELF; ?>" method="POST">
<table width="500" align="center" border="0" cellpadding="1" cellspacing="0">
<tr>
        <td bgcolor="#000000">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
        <tr>
                <td bgcolor="#FFFFFF" class="row" width="50%">
                &nbsp;Votes: <? echo $rate[0];
                ?>, Average rating: <?
                echo substr($rate[1],0,5);
                ?>
                </td>
                <td bgcolor="white" width="50%" align="right">
                        <select name="votescore" style="font-size: 11px; font-family: Verdana;">
                        <?
                                for ($i=1; $i<=10; $i++) {
                                        print ("<option value=$i>$i");
                        }
                        ?>
                        </select>
                        <input type="hidden" value="<? echo $id; ?>" name="id">
                        <input type="submit" name="submit" value="Rate!" style="font-size: 11px; font-family: Verdana;" />
                </td>
        </tr>
        </table>
        </td>
</tr>
</table>
        </form>
Return current item: Content*Builder