Archive for 八月, 2008

SureRemoveDir-删除目录

// ggarciaa at gmail dot com (04-July-2007 01:57) // I needed to empty a directory, but keeping it // so I slightly modified the contribution from // stefano at takys dot it (28-Dec-2005 11:57) // A short but powerfull recursive function // that works also if the dirs contain hidden files // // $dir = the target directory // $DeleteMe = if true delete also $dir, if false leave it alonefunction SureRemoveDir($dir, $DeleteMe) { if(!$dh = @opendir($dir)) return; while (false !==...

给图片加水印类

set_time_limit(3000); class GDMark { var $sourcePath; //图片存储路径 var $galleryPath; //图片缩略图存储路径 var $toFile = false; //是否生成文件 var $WaterPos; var $MarkSign = null; var $fontName; //使用的TTF字体名称 var $maxWidth = 600; //图片最大宽度 var $maxHeight = 700; //图片最大高度function GDMark($sourcePath, $galleryPath, $WaterPos, $fontPath, $MarkSign='') { $this->sourcePath = $sourcePath; $this->galleryPath =...