..or more modules you must have seen the iframes used for realtime result display. In this tutorial I'm going to show you how to insert them into your module and how they function. what..
<?php
/* Gets subdirectories from a directory
Returns absolute or relative paths to subdirectories inside the parent directory.
GetDirByDir fetches the names of directories found one level deep in the directory structure,
or fetches all absolute directory paths from location $sParentDir.
PARAMETERS:
$sParentDir: directory to obtain subdirectories from
$iAbsolute: store absolute or relative paths(OPTIONAL)
0: store relative paths
1: store absolute paths(default)
RETURNS:
FALSE: failed to open directory $sDir
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 12-11-2014
*/
function GetDirByDir($sParentDir,$iAbsolute=1){
global $_CONTEXT;
if(!$rHandle = @opendir($sParentDir)){
$_CONTEXT['errors'][] = "Failed to open directory <b>".$sParentDir."</b>";
return(false);
}
$aDirBuffer = array();
while(false!==($sDir = @readdir($rHandle))){
if($sDir=="." || $sDir==".."){
continue;
}
$sPath = $sParentDir."/".$sDir;
if(@is_dir($sPath)){
if($iAbsolute==1){
// buffer absolute subdirectories
$aDirBuffer[] = $sPath;
}
else{
// buffers relative subdirectories
$aDirBuffer[] = $sDir;
}
}
}
@closedir($rHandle);
return($aDirBuffer);
}
?>