꼴

view 페이지에서 파일첨부 이미지 눌렀을때 게시판에 따라서 새창 뜨고, 안뜨고 제어하기

· 2010-03-26 (금) 11:18:01 · 1669 · 1
view 페이지에서 파일첨부된 이미지 눌렀을때 게시판에 따라서 특정 게시판은 새창이 뜨고, 나머지 게시판은 새창이 안뜨게 하고 싶습니다.

검색해보니, lib 에서 common.lib.php파일중 아래의 소스에서 onclick를 삭제하면 되던데요,
위에서 원하는 것처럼 하려면, 사이에 조건문을 걸어주면 될거 같은데, 조건문 구현하는걸
잘 모르겠습니다.

if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<div style=\"overflow:hidden; width:{$width}px\"><img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'></div>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";


이걸


if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다


if ($bo_table=tb32)

return "<div style=\"overflow:hidden; width:{$width}px\"><img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'></div>";

else

return "<div style=\"overflow:hidden; width:{$width}px\"><img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' style='cursor:pointer;' title='$content'></div>";

else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";


이렇게 해봤는데, 안되네요..ㅠㅠ
개념은 알겠는데, 구현하려니, 기본이 안되어 있어서..그런거 같습니다.

도와주십시요~
|

댓글 1개

if($bo_table=="테이블명") {
if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<div style=\"overflow:hidden; width:{$width}px\"><img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' style='cursor:pointer;' title='$content'></div>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";
}
else{
if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<div style=\"overflow:hidden; width:{$width}px\"><img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'></div>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";
}
대충 일케 하면 될꺼 같네요...^^;;안되도 책임 못져요~ㅋㅋ
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-03-26 조회 1,804
10-03-26 조회 926
10-03-26 조회 1,670
10-03-26 조회 945
10-03-26 조회 1,420
10-03-26 조회 2,148
10-03-26 조회 1,693
10-03-26 조회 1,651
10-03-26 조회 932
10-03-26 조회 1,136
10-03-26 조회 943
10-03-26 조회 1,104
10-03-26 조회 1,247
10-03-26 조회 952
10-03-26 조회 860
10-03-25 조회 1,088
10-03-25 조회 1,654
10-03-25 조회 1,695
10-03-25 조회 1,810
10-03-25 조회 1,708