chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 <?php
 
class uppic_controller extends lietou
{
    //照片管理
    function index_action(){
        $LietouM    =    $this -> MODEL('lietou');
        
        $row        =   $LietouM -> getInfo(array('uid'=>$this->uid),array('utype'=>'user'));
        
        $this->yunset("bpic",$row['photo_big']);
        
        $this->yunset("row",$row);
        
        $this->yunset("class",8);
        
        $this->public_action();
        
        $this->lietou_tpl('uppic');
    
    }
 
    
    function ajaxfileupload_action(){
        
        
        if($_FILES['image']['tmp_name']){
 
            $UploadM    =    $this->MODEL('upload');
 
            $imginfo  =  getimagesize($_FILES['image']['tmp_name']);
 
            if($imginfo[0] < 100 || $imginfo[1] < 100){
                
                $res['s_thumb']  =  '头像尺寸比例太小,最小尺寸:宽80/高100';
                
            }else{
                $upArr  =  array(
                    'file'      =>  $_FILES['image'],
                    'dir'       =>  'lietou',
                    'type'      =>  'logo',
                    'watermark'    => 0
                );
                $return      =  $UploadM -> newUpload($upArr);
                
                if(!empty($return['msg'])){
                    
                    $res['s_thumb']  =  $return['msg'];
                    
                }else {
                    
                    $res['url']  =  checkpic($return['picurl']);
                }
            }
        }else{ 
            
            $res["s_thumb"]        =    '请选择上传图片';
            
        }
        echo json_encode($res);
    }
 
    
    function savethumb_action(){
        
        $upload_path = 'data/upload/lietou/';
        
        if(stripos(trim($_POST['img1']),$upload_path)===false ){
            
            $this->ACT_layer_msg("非法操作!",8,$_SERVER['HTTP_REFERER']);
        
        }
        
        $uploadM  =  $this->MODEL('upload');
        
        $thumb    =  $uploadM -> thumb('lietou');
        
        if(!$this -> ltInfo['uid']){
            $userinfoM    =   $this->MODEL("userinfo");
            $userinfoM -> activUser($this->uid,3);
        }
 
        $LietouM  =  $this->MODEL('lietou');
        
        $return      =  $LietouM->upLogo(array('uid'=>$this->uid),array('thumb'=>$thumb,'utype'=>'user'));
        
        $this->layer_msg($return['msg'],$return['errcode']);
    
    }
    
}
?>