$faisunZIP->addfile(implode('', file("{$dir}")), basename($dir)); return 1; } return 0; } return $sub_file_num; } $flname = "attachments/photo/user_{$my[user_id]}/theme.zip"; if (is_array($files)) { $faisunZIP = new PHPzip(); if ($faisunZIP->startfile($flname)) { $filenum = 0; foreach ($files as $file) { $filenum += listfiles($file); } $faisunZIP->createfile(); if ($filenum > 0) { header("location: {$webaddr}/{$flname}"); } else { header("location: {$webaddr}/op/theme"); } } } exit; } if ($action == "theme") { $bgcolor = trim($_POST['bg']); $textcolor = trim($_POST['text']); $links = trim($_POST['links']); $sidebarcl = trim($_POST['sidebarcl']); $sidebox = trim($_POST['sidebox']);
if ($dodozip->startfile("{$_REQUEST['todir']}{$_REQUEST['zipname']}")) { echo "正在添加压缩文件...<br><br>"; $filenum = 0; foreach ($_REQUEST[dfile] as $file) { if (is_file($file)) { if (!empty($dodozip->filefilters)) { if (!in_array(end(explode(".", $file)), $dodozip->filefilters)) { continue; } } echo "<font face=\"wingdings\" size=\"5\">2</font> {$file}<br>"; } else { echo "<font face=\"wingdings\" size=\"5\">0</font> {$file}<br>"; } $filenum += listfiles($file); } $dodozip->createfile(); echo "<br>压缩完成,共添加 {$filenum} 个文件.<br><a href='{$_REQUEST['todir']}{$_REQUEST['zipname']}' _fcksavedurl='{$_REQUEST['todir']}{$_REQUEST['zipname']}'>{$_REQUEST['todir']}{$_REQUEST['zipname']} (" . num_bitunit(filesize("{$_REQUEST['todir']}{$_REQUEST['zipname']}")) . ")</a>"; } else { echo "{$_REQUEST['todir']}{$_REQUEST['zipname']} 不能写入,请检查路径或权限是否正确.<br>"; } } ?> </form> <hr color="#003388"> <center> <a href="http://www.sectop.com" target="_blank">DoDo's Blog</a> </center> </body> </html>