Location: PHPKode > projects > Nukequiz > html/blocks/block-NQ_Random_Side_Question.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 A Random Question & Answers & Points Value      */
/* ***************************************************************/
if ( !defined('BLOCK_FILE') ) {Header("Location: index.php");die();}
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'];
}
$result = $db->sql_query("SELECT ismcq, ismultiple, isoe, question, sol1, sol2, sol3, sol4, points FROM ".$prefix."_nquiz_questions WHERE ismcq ='1' ORDER BY rand() LIMIT 0,1");
$content .= "<br><table width='100%' cellpadding='2' cellspacing='2' border='0'><tr>";
while(list($ismcq,$ismultiple,$isoe,$question,$a,$b,$c,$d,$points) = $db->sql_fetchrow($result)){
if (strlen($question) > '55'){$question= substr($question, 0, (55))."...";}
if (strlen($a) > $name_len){$a= substr($a, 0, ($name_len-2))."...";}
if (strlen($b) > $name_len){$b= substr($b, 0, ($name_len-2))."...";}
if (strlen($c) > $name_len){$c= substr($c, 0, ($name_len-2))."...";}
if (strlen($d) > $name_len){$d= substr($d, 0, ($name_len-2))."...";}
$content .= "<tr><td colspan='2' align='center'>$question</td></tr>";
$content .= "<tr><td align='center'><b>[a]</td><td width='100%' align='left'>$a</td></tr>";
$content .= "<tr><td align='center'><b>[b]</b></td><td align='left'>$b</td></tr>";
$content .= "<tr><td align='center'><b>[c]</b></td><td align='left'>$c</td></tr>";
$content .= "<tr><td align='center'><b>[d]</b></td><td align='left'>$d</td></tr>";
$content .= "<tr><td align='center' colspan='2'><b>$points&nbsp;"._NQ_POINTS."</b></td>";
}
$content.= "</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