I run contests on my forums where you get a drawing into the contest for every 10 posts you make during the contest period. I had someone help me coding it, but the problem with it is that it tallies all posts, even if they were made it a forum where a new post doesnt add to your post count. So I have members just posting a lot in the forums where posts dont count and getting their contest post count up, resulting in more contest entries. Could someone help me display the post count of only posts that count towards the user's post count during a specific time period? Here is what I have for my current contest:
I'm new with PHP, so help would be greatly appreciated!
PHP Code:
echo "<table width=\"450\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\">
<tr>
<td><b><u>Username</u></b></td>
<td><b><u>Contest Post</u></b></td>
<td><b><u>Drawing Entries</u></b></td>
</tr>";
$dbQuery = "SELECT a.username, COUNT(b.postid) AS postCount FROM user a, post b WHERE dateline > '1123963200'AND dateline < '1124683140' AND a.userid = b.userid GROUP BY b.userid ORDER BY postCount DESC";
$dbResult = mysql_query($dbQuery) or die(mysql_error() . " " . $dbQuery);
while ($dbRow = mysql_fetch_array($dbResult,MYSQL_ASSOC)) {
echo "<tr>
<td><font face=\"verdana\" size=\"1\">".$dbRow['username']."</td>
<td><font face=\"verdana\" size=\"1\">".$dbRow['postCount']."</td>";
$tickets = $dbRow['postCount']*.1;
$round = floor($tickets);
echo "<td><font face=\"verdana\" size=\"1\">$round</td></tr>";
}
echo "</table><br>
</td>
</tr>
</table>";
Comment