g5 merge 충돌 수정

This commit is contained in:
chicpro
2013-12-13 09:33:11 +09:00
5 changed files with 51 additions and 36 deletions

14
.gitignore vendored
View File

@ -1,16 +1,10 @@
dbconfig.php
log
.htaccess
data
data/
test
.htaccess
config.php
!.gitignore
data/
test/
sirgle
sirgle/
test.php
*.key
g5_tree
*.sh
cheditor5/
log
g5_tree

View File

@ -133,15 +133,16 @@ var list_delete_php = 'popular_list.php';
</tbody>
</table>
<?php if ($is_admin == 'super'){ ?>
<div class="btn_list01 btn_list">
<button type="submit">선택삭제</button>
</div>
<?php } ?>
</form>
</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&amp;page="); ?>
<script>

View File

@ -21,16 +21,20 @@
var width = $this.width();
$img.each(function() {
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
.css("height", "");
if($(this).data("width") == undefined)
$(this).data("width", $(this).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"));
}
});
}

View File

@ -2006,7 +2006,8 @@ function get_editor_image($contents)
return false;
// $contents 중 img 태그 추출
$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
//$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
$pattern = "/<img([^>]*)>/iS";
preg_match_all($pattern, $contents, $matchs);
return $matchs;

View File

@ -22,13 +22,13 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$write_table = $g5['write_prefix'].$bo_table;
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
$write = sql_fetch($sql);
$matchs = get_editor_image($write['wr_content']);
$matches = get_editor_image($write['wr_content']);
$edt = true;
for($i=0; $i<count($matchs[1]); $i++)
for($i=0; $i<count($matches[1]); $i++)
{
// 이미지 path 구함
$p = parse_url($matchs[1][$i]);
$p = parse_url($matches[1][$i]);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
@ -47,7 +47,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$filename = basename($srcfile);
$filepath = dirname($srcfile);
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matchs[0][$i], $malt);
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
$alt = get_text($malt[1]);
break;
@ -84,14 +84,25 @@ function get_view_thumbnail($contents, $thumb_width=0)
$thumb_width = $board['bo_image_width'];
// $contents 중 img 태그 추출
$matchs = get_editor_image($contents);
$matches = get_editor_image($contents);
if(empty($matchs))
if(empty($matches))
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 구함
$p = parse_url($matchs[1][$i]);
$p = parse_url($src);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
@ -154,14 +165,18 @@ function get_view_thumbnail($contents, $thumb_width=0)
else
$thumb_file = $filename;
$img_tag = $matchs[0][$i];
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $img_tag, $malt);
$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 경로가 있으면 원본보기 링크 추가
if(strpos($matchs[1][$i], 'data/editor') && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
$imgurl = str_replace(G5_URL, "", $matchs[1][$i]);
$img_tag = $matches[0][$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>';
}