Log in

View Full Version : Help with blank page on Post the Most code


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"); ?>

Marco van Herwaarden
11-12-2005, 05:47 AM
Please take a look in our vB3.5 HOW-TO forum to see what changes you will have to make to a script to make it work on vB3.5

FamilyCorner
11-13-2005, 07:09 PM
Please take a look in our vB3.5 HOW-TO forum to see what changes you will have to make to a script to make it work on vB3.5

Thank you :) Would you be willing to point me to the proper forum/thread? Is this the right forum here? https://vborg.vbsupport.ru/forumdisplay.php?f=110 And if so, I'm afraid I don't know which thread to start in :(

Marco van Herwaarden
11-13-2005, 07:51 PM
Yes that is correct. You could start with: https://vborg.vbsupport.ru/showthread.php?t=92995

FamilyCorner
11-13-2005, 07:59 PM
Yes that is correct. You could start with: https://vborg.vbsupport.ru/showthread.php?t=92995

Thank you :) I actually foind this thread https://vborg.vbsupport.ru/showthread.php?t=82632 which helped me get the page to display at least. I changed DB_site to db and that corrected one problem. Now I just can't get the post count to display, but I can't see anything in that thread to adjust for that particular item. Hopefully someone will see it and be able to help.

Thanks!

Marco van Herwaarden
11-13-2005, 08:04 PM
Where are you placing these bits of code?

FamilyCorner
11-13-2005, 08:14 PM
Where are you placing these bits of code?

If you scroll up to post #1 it shows where I have it on the page. If you meant what url, here it is http://www.familycorner.com/forums/contest.php3

:)

There must be some sort of replacement for the word "count" maybe?