function fn_getSizeDir($ftpConn,$tpftp_path) { //v1.0 - 20040203

 /** 
   * Author: Lucas Vasconcelos (Sh4d0wn)
   * sh4d0wn@yahoo.com / ICQ: 232135650
   * Version: 1.0  / date: 2004-02-03
   * ----------------------------
   * this function count the size of the 
   * selected dir.
   * need to be conected ftp server
   * ---------------------------
   *
   */
	
	$arDirList=ftp_nlist($ftpConn,$tpftp_path); // list all files
	$ctSizeDir=0;
	
	if(isset($arDirList) and !empty($arDirList)) { // check if exists and not null.
		
		for($x=0;$x<count($arDirList);$x++) {
			
			if(ftp_size($ftpConn,$arDirList[$x]) == -1) { // if it will be a dir 
				$ctSizeDir+=fn_getSizeDir($ftpConn,$arDirList[$x]); // use the function again ...
			} else {
				$ctSizeDir+=ftp_size($ftpConn,$arDirList[$x]); // else count file size ...
			}
		}
		
	}
	
	return $ctSizeDir; // return total .... 
}