Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/media_manager/ext/zip/ext.fileInfo.php
<?php
	require_once("Archive/Zip.php");
	$archive = new Archive_Zip("uploads/files/".$fileInformation[branchName]."/".$fileInformation[filename]);
	$elementList = $archive->listContent();
	$size_values = array("", "K", "M", "G", "T");
	foreach($elementList as $v) {
		$_fileDir  = explode( "/", $v[filename] );
		$zipFileName[] = array_pop( $_fileDir );
		$zipFileDirectory[] = implode( "/", $_fileDir );
		
		$ext = "Byte";
		$j = 0;
		while($v[size] >= pow(1024, $j)) ++$j;
		$zipFileSize[] = round($v[size] / pow(1024, $j-1), 2) . ' ' . $size_values[$j-1] . $ext;
		
		$j = 0;
		while($v[compressed_size] >= pow(1024, $j)) ++$j;
		$zipFileSizeCompressed[] = round($v[compressed_size] / pow(1024, $j-1), 2) . ' ' . $size_values[$j-1] . $ext;
	}
	$tpl->readTemplatesFromFile($config['templates']."ext/".strtolower($extension[0])."/fileInfo.template");
	
	$tpl->addVars("media:ext:zip:row", 
		array ( "NAME"            => $zipFileName,
				"DIRECTORY"       => $zipFileDirectory,
				"SIZE"            => $zipFileSize,
				"COMPRESSED_SIZE" => $zipFileSizeCompressed
		)
	);
	
	$tpl->addVars("media:ext:zip", 
		array ( "TXT_COMPRESSED_CONTENT" => $media['contentCompressed'],
				"TXT_NAME"            => $media['fileName'],
				"TXT_DIRECTORY"       => $media['parentDir'],
				"TXT_SIZE"            => $media['fileSize'],
				"TXT_COMPRESSED_SIZE" => $media['fileSizeCompressed']
		)
	);
	
	$tpl->displayParsedTemplate("media:ext:zip");
?>
Return current item: Content*Builder