FamilyCorner
11-12-2005, 01:50 AM
I'm not sure if anyone here can help me or not, but I have a Post The Most contest running and it was fine before I upgraded to 3.5.1 today. It's probably just a matter of updating something in this code, but I'm afraid I am not sure what that would be Can someone maybe give me some insight?
This calls the usernames and their post counts for a specific date range. Here's the code that is placed at the top of the page, just below the body tag:
<?php
$date1 = "UNIX_TIMESTAMP(\"2005-11-10\")";
$date2 = "UNIX_TIMESTAMP(\"2005-11-11\")";
$users = $DB_site->query(
"SELECT post.userid, count(post.userid) as count, user.username from " .
"post, user WHERE post.dateline >= $date1 and post.dateline <= $date2 " .
"and post.userid = user.userid and user.username <> 'Dawn' group ".
"by post.userid order by count DESC");
$admin = $DB_site->query(
"SELECT post.userid, count(post.userid) as count, user.username from " .
"post, user WHERE post.dateline >= $date1 and post.dateline <= $date2 " .
"and post.userid = user.userid and user.username = 'Dawn' group ".
"by post.userid order by count DESC");
?>
And this is the code that is placed whereever you want the actual post counts to display within the same page:
<?php
while ($user = $DB_site->fetch_array($users))
{
$username = $user["username"];
echo ("$username<br>");
}
echo ("<br>");
while ($user = $DB_site->fetch_array($admin))
{
$username = $user["username"];
echo ("$username<br>");
}
?>
<br>
</font>
</td>
<td align="center">
<FONT face="verdana,verdana" size="2">
<br>
<?php
$DB_site->data_seek(0,$users);
while ($user = $DB_site->fetch_array($users))
{
$count = $user["count"];
echo ("$count<br>");
}
echo ("<br>");
$DB_site->data_seek(0,$admin);
while ($user = $DB_site->fetch_array($admin))
{
$count = $user["count"];
echo ("$count<br>");
}
?>
This is at the top of the page, before the HTML tag:
<?php require("global.php3"); ?>
This calls the usernames and their post counts for a specific date range. Here's the code that is placed at the top of the page, just below the body tag:
<?php
$date1 = "UNIX_TIMESTAMP(\"2005-11-10\")";
$date2 = "UNIX_TIMESTAMP(\"2005-11-11\")";
$users = $DB_site->query(
"SELECT post.userid, count(post.userid) as count, user.username from " .
"post, user WHERE post.dateline >= $date1 and post.dateline <= $date2 " .
"and post.userid = user.userid and user.username <> 'Dawn' group ".
"by post.userid order by count DESC");
$admin = $DB_site->query(
"SELECT post.userid, count(post.userid) as count, user.username from " .
"post, user WHERE post.dateline >= $date1 and post.dateline <= $date2 " .
"and post.userid = user.userid and user.username = 'Dawn' group ".
"by post.userid order by count DESC");
?>
And this is the code that is placed whereever you want the actual post counts to display within the same page:
<?php
while ($user = $DB_site->fetch_array($users))
{
$username = $user["username"];
echo ("$username<br>");
}
echo ("<br>");
while ($user = $DB_site->fetch_array($admin))
{
$username = $user["username"];
echo ("$username<br>");
}
?>
<br>
</font>
</td>
<td align="center">
<FONT face="verdana,verdana" size="2">
<br>
<?php
$DB_site->data_seek(0,$users);
while ($user = $DB_site->fetch_array($users))
{
$count = $user["count"];
echo ("$count<br>");
}
echo ("<br>");
$DB_site->data_seek(0,$admin);
while ($user = $DB_site->fetch_array($admin))
{
$count = $user["count"];
echo ("$count<br>");
}
?>
This is at the top of the page, before the HTML tag:
<?php require("global.php3"); ?>