Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2005, 01:50 AM
FamilyCorner FamilyCorner is offline
 
Join Date: Jun 2005
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help with blank page on Post the Most code

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 Code:
<?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 Code:
<?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 Code:
<?php require("global.php3"); ?>
Reply With Quote
  #2  
Old 11-12-2005, 05:47 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 11-13-2005, 07:09 PM
FamilyCorner FamilyCorner is offline
 
Join Date: Jun 2005
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
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
Reply With Quote
  #4  
Old 11-13-2005, 07:51 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes that is correct. You could start with: https://vborg.vbsupport.ru/showthread.php?t=92995
Reply With Quote
  #5  
Old 11-13-2005, 07:59 PM
FamilyCorner FamilyCorner is offline
 
Join Date: Jun 2005
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
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!
Reply With Quote
  #6  
Old 11-13-2005, 08:04 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where are you placing these bits of code?
Reply With Quote
  #7  
Old 11-13-2005, 08:14 PM
FamilyCorner FamilyCorner is offline
 
Join Date: Jun 2005
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:22 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03725 seconds
  • Memory Usage 2,236KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete