vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Can someone help? (https://vborg.vbsupport.ru/showthread.php?t=65889)

trackpads 06-06-2004 03:28 AM

Can someone help?
 
Hi,

I have a quiz on my site-

http://www.trackpads.com/quiz/

In the top of the page is the 'Top Test Takers' portion that I had a coder here make for me. The problem is that I dont like the listings in the way they are. Can someone tell me what to change the code to to make it just the 2 columns (Name and total # of quizzes taken) and then have it sort by total number of quizzes?

Thanks again if you can help,

-Jason

PHP Code:



// Top 10





print "<table border=0 cellspacing=0 cellpadding=1 bgcolor=$table_border_color width=90% align=center><tr><td>\n";

print 
"<table border=0 cellspacing=1 cellpadding=1 width=100%>\n";

print 
"<tr>";

print 
"<td bgcolor=$table_color_1 width=100% colspan=4><font face=\"$font_face\" color=\"$font_color\" size=3><b>Top 10 Quiz Takers</b></font></td>";

print 
"</tr>";



        print 
"<tr><td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2><b>Rank </font></td>";

        print 
"<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2><b>Member Name</font></td>";

        print 
"<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2><b>Average Score</font></b></td>";

        print 
"<td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2><b>Quizzes Taken</font></b></td></tr>";



$toptip=$DB_site->query("SELECT username, userid, quizscore, quiztaken From user ORDER BY quizscore DESC");

    while (
$topinfo $DB_site->fetch_array($toptip)){

        if(
$topinfo[quiztaken]==0){

            
$av $topinfo[quizscore];

        }else{

            
$av $topinfo[quizscore]/$topinfo[quiztaken];

        }

        
$place++;

        if(
$place<=10){

        print 
"<tr><td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2> $place </font></td>";

        print 
"<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2>$topinfo[username] </font></td>";

        print 
"<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2>$av </font></td>";

print 
"<td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2>$topinfo[quiztaken]</font></td>";

print 
"</tr>";

}

    }







print 
"</table>";

print 
"</table>";

print 
"<br>";

// End Top 10 


trackpads 06-22-2004 09:06 AM

Bump please!


All times are GMT. The time now is 08:39 AM.

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.01575 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete