Location: PHPKode > projects > Nukequiz > html/blocks/block-NQ_Scroll_Side_Competition_Quiz_Results.php
<?php
/*****************************************************************/
/* Nukequiz (tm)    v 3.1.0                                		 */
/* By: Kissoftware (hide@address.com)      		     */
/* http://www.kissoftware.org.uk                           		 */
/* http://www.kissoftware.co.uk                       		     */
/* Copyright © 2003-2008 by Kissoftware         				 */
/* See Docs For Information & Credits                 			 */
/* For More information Visit Forums Or The Online Help Manual	 */
/*****************************************************************/
/* Block To Show Competition Quiz Titles & Results Of Top Players*/
/* ***************************************************************/
if(!defined('NUKE_FILE') && !defined('BLOCK_FILE')) { die('You can\'t access this file directly...'); }
global $prefix, $db, $currentlang;
$module_name="Nukequiz";
include_once("modules/$module_name/language/lang-".$currentlang.".php");
$configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_nquiz_config");
while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
$config[$config_name] = $config_value;
$blkh = intval($config['blocklist']);
$name_len = $config['cutoff'];
$scrdir = $config['scrdir'];
$height = intval($config['scrollheight']);
$scroll = intval($config['scroll']);
$dateformat = $config['dateformat'];
}
$content .= "<center><table cellpadding='3' cellspacing='3' border='0'><tr><td>";
if ($scroll == '1') {
$content .= "<br><Marquee Behavior='Scroll' Direction='$scrdir' Height='$height' ScrollAmount='3' ScrollDelay='100' onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
}
$result = $db->sql_query("SELECT qid, sid, active, title, expire FROM ".$prefix."_nquiz_quiz  WHERE active ='1' AND iscq='1'");
if ($db->sql_numrows($result)== ''){
$content .= "<center><table width='100% cellpadding='2' cellspacing='2' border='0'><tr>";
$content .= "<td align='center'><b>"._NQ_NOCOMPQUIZ."</b></td></tr></table></center>";
}
else {
while(list($qid, $sid, $active, $title, $expire) = $db->sql_fetchrow($result)){
if ($expire == '0'){$datetime = ""._NQ_NOEXPIRE."";} else {
$datetime = ""._NQ_EXPIRESON."<br>".date($dateformat, $expire);
}
$resultq = $db->sql_query("SELECT COUNT(*) FROM ".$prefix."_nquiz_questions WHERE qid='$qid'");
list($a) = $db->sql_fetchrow($resultq);


$content .= "<center><table width=\"100%\" cellpadding='2' cellspacing='2' border='0'>";
$content .= "</tr><td align='center'><a href='modules.php?name=$module_name&amp;op=startquiz&qid=$qid'>$title</a></td></tr>";
$content .= "<tr><td align='center'>(&nbsp;$a&nbsp;"._NQ_QUESTIONS."&nbsp;)<br></td></tr>";		
$content .= "<td align='center'><b>$datetime</b></td></tr>";
$content .= "<td align='center'><br><b>&ndash;&nbsp;&ndash;&nbsp;&loz;&nbsp;&loz;&nbsp;&ndash;&nbsp;&ndash;</b><br><br></td></tr>";
$scores = $db->sql_query("SELECT username, perc, ttime FROM ".$prefix."_nquiz_scoreboard WHERE qid=$qid AND score>'0'ORDER BY perc DESC, ttime ASC LIMIT 0,$blkh");
if ($db->sql_numrows($scores)== ''){
$content .="<tr><td align='center'><b>"._NQ_NOSCORESENT."</b><br><br><b>&ndash;&nbsp;&ndash;&nbsp;&loz;&nbsp;&loz;&nbsp;&ndash;&nbsp;&ndash;</b></td></tr>";
}
else{
$content .= "<tr>";
while(list($username,$perc,$ttime) = $db->sql_fetchrow($scores)){
if (strlen($username) > $name_leng)
$username = substr($username, 0, ($name_len-2))."...";
$content .= "<td align='center'>$username</td></tr><tr><td align='center'>"._NQ_SCORED."&nbsp;$perc%</font></td></tr><tr><td align='center'>"._NQ_TTAKEN."<br><b>$ttime</b><br>("._NQ_MINS.":"._NQ_SECS.")</td><tr>";
$content .= "<td align='center'><br><b>&ndash;&nbsp;&ndash;&nbsp;&loz;&nbsp;&loz;&nbsp;&ndash;&nbsp;&ndash;</b></td></tr><tr><td align='center'></td></tr>";
}#scoreboard tag
$content .= "<td align='center' colspan='3'><br><br></td><tr></tr>";
}
}#List Tag
$content .= "";
}
$content .= "</table></center></marquee><br></td></tr></table>";



$content .="<center>"._NQ_REGISTEREDACCESS."<br><br><a href='modules.php?name=Your_Account'>"._NQ_LOGIN."</a>&nbsp;&nbsp;"._NQ_OR."&nbsp;&nbsp;<a href='modules.php?name=Your_Account&op=new_user'>"._NQ_REGISTER."</a><br>";	
//* Please Leave this Copyright Link In Here - Fair is Fair. Thanks */
$content .="<div align='right'><a href='http://www.kissoftware.org.uk/' target='_blank'><img src='modules/$module_name/images/kiss.gif'></a>&nbsp;";
?>
Return current item: Nukequiz