Location: PHPKode > projects > Nukequiz > html/blocks/block-NQ_Random_Side_Active_Quiz.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 Each Active Quiz By Random Catergory 			 */
/* ***************************************************************/
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;
$name_len = $config['cutoff'];
$height = $config['scrollheight'];
}
$content .= "<table width='100%' height='$height' border='0' cellpadding='2' cellspacing='2'><tr>";
$result = $db->sql_query("SELECT sid, secname from ".$prefix."_nquiz_sections ORDER BY rand() LIMIT 0,1");
while(list($sid, $secname) = $db->sql_fetchrow($result)){
$r = $db->sql_query("SELECT qid, sid, active, title from ".$prefix."_nquiz_quiz WHERE sid='$sid' AND active ='1'");
if (strlen($secname) > '20')
$secname = substr($secname, 0, (16))."...";

$content .= "<td align='center'><b>&raquo;&nbsp;$secname&nbsp;&laquo;</b></td></tr><tr>";
$content .= "<td align='center' valign='top'>";
while(list($qid, $sid, $active, $title) = $db->sql_fetchrow($r)){
if (strlen($title) > '20')
$title = substr($title, 0, (16))."...";
$content .= "<a href='modules.php?name=$module_name&file=index&op=startquiz&qid=$qid'>$title</a><br><br>";
}
$content .= "</td>";
}
$content .= "</tr></table><br>";
$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