<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.8 www.exoops.info 2006/03
// 
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Pascal Le Boustouller
// Author Website : http://www.perso-search.com/e-xoopsien/
// Licence Type   : GPL
// ------------------------------------------------------------------------- //
function cat_show(){
	global $db, $bcoosConfig, $ynprice, $myts, $affichnbann;
		$block = array();
		$block['title'] = _CATEGORY;
		
	include_once(XOOPS_ROOT_PATH."/modules/MyAnnonces/cache/config.php");
	include_once(XOOPS_ROOT_PATH."/modules/MyAnnonces/include/functions.php");
	
	$block['content'] = "";
$cid="0";
$sql = $db->query("SELECT * FROM ".$db->prefix("ann_categories")." where pid='$cid'");
while ($data=$db->fetchArray($sql)) {
$block['content'] .= "<B><A HREF=\"".XOOPS_URL."/modules/MyAnnonces/index.php?pa=view&cid=$data[cid]\">$data[title]</a></B>";
if ($affichnbann == "1") {
	$totalann = getTotalItems($data[cid], Yes);
$block['content'] .= "&nbsp;($totalann)";
}
$block['content'] .= "<BR>";
if ($cid=="0") {
$sqls = $db->query("SELECT * FROM ".$db->prefix("ann_categories")." where pid='$data[cid]' and pid!='0'");
while ($datab=$db->fetchArray($sqls)) {
	
$block['content'] .= "&nbsp;&raquo; <A HREF=\"".XOOPS_URL."/modules/MyAnnonces/index.php?pa=view&cid=$datab[cid]\">$datab[title]</a><BR>";
    }
}
}
	        return $block;	
}
?>