Beispiel #1
0
	function d3download_delcat( $mydirname, $cid )
	{
		$db =& Database::getInstance() ;
		include_once dirname( dirname(__FILE__) ).'/class/mycategory.php' ;

		$mycategory = new MyCategory( $mydirname, 'Show' ) ;
		$module_handler =& xoops_gethandler('module');
		$xoopsModule =& $module_handler->getByDirname( $mydirname );
		$mid =& $xoopsModule->getVar('mid');
		$children = $mycategory->getAllChildId( $cid ) ;
		$whr = "cid IN (" ;
		foreach( $children as $child ) {
			$whr .= "$child," ;
			xoops_notification_deletebyitem( $mid , 'cat' , $child ) ;
		}
		$whr .= "$cid)" ;
		xoops_notification_deletebyitem( $mid, 'category', $cid ) ;
		d3download_delete_contents( $mydirname , $whr, $cid );
		d3download_delete_cache_of_categories( $mydirname ) ;
		$db->query( "DELETE FROM ".$db->prefix( $mydirname."_cat")." WHERE $whr" ) or die( "DB error: DELETE cat table" ) ;
	}