Location: PHPKode > projects > Nukequiz > html/blocks/block-NQ_Scroll_Side_Top_League.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	 */
/*****************************************************************/
/* Scoller-Block - Show League Results Average Score & Percentage*/
/* ***************************************************************/
if(!defined('NUKE_FILE') && !defined('BLOCK_FILE')) { die('You can\'t access this file directly...'); }
global $prefix, $db, $currentlang, $nukeurl;
$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 = $config['scrollheight'];
$updated = $config['league_update'];
$orderby = $config['league_orderby'];
$count = intval($config['league_count']);
$dateformat = $config['dateformat'];
$scroll = intval($config['scroll']);
}
$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>";
}
$content .= "<br><center><table width='100%' border='0' cellpadding='2' cellspacing='2'><tr>";
$result = $db->sql_query("SELECT * FROM ".$prefix."_nquiz_league WHERE updated >'0' ORDER BY $orderby DESC LIMIT 0,$blkh");
while(list($id, $username, $email, $scount, $score, $average, $total, $perc, $update) = $db->sql_fetchrow($result)){
if (strlen($username) > $name_len)
$username = substr($username, 0, ($name_len-2))."...";	
$counter += 1;
$content .= "<td align=\"left\"><b>$counter.</b></td><td align='left'>$username</td><td align=\"right\">$score&nbsp;"._NQ_PTS."</td></tr><tr>";
}
$content .= "</table></center>";
$content .="</marquee><br></td></tr></table>";
$orderedbya = _NQ_PERCENT;
$orderedbyb = _NQ_SCORE;
$orderedbyd = _NQ_AVG;
$orderedbye = _NQ_COMPLETED;
if ($orderby == 'perc') { $orderedby = $orderedbya; } elseif ($orderby == 'score') { $orderedby = $orderedbyb; }elseif ($orderby == 'average') { $orderedby = $orderedbyd; }elseif ($orderby == 'count') { $orderedby = $orderedbye; }
$content .= "<br><center>"._NQ_TOP."&nbsp;<b>$blkh</b>&nbsp;"._NQ_LEAGUE."<br>"._NQ_POSITIONSORDERBY."&nbsp;<b>$orderedby</b><br>"._NQ_WHERECOMPLETED."&nbsp;<b>$count</b>&nbsp;"._NQ_QUIZZES."";

$updated = date($dateformat,$updated);
$content .= "<br><br>"._NQ_LASTUPDATED."<br><b>$updated</b><br></center>";
$content .= "<div align='right'><a href='$nukeurl/rss-nukeleague.php' target='_blank'>";
$content .= "<img src='modules/$module_name/images/rssfeed.png' align='absmiddle' alt='"._NQ_RSSFEEDLEAGUE."' title='"._NQ_RSSFEEDLEAGUE."'></a>&nbsp;</div>";
?>

Return current item: Nukequiz