⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 autofeeder.php

📁 基于actionscript3.0的flashLoading控件
💻 PHP
字号:
<?php

$folderPath = $_REQUEST['f_folder'];
$captionDateFormat = $_REQUEST['f_dateFormat'];
$fileTypes = $_REQUEST['f_fileTypes'];
$fileTypeArray = explode(",",$fileTypes);

function dirList ($directory, $showFiles) 
{
    $results = array();
    $handler = opendir($directory);
    while ($file = readdir($handler)) {
        if ($file != '.' && $file != '..') {
	 	    $lastDot = strrpos($file, ".");
			$fileSuffix = substr($file, $lastDot+1);
			foreach($showFiles as $a=>$b){
    		   if(strtolower($b)==strtolower($fileSuffix)){
           			$results[] = $file;
		    	}
   			}			
		}
    }
    closedir($handler);
    return $results;
}

$xmlOutput = "<?xml version='1.0'?><slideshow>";

$filelist = dirList($folderPath, $fileTypeArray);

for($i=0; $i<count($filelist); $i++) {
	
	$xmlOutput .= "<image src='".$folderPath.$filelist[$i]."'><caption>";
	if($captionDateFormat != "none") {
		if($captionDateFormat == "d/m/y")
			$xmlOutput .= date ("d/m/Y", filemtime($folderPath.$filelist[$i]));
		else if($captionDateFormat == "m/d/y")
			$xmlOutput .= date ("m/d/Y", filemtime($folderPath.$filelist[$i]));
		else if($captionDateFormat == "y/d/m")
			$xmlOutput .= date ("Y/d/m", filemtime($folderPath.$filelist[$i]));
		else if($captionDateFormat == "y/m/d")
			$xmlOutput .= date ("Y/m/d", filemtime($folderPath.$filelist[$i]));
	}	
	$xmlOutput .= "</caption></image>";
}

$xmlOutput .= "</slideshow>";

print "xf=".$xmlOutput;

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -