g5 merge 충돌 수정
This commit is contained in:
14
.gitignore
vendored
14
.gitignore
vendored
@ -1,16 +1,10 @@
|
|||||||
dbconfig.php
|
!.gitignore
|
||||||
log
|
|
||||||
.htaccess
|
|
||||||
data
|
|
||||||
data/
|
|
||||||
test
|
|
||||||
.htaccess
|
|
||||||
config.php
|
|
||||||
data/
|
data/
|
||||||
test/
|
test/
|
||||||
sirgle
|
sirgle/
|
||||||
test.php
|
test.php
|
||||||
*.key
|
*.key
|
||||||
g5_tree
|
|
||||||
*.sh
|
*.sh
|
||||||
cheditor5/
|
cheditor5/
|
||||||
|
log
|
||||||
|
g5_tree
|
||||||
|
|||||||
@ -133,15 +133,16 @@ var list_delete_php = 'popular_list.php';
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php if ($is_admin == 'super'){ ?>
|
|
||||||
<div class="btn_list01 btn_list">
|
|
||||||
<button type="submit">선택삭제</button>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if ($is_admin == 'super'){ ?>
|
||||||
|
<div class="btn_list01 btn_list">
|
||||||
|
<button type="submit">선택삭제</button>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page="); ?>
|
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page="); ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -21,16 +21,20 @@
|
|||||||
var width = $this.width();
|
var width = $this.width();
|
||||||
|
|
||||||
$img.each(function() {
|
$img.each(function() {
|
||||||
$(this).removeAttr("width")
|
|
||||||
.removeAttr("height")
|
|
||||||
.css("width","")
|
|
||||||
.css("height", "");
|
|
||||||
|
|
||||||
if($(this).data("width") == undefined)
|
if($(this).data("width") == undefined)
|
||||||
$(this).data("width", $(this).width());
|
$(this).data("width", $(this).width());
|
||||||
|
|
||||||
if($(this).data("width") > width) {
|
if($(this).data("width") > width) {
|
||||||
$(this).css("width", "100%");
|
$(this).removeAttr("width")
|
||||||
|
.removeAttr("height")
|
||||||
|
.css("width","")
|
||||||
|
.css("height", "");
|
||||||
|
|
||||||
|
if($(this).data("width") > width) {
|
||||||
|
$(this).css("width", "100%");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(this).attr("width", $(this).data("width"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2006,7 +2006,8 @@ function get_editor_image($contents)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// $contents 중 img 태그 추출
|
// $contents 중 img 태그 추출
|
||||||
$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
|
//$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
|
||||||
|
$pattern = "/<img([^>]*)>/iS";
|
||||||
preg_match_all($pattern, $contents, $matchs);
|
preg_match_all($pattern, $contents, $matchs);
|
||||||
|
|
||||||
return $matchs;
|
return $matchs;
|
||||||
|
|||||||
@ -22,13 +22,13 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
|
|||||||
$write_table = $g5['write_prefix'].$bo_table;
|
$write_table = $g5['write_prefix'].$bo_table;
|
||||||
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
|
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
|
||||||
$write = sql_fetch($sql);
|
$write = sql_fetch($sql);
|
||||||
$matchs = get_editor_image($write['wr_content']);
|
$matches = get_editor_image($write['wr_content']);
|
||||||
$edt = true;
|
$edt = true;
|
||||||
|
|
||||||
for($i=0; $i<count($matchs[1]); $i++)
|
for($i=0; $i<count($matches[1]); $i++)
|
||||||
{
|
{
|
||||||
// 이미지 path 구함
|
// 이미지 path 구함
|
||||||
$p = parse_url($matchs[1][$i]);
|
$p = parse_url($matches[1][$i]);
|
||||||
if(strpos($p['path'], "/data/") != 0)
|
if(strpos($p['path'], "/data/") != 0)
|
||||||
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||||
else
|
else
|
||||||
@ -47,7 +47,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
|
|||||||
$filename = basename($srcfile);
|
$filename = basename($srcfile);
|
||||||
$filepath = dirname($srcfile);
|
$filepath = dirname($srcfile);
|
||||||
|
|
||||||
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matchs[0][$i], $malt);
|
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
|
||||||
$alt = get_text($malt[1]);
|
$alt = get_text($malt[1]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -84,14 +84,25 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
|||||||
$thumb_width = $board['bo_image_width'];
|
$thumb_width = $board['bo_image_width'];
|
||||||
|
|
||||||
// $contents 중 img 태그 추출
|
// $contents 중 img 태그 추출
|
||||||
$matchs = get_editor_image($contents);
|
$matches = get_editor_image($contents);
|
||||||
|
|
||||||
if(empty($matchs))
|
if(empty($matches))
|
||||||
return $contents;
|
return $contents;
|
||||||
|
|
||||||
for($i=0; $i<count($matchs[1]); $i++) {
|
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];
|
||||||
|
|
||||||
// 이미지 path 구함
|
// 이미지 path 구함
|
||||||
$p = parse_url($matchs[1][$i]);
|
$p = parse_url($src);
|
||||||
if(strpos($p['path'], "/data/") != 0)
|
if(strpos($p['path'], "/data/") != 0)
|
||||||
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||||
else
|
else
|
||||||
@ -154,14 +165,18 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
|||||||
else
|
else
|
||||||
$thumb_file = $filename;
|
$thumb_file = $filename;
|
||||||
|
|
||||||
$img_tag = $matchs[0][$i];
|
|
||||||
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $img_tag, $malt);
|
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $img_tag, $malt);
|
||||||
$alt = get_text($malt[1]);
|
$alt = get_text($malt[1]);
|
||||||
$thumb_tag = '<img src="'.G5_URL.str_replace($filename, $thumb_file, $data_path).'" alt="'.$alt.'"/>';
|
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에 editor 경로가 있으면 원본보기 링크 추가
|
||||||
if(strpos($matchs[1][$i], 'data/editor') && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
|
$img_tag = $matches[0][$i];
|
||||||
$imgurl = str_replace(G5_URL, "", $matchs[1][$i]);
|
if(strpos($img_tag, 'data/editor') && 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>';
|
$thumb_tag = '<a href="'.G5_BBS_URL.'/view_image.php?fn='.urlencode($imgurl).'" target="_blank" class="view_image">'.$thumb_tag.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user