PHPCMS 图片上传 缩略图

//获取信息
$pro_info = array_map("safe_replace", new_html_special_chars($_POST));
$upPassId = $this->atta->upload('product_image', $alowexts = '', $maxsize = 0, $overwrite = 1,array(), $watermark_enable = 0); //product_image为表单 name
//获取图片 
$this->pro_img = pc_base::load_model('attachment_model'); $imginfo = $this->pro_img->get_one(array('aid'=>$upPassId[0]),'filename,filepath');
$imgurl = $imginfo['filepath'];
$pro_info['info']['product_img'] = thumb($imgurl, $width = 220, $height = 130 ,$autocut = 0, $smallpic = 'nopic.gif');

 

在代码之前 引入类

pc_base::load_sys_class('attachments', '', 0);
 $this->atta = pc_base::load_sys_class('attachment');

 

posted @ 2014-07-28 10:51  撑着破伞去看雨  阅读(420)  评论(0)    收藏  举报