本文整理汇总了PHP中discuz_upload::get_target_extension方法的典型用法代码示例。如果您正苦于以下问题:PHP discuz_upload::get_target_extension方法的具体用法?PHP discuz_upload::get_target_extension怎么用?PHP discuz_upload::get_target_extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类discuz_upload
的用法示例。
在下文中一共展示了discuz_upload::get_target_extension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dfsockopen
continue;
}
$content = '';
if (preg_match('/^(http:\\/\\/|\\.)/i', $imageurl)) {
$content = dfsockopen($imageurl);
} elseif (preg_match('/^(' . preg_quote(getglobal('setting/attachurl'), '/') . ')/i', $imageurl)) {
$imagereplace['newimageurl'][] = $value[0];
}
if (empty($content)) {
continue;
}
$patharr = explode('/', $imageurl);
$attach['name'] = trim($patharr[count($patharr) - 1]);
$attach['thumb'] = '';
$attach['isimage'] = $upload->is_image_ext($attach['ext']);
$attach['extension'] = $upload->get_target_extension($attach['ext']);
$attach['attachdir'] = $upload->get_target_dir('forum');
$attach['attachment'] = $attach['attachdir'] . $upload->get_target_filename('forum') . '.' . $attach['extension'];
$attach['target'] = getglobal('setting/attachdir') . './forum/' . $attach['attachment'];
if (!@($fp = fopen($attach['target'], 'wb'))) {
continue;
} else {
flock($fp, 2);
fwrite($fp, $content);
fclose($fp);
}
if (!$upload->get_image_info($attach['target'])) {
@unlink($attach['target']);
continue;
}
$attach['size'] = filesize($attach['target']);
示例2: forum_downremotefile
//.........这里部分代码省略.........
}
$content_md5_arr[] = md5($content);
} elseif (preg_match('/^(' . preg_quote(getglobal('setting/attachurl'), '/') . ')/i', $imageurl)) {
$imagereplace['newimageurl'][] = $value[0];
}
if (empty($content)) {
if ($value[4] == 1) {
if ($del_a == 1) {
$imagereplace['newimageurl'][] = $value[2];
} else {
unset($imagereplace['oldimageurl'][$key]);
}
} else {
$imagereplace['newimageurl'][] = '';
}
continue;
}
if (!$attach['name']) {
$patharr = explode('/', $imageurl);
$attach['name'] = trim($patharr[count($patharr) - 1]);
}
$patharr = explode('/', $imageurl);
if (!$attach['name']) {
$attach['name'] = trim($patharr[count($patharr) - 1]);
}
$attach['thumb'] = '';
$attach['ext'] = trim($attach['ext']);
//不加这个有些还真不行
$attach['isimage'] = $upload->is_image_ext($attach['ext']);
if ($attach['isimage'] == 1 && $arr['is_download_img'] != 1) {
$imagereplace['newimageurl'][] = $value[0];
continue;
}
$attach['extension'] = $upload->get_target_extension($attach['ext']);
$attach['attachdir'] = $upload->get_target_dir('forum');
$attach['attachment'] = $attach['attachdir'] . $upload->get_target_filename('forum') . '.' . $attach['extension'];
$attach['target'] = getglobal('setting/attachdir') . './forum/' . $attach['attachment'];
if (!in_array($attach['ext'], $get_file_ext_arr) && $get_file_ext_arr && $attach['isimage'] == 0) {
if ($value[4] == 1) {
if ($del_a == 1) {
$imagereplace['newimageurl'][] = $value[2];
} else {
unset($imagereplace['oldimageurl'][$key]);
}
} else {
$imagereplace['newimageurl'][] = '';
}
continue;
}
if (!@($fp = fopen($attach['target'], 'wb'))) {
continue;
} else {
flock($fp, 2);
fwrite($fp, $content);
fclose($fp);
}
if (!$upload->get_image_info($attach['target']) && $attach['isimage'] == 1) {
@unlink($attach['target']);
continue;
}
$attach['size'] = filesize($attach['target']);
$upload->attach = $attach;
$thumb = $width = 0;
if ($upload->attach['isimage']) {
if ($_G['setting']['thumbstatus']) {
$image = new image();