userid; $tag = $retarr->tag; impress("wisdom"); //track($UserID, $REMOTE_ADDR, $REMOTE_HOST, $HTTP_REFERER, $PHP_SELF); ?>
0) $previousR2--;
$numofvotes=$row["Votes"];
$average=$row["Average"];
$newrate = ($average * $numofvotes - $previousvote + $Rate) / ($numofvotes);
mysql_query ("UPDATE stories SET ".$string1." = $previousR, ".$string2." = $previousR2, Average = $newrate WHERE ID = $issue");
}
else
{
$Query = "INSERT INTO logstories VALUES ('$UserID', '$issue', '$Rate', '$date')";
mysql_query ($Query);
$result = mysql_query ("SELECT * FROM stories WHERE ID = $issue");
$row = mysql_fetch_array($result);
$string1 = 'R'.$Rate;
$previousR = $row[$string1];
$previousR++;
$numofvotes=$row["Votes"];
$average=$row["Average"];
$newrate = ($average * $numofvotes + $Rate) / ($numofvotes + 1);
$numofvotes++;
mysql_query ("UPDATE stories SET Average = $newrate, Votes = $numofvotes, ".$string1." = $previousR WHERE ID = $issue");
}
}
if ($action == "submit")
{
print '
| |||||||||||||||
Words of Wisdom / Inspirational Stories In this section, you will find a list of inspirational thoughts, ideas and stories submitted and rated by visitors like you. |
Words of Wisdom |
Title | Rating | # of ratings | Your rating |
'.$row["Storytitle"].''; if ($row["Votes"] < 10) print ''; print ' | '.$row["Average"].' | '.$row["Votes"].' | '.$YourRate.' |
';
if (($prev_page) && ($x_pages > 19)) {
echo "<< Prev";
}
else if($prev_page) {
echo "<< Prev";
}
// Page # direct links
// If you don't want direct links to each page, you should be able to
// safely remove this chunk.
for ($i = 1; $i <= $x_pages; $i++) {
if ($i != $page) {
echo " $i ";
} else {
echo " $i ";
}
}
// Next
if (($page != $x_pages) && ($x_pages > 29)) {
echo " Next >>"; } else if (($page != $x_pages)) { echo "Next >>"; } ?> |