• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_editor_image函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_editor_image函数的典型用法代码示例。如果您正苦于以下问题:PHP get_editor_image函数的具体用法?PHP get_editor_image怎么用?PHP get_editor_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_editor_image函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: count

 if ($w == "d") {
     if (!$is_admin) {
         $sql = " select count(*) as cnt from {$g5['g5_shop_item_use_table']} where mb_id = '{$member['mb_id']}' and is_id = '{$is_id}' ";
         $row = sql_fetch($sql);
         if (!$row['cnt']) {
             if ($move) {
                 alert("자신의 글만 삭제하실 수 있습니다.");
             } else {
                 apms_alert("1|자신의 글만 삭제하실 수 있습니다.");
             }
         }
     }
     // 에디터로 첨부된 이미지 삭제
     $sql = " select is_content from {$g5['g5_shop_item_use_table']} where is_id = '{$is_id}' and md5(concat(is_id,is_time,is_ip)) = '{$hash}' ";
     $row = sql_fetch($sql);
     $imgs = get_editor_image($row['is_content']);
     for ($i = 0; $i < count($imgs[1]); $i++) {
         $p = parse_url($imgs[1][$i]);
         if (strpos($p['path'], "/data/") != 0) {
             $data_path = preg_replace("/^\\/.*\\/data/", "/data", $p['path']);
         } else {
             $data_path = $p['path'];
         }
         $destfile = G5_PATH . $data_path;
         if (is_file($destfile)) {
             @unlink($destfile);
         }
     }
     $sql = " delete from {$g5['g5_shop_item_use_table']} where is_id = '{$is_id}' and md5(concat(is_id,is_time,is_ip)) = '{$hash}' ";
     sql_query($sql);
     //$alert_msg = "0|삭제 하셨습니다.";
开发者ID:peb317,项目名称:gbamn,代码行数:31,代码来源:itemuseformupdate.php


示例2: get_view_thumbnail

function get_view_thumbnail($contents, $thumb_width = 0)
{
    global $board, $config;
    if (!$thumb_width) {
        $thumb_width = $board['bo_image_width'];
    }
    // $contents 중 img 태그 추출
    $matches = get_editor_image($contents, true);
    if (empty($matches)) {
        return $contents;
    }
    for ($i = 0; $i < count($matches[1]); $i++) {
        $img = $matches[1][$i];
        preg_match("/src=[\\'\"]?([^>\\'\"]+[^>\\'\"]+)/i", $img, $m);
        $src = $m[1];
        preg_match("/style=[\"\\']?([^\"\\'>]+)/i", $img, $m);
        $style = $m[1];
        preg_match("/width:\\s*(\\d+)px/", $style, $m);
        $width = $m[1];
        preg_match("/height:\\s*(\\d+)px/", $style, $m);
        $height = $m[1];
        preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        $alt = get_text($m[1]);
        // 이미지 path 구함
        $p = parse_url($src);
        if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
            $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
        } else {
            $data_path = $p['path'];
        }
        $srcfile = G5_PATH . $data_path;
        if (is_file($srcfile)) {
            $size = @getimagesize($srcfile);
            if (empty($size)) {
                continue;
            }
            // jpg 이면 exif 체크
            if ($size[2] == 2 && function_exists('exif_read_data')) {
                $degree = 0;
                $exif = @exif_read_data($srcfile);
                if (!empty($exif['Orientation'])) {
                    switch ($exif['Orientation']) {
                        case 8:
                            $degree = 90;
                            break;
                        case 3:
                            $degree = 180;
                            break;
                        case 6:
                            $degree = -90;
                            break;
                    }
                    // 세로사진의 경우 가로, 세로 값 바꿈
                    if ($degree == 90 || $degree == -90) {
                        $tmp = $size;
                        $size[0] = $tmp[1];
                        $size[1] = $tmp[0];
                    }
                }
            }
            // 원본 width가 thumb_width보다 작다면
            if ($size[0] <= $thumb_width) {
                continue;
            }
            // Animated GIF 체크
            $is_animated = false;
            if ($size[2] == 1) {
                $is_animated = is_animated_gif($srcfile);
            }
            // 썸네일 높이
            $thumb_height = round($thumb_width * $size[1] / $size[0]);
            $filename = basename($srcfile);
            $filepath = dirname($srcfile);
            // 썸네일 생성
            if (!$is_animated) {
                $thumb_file = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, false);
            } else {
                $thumb_file = $filename;
            }
            if (!$thumb_file) {
                continue;
            }
            if ($width) {
                $thumb_tag = '<img src="' . G5_URL . str_replace($filename, $thumb_file, $data_path) . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"/>';
            } else {
                $thumb_tag = '<img src="' . G5_URL . str_replace($filename, $thumb_file, $data_path) . '" alt="' . $alt . '"/>';
            }
            // $img_tag에 editor 경로가 있으면 원본보기 링크 추가
            $img_tag = $matches[0][$i];
            if (strpos($img_tag, G5_DATA_DIR . '/' . G5_EDITOR_DIR) && preg_match("/\\.({$config['cf_image_extension']})\$/i", $filename)) {
                $imgurl = str_replace(G5_URL, "", $src);
                $thumb_tag = '<a href="' . G5_BBS_URL . '/view_image.php?fn=' . urlencode($imgurl) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
            }
            $contents = str_replace($img_tag, $thumb_tag, $contents);
        }
    }
    return $contents;
}
开发者ID:kwon0281m,项目名称:gnuboard5,代码行数:98,代码来源:thumbnail.lib.php


