public function down_img($url, $mid = 'video') { $chr = strrchr($url, '.'); $imgUrl = uniqid(); $imgPath = $mid . '/' . date(C('upload_style'), time()) . '/'; $imgPath_s = './' . C('upload_path') . '-s/' . $imgPath; $filename = './' . C('upload_path') . '/' . $imgPath . $imgUrl . $chr; $get_file = get_collect_file($url); if ($get_file) { write_file($filename, $get_file); //是否添加水印 if (C('upload_water')) { import('ORG.Util.Image'); Image::water($filename, C('upload_water_img'), '', C('upload_water_pct'), C('upload_water_pos')); } //是否生成缩略图 if (C('upload_thumb')) { mkdirss($imgPath_s); import('ORG.Util.Image'); Image::thumb($filename, $imgPath_s . $imgUrl . $chr, '', C('upload_thumb_w'), C('upload_thumb_h'), true); } //是否上传远程 if (C('upload_ftp')) { $this->ftp_upload($imgPath . $imgUrl . $chr); } return $imgPath . $imgUrl . $chr; } else { return $url; } }
/** * 资源站为飞飞影视系统 * * @param array $array_url * @return */ public function ziyuan_feifei($array_url) { $array_tpl['httpurl'] = $array_url['xmlurl'] . '/index.php?s=plus-api-xml-cms-ff-action-' . $array_url['action'] . '-vodids-' . $array_url['vodids'] . '-cid-' . $array_url['cid'] . '-wd-' . urlencode($array_url['wd']) . '-h-' . $array_url['h'] . '-p-' . $array_url['p']; $array_tpl['httpurl'] = str_replace('@', '/', $array_tpl['httpurl']); //还原目标网址 $xml = get_collect_file($array_tpl['httpurl']); if ($xml) { return $this->ff_gx_xml($array_url, $xml); } else { return false; } }