Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
whitedot
2013-02-22 09:50:54 +09:00
5 changed files with 39 additions and 5 deletions

View File

@ -65,7 +65,7 @@ if ($row['cnt'] >= $board['bo_count_delete'] && !$is_admin)
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
//$sql = " select wr_id, mb_id, wr_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
$sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
$sql = " select wr_id, mb_id, wr_is_comment, wr_content from $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
@ -100,6 +100,9 @@ while ($row = sql_fetch_array($result))
}
}
// 에디터 썸네일 삭제
echo delete_editor_thumbnail($row['wr_content']);
// 파일테이블 행 삭제
sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ");

View File

@ -112,8 +112,10 @@ include_once(G4_LIB_PATH.'/popular.lib.php');
$cr_path = g4_path();
if($contrast_use == 'on') {
$cr_uri = $cr_path['curr_url'].'?contrast=off';
$cr = "ON";
} else {
$cr_uri = $cr_path['curr_url'].'?contrast=on';
$cr = "OFF";
}
if($_SERVER['QUERY_STRING']) {
$query_string = preg_replace("/contrast=(on|off)&?/", "", $_SERVER['QUERY_STRING']);
@ -123,7 +125,7 @@ include_once(G4_LIB_PATH.'/popular.lib.php');
unset($cr_path);
?>
<li>
<a href="<?=$cr_uri;?>">색상대비</a>
<a href="<?=$cr_uri;?>">색상대비<?=$cr?></a>
</li>
</ul>

View File

@ -331,7 +331,7 @@ function wrestSubmit()
return false;
}
if (this.oldsubmit && this.oldsubmit() == false)
if (this.oldsubmit && this.oldsubmit == false)
return false;
return true;

View File

@ -1720,4 +1720,34 @@ function delete_cache_latest($bo_table)
unlink($filename);
}
}
// 에디터 이미지 얻기
function get_editor_image($contents)
{
// $contents 중 img 태그 추출
$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+".str_replace(".", "\.", $_SERVER['HTTP_HOST'])."[^>\'\"]+)[\'\"]?[^>]*>/";
preg_match_all($pattern, $contents, $matchs);
return $matchs;
}
// 에디터 썸네일 삭제
function delete_editor_thumbnail($contents)
{
// $contents 중 img 태그 추출
$matchs = get_editor_image($contents);
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);
foreach(glob($filepath.'/thumb-'.$filename.'*') as $file) {
unlink($file);
}
}
}
?>

View File

@ -30,8 +30,7 @@ function get_view_thumbnail($contents)
}
// $contents 중 img 태그 추출
$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+".str_replace(".", "\.", $_SERVER['HTTP_HOST'])."[^>\'\"]+)[\'\"]?[^>]*>/";
preg_match_all($pattern, $contents, $matchs);
$matchs = get_editor_image($contents);
for($i=0; $i<count($matchs[1]); $i++) {
// 이미지 path 구함