示例3: md5

 $sql = " select iq_question, iq_answer from {$g5['g5_shop_item_qa_table']} where iq_id = '{$iq_id}' and md5(concat(iq_id,iq_time,iq_ip)) = '{$hash}' ";
 $row = sql_fetch($sql);
 $imgs = get_editor_image($row['iq_question']);
 for ($i = 0; $i < count($imgs[1]); $i++) {
     $p = parse_url($imgs[1][$i]);
     if (strpos($p['path'], "/data/") != 0) {
         $data_path = preg_replace("/^\\/.*\\/data/", "/data", $p['path']);
     } else {
         $data_path = $p['path'];
     }
     $destfile = G5_PATH . $data_path;
     if (is_file($destfile)) {
         @unlink($destfile);
     }
 }
 $imgs = get_editor_image($row['iq_answer']);
 for ($i = 0; $i < count($imgs[1]); $i++) {
     $p = parse_url($imgs[1][$i]);
     if (strpos($p['path'], "/data/") != 0) {
         $data_path = preg_replace("/^\\/.*\\/data/", "/data", $p['path']);
     } else {
         $data_path = $p['path'];
     }
     $destfile = G5_PATH . $data_path;
     if (is_file($destfile)) {
         @unlink($destfile);
     }
 }
 $sql = " delete from {$g5['g5_shop_item_qa_table']} where iq_id = '{$iq_id}' and md5(concat(iq_id,iq_time,iq_ip)) = '{$hash}' ";
 sql_query($sql);
 //$alert_msg = '0|삭제 하셨습니다.';
开发者ID:peb317,项目名称:gbamn,代码行数:31,代码来源:itemqaformupdate.php


示例4: apms_editor_image

