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
<?php
 
class index_controller extends common{
    function index_action(){
 
        if($this->config['sy_linksq']!="1"){
 
            header("location:".Url('error'));
        }
        if($_POST['submit']){
        
            $linkM        =    $this  -> MODEL('link');
            if($_POST['phototype']==1){
                
                if($_FILES['file']['tmp_name']){
 
                    $UploadM = $this->MODEL('upload');
 
                    $upArr    =  array(
                      'file'  =>  $_FILES['file'],
                      'dir'   =>  'link'
                    );
 
                    $uploadM  =  $this->MODEL('upload');
 
                    $pics      =  $uploadM->newUpload($upArr);
                  
                    if (!empty($pics['msg'])){
 
                      $this->ACT_layer_msg($pics['msg'],8);
 
                    }elseif (!empty($pics['picurl'])){
 
                      $pic   =   $pics['picurl'];
 
                    }
                }
                
            }else{
                $pic        =    $_POST['uplocadpic'];
            }
                
            $post    =    array(
                'did'            =>    $this->userdid ? $this->userdid : 0,
                'link_name'        =>    trim($_POST['title']),
                'link_url'        =>    $_POST['url'],
                'link_type'        =>    $_POST['type'],
                'tem_type'        =>    1,
                'img_type'        =>    $_POST['phototype'],
                'link_sorting'    =>    $_POST['sorting'],
                'link_state'    =>    0,
                'pic'            =>    $pic,
            );
            $data    =    array(
                'post'        =>    $post,
                'id'        =>    $_POST['id'],
                'authcode'    =>    $_POST['authcode'],
                'utype'        =>    'index'
            );
            
            $return    =    $linkM -> addInfo($data);
            
            $this->ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER']);
        }
        $this->seo("friend");
        $this->yun_tpl(array('index'));
    }
}
?>