<?php
// $Id: waiting.inc.php,v 1.1 2004/07/11 10:28:19 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// 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 mydownloads_waiting() {
global $db;

$count   = 0;
$waiting = array();

$result = $db->query("SELECT COUNT(*) FROM ".$db->prefix("mydownloads_downloads")." WHERE status=0");
if ($result) {
	list($num) = $db->fetch_row($result);
	$num = intval($num);
	if ($num > 0) {
		$waiting[$count]['image'] = XOOPS_URL.'/images/menu/pointer.gif';
		$waiting[$count]['link']  = XOOPS_URL.'/modules/mydownloads/admin/index.php?op=listNewDownloads';
		$waiting[$count]['text']  = _MB_SYSTEM_WDLS;
		$waiting[$count]['count'] = $num;
		$count++;
	}
}

$result = $db->query("SELECT COUNT(*) FROM ".$db->prefix("mydownloads_broken")."");
if ($result) {
	list($num) = $db->fetch_row($result);
	$num = intval($num);
	if ($num > 0) {
		$waiting[$count]['image'] = XOOPS_URL.'/images/menu/pointer.gif';
		$waiting[$count]['link']  = XOOPS_URL.'/modules/mydownloads/admin/index.php?op=listBrokenDownloads';
		$waiting[$count]['text']  = _MB_SYSTEM_BFLS;
		$waiting[$count]['count'] = $num;
		$count++;
	}
}

$result = $db->query("SELECT COUNT(*) FROM ".$db->prefix("mydownloads_mod")."");
if ($result) {
	list($num) = $db->fetch_row($result);
	$num = intval($num);
	if ($num > 0) {
		$waiting[$count]['image'] = XOOPS_URL.'/images/menu/pointer.gif';
		$waiting[$count]['link']  = XOOPS_URL.'/modules/mydownloads/admin/index.php?op=listModReq';
		$waiting[$count]['text']  = _MB_SYSTEM_MFLS;
		$waiting[$count]['count'] = $num;
		$count++;
	}
}

return $waiting;
}
?>