function apms_editor_image($content, $mode = '')
{
    if (!$content) {
        return;
    }
    if ($mode == 'move') {
        return $content;
    }
    // 이동은 처리하지 않음
    $imgs = get_editor_image($content, false);
    for ($i = 0; $i < count($imgs[1]); $i++) {
        // 이미지 path 구함
        $imgurl = @parse_url($imgs[1][$i]);
        $destfile = $_SERVER['DOCUMENT_ROOT'] . $imgurl['path'];
        if (is_file($destfile)) {
            if ($mode == 'copy') {
                //다른이름으로 복사
                $ym = date('ym', G5_SERVER_TIME);
                $data_dir = G5_DATA_PATH . '/editor/' . $ym;
                $data_url = G5_DATA_URL . '/editor/' . $ym;
                if (!is_dir($data_dir)) {
                    @mkdir($data_dir, G5_DIR_PERMISSION);
                    @chmod($data_dir, G5_DIR_PERMISSION);
                }
                $filename = basename($destfile);
                $chars_array = array_merge(range(0, 9), range('a', 'z'), range('A', 'Z'));
                shuffle($chars_array);
                $shuffle = implode('', $chars_array);
                $file_name = abs(ip2long($_SERVER['REMOTE_ADDR'])) . '_' . substr($shuffle, 0, 8) . '_' . replace_filename($filename);
                $save_file = sprintf('%s/%s', $data_dir, $file_name);
                $save_url = sprintf('%s/%s', $data_url, $file_name);
                @copy($destfile, $save_file);
                @chmod($save_file, G5_FILE_PERMISSION);
                $content = str_replace($imgs[1][$i], $save_url, $content);
            } else {
                //이미지 삭제
                @chmod($destfile, G5_FILE_PERMISSION);
                @unlink($destfile);
            }
        }
    }
    return $mode == 'copy' ? $content : '';
}
开发者ID:peb317,项目名称:gbamn,代码行数:43,代码来源:apms.lib.php


示例5: get_itemuselist_thumbnail

function get_itemuselist_thumbnail($it_id, $contents, $thumb_width, $thumb_height, $is_create = false, $is_crop = true, $crop_mode = 'center', $is_sharpen = true, $um_value = '80/0.5/3')
{
    global $g5, $config;
    $img = $filename = $alt = "";
    if ($contents) {
        $matches = get_editor_image($contents, false);
        for ($i = 0; $i < count($matches[1]); $i++) {
            // 이미지 path 구함
            $p = parse_url($matches[1][$i]);
            if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
                $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
            } else {
                $data_path = $p['path'];
            }
            $srcfile = G5_PATH . $data_path;
            if (preg_match("/\\.({$config['cf_image_extension']})\$/i", $srcfile) && is_file($srcfile)) {
                $size = @getimagesize($srcfile);
                if (empty($size)) {
                    continue;
                }
                $filename = basename($srcfile);
                $filepath = dirname($srcfile);
                preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $matches[0][$i], $malt);
                $alt = get_text($malt[1]);
                break;
            }
        }
        if ($filename) {
            $thumb = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value);
            if ($thumb) {
                $src = G5_URL . str_replace($filename, $thumb, $data_path);
                $img = '<img src="' . $src . '" width="' . $thumb_width . '" height="' . $thumb_height . '" alt="' . $alt . '">';
            }
        }
    }
    if (!$img) {
        $img = get_it_image($it_id, $thumb_width, $thumb_height);
    }
    return $img;
}
开发者ID:peb317,项目名称:gbamn,代码行数:40,代码来源:shop.lib.php


