Upload.class.php 5.02 KB
<?php
/**
 * 项目图片上传配置
 * 
 * 备注: 尺寸按照从大到小定义, 有利于切图处理
 */
class Config_File_Upload
{
    /**
     * 文件上传的密钥
     * 
     * @var string
     */
	public static $key = 'yoho_upload_system';
	
    /**
     * 用户头像配置
     * 
     * @var array
     */
	public static $headimg = array(
		'format' => '/^image\/(pjpeg|jpe?g|gif|png|bmp)$/', 
		'path' => '/headimg', 
		'upload_max_size' => 80000000, 
		'defaultShow' => '0050x0050', 
		'wh' => array(
		    '300x300' => '03000300',
		    '150x150' => '01500150',
		    '80x80'   => '00800080',
		    '50x50'   => '00500050',
			'25x25'   => '00250025',
		)
	);
	
	/**
	 * 用户头像数据
	 * 
	 * @var array
	 */
	public static $headimgData = array(
		'_project' => 'headimg', 
		'format_str' => array(
	        '03000300' => array(
        		'w' => 300,
        		'h' => 300,
        		'mode' => 'thumbnail'
	        ),
	        '01500150' => array(
        		'w' => 150,
        		'h' => 150,
        		'mode' => 'paste'
	        ),
		    '00800080' => array(
	            'w' => 80,
	            'h' => 80,
	            'mode' => 'paste'
		    ),
			'00500050' => array(
				'w' => 50, 
				'h' => 50, 
				'mode' => 'paste'
			), 
	        '00250025' => array(
        		'w' => 25,
        		'h' => 25,
        		'mode' => 'paste'
	        ),
		)
	);
    
    /**
     * 碎片图片配置
     * 
     * @var array
     */
    public static $fragmentimg = array(
        'format' => '/^image\/(pjpeg|jpe?g|gif|png|bmp)$/',
        'path' => '/blogimg', 
        'upload_max_size' => 80000000, 
        'defaultShow' => '0580x9999',
        'wh' => array(
            '0580x9999' => '05809999',
            '0200x9999' => '02009999',
        ),
    );
    
    /**
     * 碎片图片数据
     * 
     * @var array
     */
    public static $fragmentimgData = array(
        '_project' => 'fragmentimg', 
        'format_str' => array(
            '05809999' => array(
        		'w' => 580,
        		'h' => 9999,
        		'mode' => 'thumbnail'
            ),
            '02009999' => array(
                'w' => 200,
                'h' => 9999,
                'mode' => 'thumbnail'
            ),
        )
    );    
    
    /**
     * 空间封面背景图片配置
     *
     * @var array
     */
    public static $spacebgimg = array(
		'format' => '/^image\/(pjpeg|jpe?g|gif|png|bmp)$/',
		'path' => '/spacebgimg',
		'upload_max_size' => 80000000,
		'defaultShow' => '0960x0300',
		'wh' => array(
			'0960x0300' => '09600300',
		),
    );
    
    /**
     * 空间封面背景图片数据
     *
     * @var array
    */
    public static $spacebgimgData = array(
		'_project' => 'spacebgimg',
		'format_str' => array(
			'09600300' => array(
				'w' => 960,
				'h' => 300,
				'mode' => 'thumbnail'
			),
		)
    );
    
    /**
     * 静态图片配置
     *
     * @var array
     */
    public static $staticimg = array(
		'format' => '/^image\/(pjpeg|jpe?g|gif|png|bmp)$/',
		'path' => '/staticimg',
		'upload_max_size' => 80000000,
		'defaultShow' => '0714x0394',
		'wh' => array(
			'0714x0394' => '07140394',
			'0100x0100' => '01000100',
			'0050x0050' => '00500050'
		),
    );
    
    /**
     * 静态图片数据
     *
     * @var array
    */
    public static $staticimgData = array(
		'_project' => 'staticimg',
		'format_str' => array(
			'07140394' => array(
				'w' => 714,
				'h' => 394,
				'mode' => 'thumbnail'
			),
			'01000100' => array(
				'w' => 100,
				'h' => 100,
				'mode' => 'paste',
			),
			'00500050' => array(
				'w' => 50,
				'h' => 50,
				'mode' => 'paste',
			),
		)
    );  
    
    /**
     * 潮流志图片配置
     *
     * @var array
     */
    public static $ezineimg = array(
		'format' => '/^image\/(pjpeg|jpe?g|gif|png|bmp)$/',
		'path' => '/ezineimg',
		'upload_max_size' => 80000000,
		'defaultShow' => '0300x0300',
		'wh' => array(
			'0300x0300' => '03000300',
		),
    );
    
    /**
     * 潮流志图片数据
     *
     * @var array
     */
    public static $ezineimgData = array(
		'_project' => 'ezineimg',
		'format_str' => array(),
    );
    
    /**
     * 活动图片配置
     *
     * @var array
     */
    public static $campimg = array(
		'format' => '/^image\/(pjpeg|jpe?g|gif|png|bmp)$/',
		'path' => '/campimg',
		'upload_max_size' => 80000000,
		'defaultShow' => '0300x0300',
		'wh' => array(
			'0300x0300' => '03000300',
		),
    );
    
    /**
     * 活动图片数据
     *
     * @var array
     */
    public static $campimgData = array(
		'_project' => 'campimg',
		'format_str' => array(),
	);
    
    /**
     * 音频配置
     * 
     * @var array
     */
    public static $voice = array(
		'format' => '/^audio\/(mp3|m4a|amr|wav)$/',
		'path' => '/',
		'upload_max_size' => 80000000,
    );
    /**
     * 视频配置
     *
     * @var array
     */
    public static $video = array(
    		'format' => '/^video\/(mp4|avi|rmb|rm|flv)$/',
    		'path' => '/',
    		'upload_max_size' => 80000000,
    );
    public static $file_path = '/Data/code/www.test.yoho.cn/static/res/pm/att/';
}