diff --git a/head.sub.php b/head.sub.php index d8ff7b812..c70802579 100644 --- a/head.sub.php +++ b/head.sub.php @@ -60,11 +60,14 @@ var g4_cookie_domain = ""; var g4_is_gecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1; // 사라질 변수 var g4_is_ie = navigator.userAgent.toLowerCase().indexOf("msie") != -1; - + \ No newline at end of file diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index 07286dcae..cf512daa9 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -8,6 +8,68 @@ function it_img_thumb($filename, $filepath, $thumb_width, $thumb_height, $is_cre return thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create); } +function get_board_contents($contents) +{ + if(!G4_IS_MOBILE) + return $contents; + + $dvc_width = intval($_COOKIE['device_width']); + + if(!$dvc_width) + return $contents; + + // 썸네일 width 설정 + $thumb_width = 320; + + if($dvc_width >= 1000) { + return $contents; + } else if($dvc_width >= 760 && $dvc_width < 1000) { + $thumb_width = 760; + } else if($dvc_width >= 480 && $dvc_width < 760) { + $thumb_width = 480; + } + + // $contents 중 img 태그 추출 + $pattern = "/]*src=[\'\"]?([^>\'\"]+".str_replace(".", "\.", $_SERVER['HTTP_HOST'])."[^>\'\"]+)[\'\"]?[^>]*>/"; + preg_match_all($pattern, $contents, $matchs); + + for($i=0; $i

@@ -125,7 +126,8 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 for ($i=0; $i<=count($view['file']); $i++) { if ($view['file'][$i]['view']) { - echo $view['file'][$i]['view']; + //echo $view['file'][$i]['view']; + echo get_board_contents($view['file'][$i]['view']); } } @@ -133,7 +135,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 } ?> -
+