示例6: preg_replace

        } else {
            $src_path = $p['path'];
        }
        $srcfile = G5_PATH . $src_path;
        $dstfile = preg_replace("/\\.([^\\.]+)\$/", "_" . $new_it_id . ".\\1", $srcfile);
        if (is_file($srcfile)) {
            copy($srcfile, $dstfile);
            $newfile = preg_replace("/\\.([^\\.]+)\$/", "_" . $new_it_id . ".\\1", $matchs[1][$i]);
            $cp['it_explan'] = str_replace($matchs[1][$i], $newfile, $cp['it_explan']);
        }
    }
    $sql = " update {$g5['g5_shop_item_table']} set it_explan = '" . addslashes($cp['it_explan']) . "' where it_id = '{$new_it_id}' ";
    sql_query($sql);
}
if ($cp['it_mobile_explan']) {
    $matchs = get_editor_image($cp['it_mobile_explan'], false);
    // 파일의 경로를 얻어 복사
    for ($i = 0; $i < count($matchs[1]); $i++) {
        $p = parse_url($matchs[1][$i]);
        if (strpos($p['path'], "/data/") != 0) {
            $src_path = preg_replace("/^\\/.*\\/data/", "/data", $p['path']);
        } else {
            $src_path = $p['path'];
        }
        $srcfile = G5_PATH . $src_path;
        $dstfile = preg_replace("/\\.([^\\.]+)\$/", "_" . $new_it_id . ".\\1", $srcfile);
        if (is_file($srcfile)) {
            copy($srcfile, $dstfile);
            $newfile = preg_replace("/\\.([^\\.]+)\$/", "_" . $new_it_id . ".\\1", $matchs[1][$i]);
            $cp['it_mobile_explan'] = str_replace($matchs[1][$i], $newfile, $cp['it_mobile_explan']);
        }
开发者ID:peb317,项目名称:gbamn,代码行数:31,代码来源:itemcopyupdate.php


示例7: sql_query

    $respond['wr_mb_id'] = $wr['mb_id'];
    if ($_POST['anonymous'] == 'y') {
        $anonymous = true;
    }
    $eb->respond($respond);
}
// 업로드된 파일 정보 가져오기
$result = sql_query(" select * from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ");
for ($i = 0; $row = sql_fetch_array($result); $i++) {
    if (!preg_match("/.(gif|jpg|jpeg|png)\$/i", $row['bf_file'])) {
        continue;
    }
    $wr_image['bf'][$i] = "/data/file/{$bo_table}/" . $row['bf_file'];
}
// 내용중의 링크 이미지 정보 가져오기
$matches = get_editor_image(stripslashes($wr_content), false);
if ($matches[1]) {
    foreach ($matches[1] as $k => $image) {
        $p = parse_url($image);
        $host = preg_replace("/www\\./i", "", $p['host']);
        $_host = preg_replace("/www\\./i", "", $_SERVER['HTTP_HOST']);
        $ex_url = '';
        if ($host != $_host) {
            $ex_url = "http://" . $host;
        }
        $wr_image['url'][$k] = $ex_url . $p['path'];
    }
}
if ($wr_image) {
    $wr_image = serialize($wr_image);
}
开发者ID:l2zeo,项目名称:eyoom_builder-1,代码行数:31,代码来源:write_update.skin.php


示例8: delete_editor_thumbnail

function delete_editor_thumbnail($contents)
{
    if (!$contents) {
        return;
    }
    // $contents 중 img 태그 추출
    $matchs = get_editor_image($contents);
    if (!$matchs) {
        return;
    }
    for ($i = 0; $i < count($matchs[1]); $i++) {
        // 이미지 path 구함
        $imgurl = parse_url($matchs[1][$i]);
        $srcfile = $_SERVER['DOCUMENT_ROOT'] . $imgurl['path'];
        $filename = preg_replace("/\\.[^\\.]+\$/i", "", basename($srcfile));
        $filepath = dirname($srcfile);
        $files = glob($filepath . '/thumb-' . $filename . '*');
        if (is_array($files)) {
            foreach ($files as $filename) {
                unlink($filename);
            }
        }
    }
}
开发者ID:sungkyuchun,项目名称:gnuboard5,代码行数:24,代码来源:common.lib.php


示例9: apms_it_write_thumbnail

function apms_it_write_thumbnail($it_id, $wr_content, $thumb_width, $thumb_height, $is_create = false, $is_crop = true, $crop_mode = 'center', $is_sharpen = true, $um_value = '80/0.5/3')
{
    global $g5, $config;
    $filename = $alt = "";
    $matches = get_editor_image($wr_content, false);
    $limg = array();
    $lalt = array();
    for ($i = 0; $i < count($matches[1]); $i++) {
        // 이미지 path 구함
        $p = @parse_url($matches[1][$i]);
        if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
            $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
        } else {
            $data_path = $p['path'];
        }
        $srcfile = G5_PATH . $data_path;
        //if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile)) {
        if (is_file($srcfile)) {
            $size = @getimagesize($srcfile);
            if (empty($size)) {
                continue;
            }
            $fileurl = $matches[1][$i];
            preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $matches[0][$i], $malt);
            $alt = get_text($malt[1]);
            break;
        } else {
            $limg[] = $matches[1][$i];
            preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $matches[0][$i], $malt);
            $lalt[] = get_text($malt[1]);
        }
        //}
    }
    if (!$filename) {
        //본문동영상 이미지 체크
        if (preg_match_all("/{동영상\\:([^}]*)}/is", $wr_content, $match)) {
            $match_cnt = count($match[1]);
            for ($i = 0; $i < $match_cnt; $i++) {
                $video = apms_video_info(trim(strip_tags($match[1][$i])));
                if (!$video['type']) {
                    continue;
                }
                $srcfile = apms_video_img($video['video_url'], $video['vid'], $video['type']);
                if (!$srcfile || $srcfile == 'none') {
                    continue;
                }
                $size = @getimagesize($srcfile);
                if (empty($size)) {
                    continue;
                }
                $fileurl = str_replace(G5_PATH, G5_URL, $srcfile);
                break;
            }
        }
    }
    if (!$filename) {
        //기타
        //링크
        if (count($limg) > 0) {
            $thumb = array('is_thumb' => false, 'src' => $limg[0], 'alt' => $lalt[0], 'org' => $limg[0], 'height' => '');
            return $thumb;
        }
        //상품
        $edt = false;
        $it = apms_it($it_id);
        $thumb = apms_it_thumbnail($it, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value);
        if (!$thumb['src']) {
            $thumb = array('is_thumb' => false, 'src' => '', 'alt' => '', 'org' => '', 'height' => '');
        }
        return $thumb;
    }
    $thumb = apms_thumbnail($fileurl, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value);
    $thumb['is_thumb'] = true;
    $thumb['alt'] = $alt;
    $thumb['org'] = $fileurl;
    return $thumb;
}
开发者ID:peb317,项目名称:gbamn,代码行数:77,代码来源:apms.shop.lib.php


