<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.9 www.exoops.info 2006/03 
// $Id: system_waiting.php,v 1.8 2003/03/31 10:47:56 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Half-Dead
// Author Website : http://www.e-xoops.com
// License Type   : LGPL: See /manual/LICENSES/LGPL.txt
// ------------------------------------------------------------------------- //
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function b_system_waiting_show() {
global $db, $myts, $bcoosConfig;
$block            = array();
$block['title']   = _MB_SYSTEM_WCNT;
$block['content'] = '';
$query = $db->query('SELECT dirname FROM '.$db->prefix('modules').' WHERE isactive=1 AND haswaiting=1');
if ($query) {
	while (list($dirname) = @$db->fetchRow($query)) {
		include(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/include/bcoos_module.php');
		if (@file_exists(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.$modversion['waiting']['file'])) {
			if ( @file_exists(XOOPS_ROOT_PATH."/modules/".$dirname."/language/".$bcoosConfig['language']."/language.php") ) {
				include_once(XOOPS_ROOT_PATH."/modules/".$dirname."/language/".$bcoosConfig['language']."/language.php");
				} elseif ( @file_exists(XOOPS_ROOT_PATH."/modules/".$dirname."/language/english/language.php") ) {
					include_once(XOOPS_ROOT_PATH."/modules/".$dirname."/language/english/language.php");
				}
			include_once(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.$modversion['waiting']['file']);
			$func = $modversion['waiting']['func'];
			if (function_exists($func)) {
				$content = $func();
				$size    = count($content);
				for ($i=0; $i<$size; $i++) {
					if ( !empty($content[$i]['image']) ) {
						$block['content'] .= '<img src="'.$content[$i]['image'].'" /> ';
					}
					if ( !empty($content[$i]['link']) && !empty($content[$i]['text']) ) {
						$block['content'] .= '<a href="'.$content[$i]['link'].'">'.$myts->makeTboxData4Show($content[$i]['text']).'</a>';
	}
					if ( !empty($content[$i]['count']) ) {
						$block['content'] .= ': '.intval($content[$i]['count']);
}
					$block['content'] .= '<br />';
	}
				if ($size > 0) {
					$block['content'] .= '<br />';
	}
	}
}
	}
	}
if ($block['content'] == '') {
	$block['content'] = _NONE;
}
return $block;
}
?>
