source: temp/trunk/data/class/GC_Thumb.php @ 1328

Revision 1328, 1.7 KB checked in by naka, 20 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2require_once("../lib/thumb.php");
3
4/*----------------------------------------------------------------------
5 * [̾¾Î] GC_Thumb
6 * [³µÍ×] ¥¢¥Ã¥×¥í¡¼¥É¥Õ¥¡¥¤¥ë²Ã¹©¥¯¥é¥¹(thumb.php¤È¥»¥Ã¥È¤Ç»ÈÍѤ¹¤ë)
7 * [°ú¿ô] -
8 * [ÌáÃÍ] -
9 * [°Í¸] thumb.php
10 * [Ãí¼á] -
11 *----------------------------------------------------------------------*/
12
13Class GC_Thumb {
14
15    var $tempPath;
16
17    function GC_Thumb($tempFilePath = "") {
18        $this->tempPath  = $_SERVER['DOCUMENT_ROOT'] . $tempFilePath;
19    }
20
21    //--- °ì»þ¥Õ¥¡¥¤¥ëÀ¸À®(¥µ¥à¥Í¥¤¥ë²èÁüÀ¸À®ÍÑ)
22    function makeImageTempFile($fileName, $phpFileName, $max_width,$max_height) {
23        // °ì°Õ¤ÊID¤ò¼èÆÀ¤¹¤ë¡£
24        $mainname = uniqid("").".";
25        // ³ÈÄ¥»Ò°Ê³°¤òÃÖ¤­´¹¤¨¤ë¡£
26        $newFileName = ereg_replace("^.*\.",$mainname,$fileName);
27        $result  = MakeThumb( $phpFileName, $this->tempPath, $max_width, $max_height, $newFileName );
28        return $newFileName;
29    }
30
31    //--- °ì»þ¥Õ¥¡¥¤¥ëÀ¸À®
32    function makeTempFile($fileName, $phpFileName) {
33        $newFileNname = str_replace("'", "¡Ç", $fileName );
34        $newFileNname = date("siU") . $newFileNname;
35        copy( $phpFileName, $this->tempPath . $newFileNname );
36        return $newFileNname;   
37    }
38
39    //--- ¥Õ¥¡¥¤¥ë¤ò»ØÄêÊݸDIR¤Ø°Üư
40    function fileMove($fileName, $dirName) {
41        if(copy( $this->tempPath . $fileName , $_SERVER['DOCUMENT_ROOT'] . $dirName . $fileName)) {
42            unlink( $this->tempPath . $fileName );
43        }
44    }
45
46    //---- °ì»þDIR¤Î¥Õ¥¡¥¤¥ë¤ò°ì³çºï½ü 
47    function execDeleteTempFile() {
48        chdir( $this->tempPath );
49        $delFile = glob( "*.*" );
50        if( is_array($delFile) ) foreach( $delFile as $val ) @unlink( $val );
51    }
52
53    //---- »ØÄê¥Õ¥¡¥¤¥ë¤òºï½ü   
54    function fileDelete($fileName, $dirName) {
55        unlink( $_SERVER['DOCUMENT_ROOT'] . $dirName . $fileName );
56    }
57}
58?>
Note: See TracBrowser for help on using the repository browser.