当前位置: 首页>>代码示例>>PHP>>正文


PHP discuz_upload::get_target_extension方法代码示例

本文整理汇总了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']);
开发者ID:vanloswang,项目名称:DiscuzX,代码行数:31,代码来源:forum_ajax.php

示例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();
开发者ID:edmundwong,项目名称:V604,代码行数:67,代码来源:function.article.php


注:本文中的discuz_upload::get_target_extension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。