示例10: get_view_thumbnail

function get_view_thumbnail($contents, $thumb_width = 0)
{
    global $board, $config;
    if (!$thumb_width) {
        $thumb_width = $board['bo_image_width'];
    }
    // $contents 중 img 태그 추출
    $matches = get_editor_image($contents, true);
    if (empty($matches)) {
        return $contents;
    }
    // Exif
    $exif = array();
    $is_exif = isset($board['as_exif']) && $board['as_exif'] ? true : false;
    // Lightbox
    $is_lightbox = false;
    if (isset($board['as_lightbox']) && $board['as_lightbox']) {
        $is_lightbox = true;
        apms_script('lightbox');
    }
    for ($i = 0; $i < count($matches[1]); $i++) {
        $img_tag = $matches[0][$i];
        $img = $matches[1][$i];
        preg_match("/src=[\\'\"]?([^>\\'\"]+[^>\\'\"]+)/i", $img, $m);
        $src = $m[1];
        preg_match("/style=[\"\\']?([^\"\\'>]+)/i", $img, $m);
        $style = $m[1];
        preg_match("/width:\\s*(\\d+)px/", $style, $m);
        $width = $m[1];
        preg_match("/height:\\s*(\\d+)px/", $style, $m);
        $height = $m[1];
        preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        $alt = get_text($m[1]);
        preg_match("/link=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        // APMS 추가
        $link = get_text($m[1]);
        preg_match("/align=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        // APMS 추가
        $align = get_text($m[1]);
        $align = $align ? ' align="' . $align . '" ' : '';
        preg_match("/class=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        // APMS 추가
        $class = get_text($m[1]);
        $class = $class ? ' ' . $align : '';
        // 이미지 path 구함
        $p = @parse_url($src);
        if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
            $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
        } else {
            $data_path = $p['path'];
        }
        $srcfile = G5_PATH . $data_path;
        $itemprop = $i == 0 ? ' itemprop="image" content="' . $src . '"' : '';
        if (is_file($srcfile)) {
            $size = @getimagesize($srcfile);
            if (empty($size)) {
                continue;
            }
            // jpg 이면 exif 체크
            if ($size[2] == 2 && function_exists('exif_read_data')) {
                $degree = 0;
                $exif = @exif_read_data($srcfile);
                if (!empty($exif['Orientation'])) {
                    switch ($exif['Orientation']) {
                        case 8:
                            $degree = 90;
                            break;
                        case 3:
                            $degree = 180;
                            break;
                        case 6:
                            $degree = -90;
                            break;
                    }
                    // 세로사진의 경우 가로, 세로 값 바꿈
                    if ($degree == 90 || $degree == -90) {
                        $tmp = $size;
                        $size[0] = $tmp[1];
                        $size[1] = $tmp[0];
                    }
                }
            }
            // 원본 width가 thumb_width보다 작다면 썸네일생성 안함
            if ($size[0] <= $thumb_width) {
                if ($width) {
                    $thumb_tag = '<img' . $itemprop . ' src="' . $src . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $align . ' class="img-tag' . $class . '"/>';
                } else {
                    $thumb_tag = '<img' . $itemprop . ' src="' . $src . '" alt="' . $alt . '"' . $align . ' class="img-tag' . $class . '"/>';
                }
                // $img_tag에 editor 경로가 있으면 원본보기 링크 추가
                if (!$link && (strpos($img_tag, G5_DATA_DIR . '/' . G5_EDITOR_DIR) || strpos($img_tag, G5_DATA_DIR . '/file')) && preg_match("/\\.({$config['cf_image_extension']})\$/i", basename($srcfile))) {
                    if ($is_lightbox) {
                        $caption = $alt ? ' data-title="' . $alt . '"' : '';
                        $thumb_tag = '<a href="' . $src . '" data-lightbox="view-lightbox"' . $caption . ' target="_blank">' . $thumb_tag . '</a>';
                    } else {
                        $thumb_tag = '<a href="' . G5_BBS_URL . '/view_image.php?fn=' . urlencode(str_replace(G5_URL, "", $src)) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
                    }
                }
                // Exif 정보출력
                if ($is_exif) {
//.........这里部分代码省略.........
开发者ID:peb317,项目名称:gbamn,代码行数:101,代码来源:thumbnail.lib.php


示例11: myshop_item_delete

 function myshop_item_delete($it_id)
 {
     global $g5, $is_auth;
     //거래내역이 있으면 그냥 통과
     if (!$is_auth) {
         $ct = sql_fetch(" select it_id from {$g5['g5_shop_cart_table']} where it_id = '{$it_id}' and od_id <> '' and ct_status != '쇼핑' ");
         if ($ct['it_id']) {
             return;
         }
     }
     //삭제시작
     $sql = " select it_explan, it_mobile_explan, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10\n\t\t\t\t\tfrom {$g5['g5_shop_item_table']} where it_id = '{$it_id}' ";
     $it = sql_fetch($sql);
     // 상품 이미지 삭제
     $dir_list = array();
     for ($i = 1; $i <= 10; $i++) {
         $file = G5_DATA_PATH . '/item/' . $it['it_img' . $i];
         if (is_file($file) && $it['it_img' . $i]) {
             @unlink($file);
             $dir = dirname($file);
             delete_item_thumbnail($dir, basename($file));
             if (!in_array($dir, $dir_list)) {
                 $dir_list[] = $dir;
             }
         }
     }
     // 이미지디렉토리 삭제
     //for($i=0; $i<count($dir_list); $i++) {
     //    if(is_dir($dir_list[$i]))
     //        rmdir($dir_list[$i]);
     //}
     // 상, 하단 이미지 삭제
     @unlink(G5_DATA_PATH . "/item/{$it_id}" . "_h");
     @unlink(G5_DATA_PATH . "/item/{$it_id}" . "_t");
     // 장바구니 삭제
     sql_query(" delete from {$g5['g5_shop_cart_table']} where it_id = '{$it_id}' and ct_status = '쇼핑' ");
     // 이벤트삭제
     sql_query(" delete from {$g5['g5_shop_event_item_table']} where it_id = '{$it_id}' ");
     // 사용후기삭제
     sql_query(" delete from {$g5['g5_shop_item_use_table']} where it_id = '{$it_id}' ");
     // 상품문의삭제
     sql_query(" delete from {$g5['g5_shop_item_qa_table']} where it_id = '{$it_id}' ");
     // 관련상품삭제
     sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id = '{$it_id}' or it_id2 = '{$it_id}' ");
     // 옵션삭제
     sql_query(" delete from {$g5['g5_shop_item_option_table']} where it_id = '{$it_id}' ");
     //------------------------------------------------------------------------
     // HTML 내용에서 에디터에 올라간 이미지의 경로를 얻어 삭제함
     //------------------------------------------------------------------------
     $imgs = get_editor_image($it['it_explan'], false);
     for ($i = 0; $i < count($imgs[1]); $i++) {
         $p = parse_url($imgs[1][$i]);
         if (strpos($p['path'], "/data/") != 0) {
             $data_path = preg_replace("/^\\/.*\\/data/", "/data", $p['path']);
         } else {
             $data_path = $p['path'];
         }
         $destfile = G5_PATH . $data_path;
         if (is_file($destfile)) {
             @unlink($destfile);
         }
     }
     $imgs = get_editor_image($it['it_mobile_explan'], false);
     for ($i = 0; $i < count($imgs[1]); $i++) {
         $p = parse_url($imgs[1][$i]);
         if (strpos($p['path'], "/data/") != 0) {
             $data_path = preg_replace("/^\\/.*\\/data/", "/data", $p['path']);
         } else {
             $data_path = $p['path'];
         }
         $destfile = G5_PATH . $data_path;
         if (is_file($destfile)) {
             @unlink($destfile);
         }
     }
     //------------------------------------------------------------------------
     // 상품 삭제
     sql_query(" delete from {$g5['g5_shop_item_table']} where it_id = '{$it_id}' ");
     // 댓글삭제
     apms_delete_comment($it_id);
     // 태그삭제
     apms_delete_tag($it_id);
     // 파일삭제
     apms_delete_file('item', $it_id);
     // 폴더삭제
     apms_delete_dir($it_id);
 }
开发者ID:peb317,项目名称:gbamn,代码行数:87,代码来源:itemlistupdate.php


示例12: ob_get_contents

            if (is_file($page_file)) {
                include_once $page_file;
            } else {
                echo '<br><br><p align="center">준비중 입니다.</p><br><br>';
            }
        } else {
            echo '<br><br><p align="center">존재하지 않는 페이지입니다.</p><br><br>';
        }
    }
    $page_content = ob_get_contents();
    ob_end_clean();
    $page_content = str_replace("./", $page_url . "/", $page_content);
}
// SEO
$seo_page_desc = apms_cut_text($page_content, 200);
$matches = get_editor_image($page_content, false);
$seo_page_img = $matches[1][0];
// 페이지스킨
$page_skin = $at['pskin'];
$page_skin_path = G5_SKIN_PATH . '/page/' . $page_skin;
$page_skin_url = G5_SKIN_URL . '/page/' . $page_skin;
include_once './_head.php';
if (G5_IS_MOBILE) {
    echo '<div class="page-wrap font-14">' . PHP_EOL;
} else {
    echo '<div class="page-wrap">' . PHP_EOL;
}
if ($page_skin && is_file($page_skin_path . '/page.skin.php')) {
    include_once $page_skin_path . '/page.skin.php';
} else {
    if ($header_skin) {
开发者ID:peb317,项目名称:gbamn,代码行数:31,代码来源:page.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_editor_js函数代码示例发布时间:2022-05-15
下一篇:
PHP get_editable_user_ids函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap