테스트 사이트 - 개발 중인 베타 버전입니다

이번에는 스크립트좀..

· 13년 전 · 930 · 4
ㅍㅍㅍㅍ.png
if (!$view[file][$i][source]){
echo"동영상 준비중";
}
동영상이없으면
동영상준비중이라고 나타내라고되는건데요~
저런거말고 스크립트를써서...
<div id = "picture" style="display:none" >이부분이 활성화되게,...어떻게하나요?



<script language="JavaScript">
<!--
function OpenWin(url,intWidth,intHeight){
window.open(url, "ReadSlideShow", "scrollbars=no, resizable=no, width="+intWidth+",height="+intHeight+",left=50,top=50 ");return;
}
//-->
</script>

<? if ($view[file][0][view]) {?>
<?
for ($i=0; $i<=8; $i++) {
$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
}
?>

<input type="image" src="<?=$board_skin_path?>/img/pic.gif" name="what" value="사진" onMouseDown="move('사진');"><img src="<?=$board_skin_path?>/img/tum.gif"><input type="image" src="<?=$board_skin_path?>/img/video.gif" name="what" value="동영상"onMouseDown="move('동영상');"></td></tr><tr><td height="400"><div id = "picture" style="display:none" style="width:485px; height:400px"><? if ($view[file][0][view]) {?><img src="<?=$image[0]?>" name=gallery_img width="485" height="400" border=0 value=0><? } else {?><img src="<?=$board_skin_path?>/img/noimg.gif" width="485" height="400" border=0 value=0><? } ?></a></div>
<script language='javascript'>
var array_image = new Array();
</script>

<? // 파일 출력
if (!$view[file][$i][source]){
echo"zzz";



}
for ($i = 0; $i < count( $file ); $i++ )


if(preg_match("/\.(swf|wmv|asf|flv)$/i", $view[file][$i][source]) && !$gsg_view[12]) {

//if (substr($view[file][$i][source], -3) == "swf") { //플래시


//저장 파일명
$sql = " select bf_source, bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ";
$file = sql_fetch($sql);
$filepath = "$g4[path]/data/file/$bo_table/$file[bf_file]";

//구분자
$gsg_f_content = explode("|",$view[file][$i][content]);
$gsg_f_content[0] = strtolower($gsg_f_content[0]); //소문자
$gsg_f_size = explode("x",$gsg_f_content[0]);

//사이즈
if ($gsg_f_size[0]) { $gsg_f_size[0] = $gsg_f_size[0]; } else { $gsg_f_size[0] = "483"; }
if ($gsg_f_size[1]) { $gsg_f_size[1] = $gsg_f_size[1]; } else { $gsg_f_size[1] = "398"; }

if (!$gsg_view[14]) { $img_line_box = "style='border:1px solid;'"; } //이미지 박스 유/무

?>



<?
}
?>

<div id = "video" style="display:block" style="width:483px; height:400px">
<?
echo "<div class='ImgBoxBlock' ".$img_line_box."style='width:480px; height:379px'><EMBED width='$gsg_f_size[0]' height='$gsg_f_size[1]' src='$filepath' ></div>";
if ($view[file][$i][content]) {
echo "<div class=ImgFileContentText>";
echo "&nbsp;· ".$gsg_f_content[1];
echo "</div>";
}

?>

</div>

<script language="JavaScript">

function move (key) {

if (key=="사진"){

document.all["picture"].style.display ='inline';
document.all["video"].style.display ='none';
} else if (key=="동영상"){
document.all["picture"].style.display ='none';
document.all["video"].style.display ='inline';
}
}


</script>


<!-- <?
// 파일 출력
if ($view[file][0][view]) // 이미지 2번만 출력
echo $view[file][0][view] . "<p>";
?> <?
// 파일 출력
if ($view[file][1][view]) // 이미지 2번만 출력
echo $view[file][1][view] . "<p>";
?>

-->
여기가관련 소스들입니다....


사진을보시면 사진,동영상있잔아요~사진누르면 사진나오고 동영상누르면 동영상이 보여지는 겁니다~
초기 display를 동영상이 보이게해놧는데
만약에 동영상이없으면
display를 사진에 block해놓고싶습니다.

if (!$view[file][$i][source]){picture.style.display="none"; }
if (!$view[file][$i][source]){picture = "style='display:none;'"; }

이렇게하니깐안되요 ㅠ

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 4개

13년 전
if (!$view[file][$i][source]){
echo"동영상 준비중";
}
가 자바스크립트 내부에 있다고 했을때
if (!$view[file][$i][source]){
echo"document.all[\"video\"].style.display ='none';";
echo"document.all[\"picture\"].style.display ='inline';";
}else{
echo"document.all[\"video\"].style.display ='inline';";
echo"document.all[\"picture\"].style.display ='none';";
}
13년 전
안되면 오류좀보내주시죵 ㅎㅎ;;; 돌려본게 아니라서;; ㅇㅇㅋ....
13년 전
쓰고나니 이프문부터 이상하네요...;
일단 사진이랑 동영상부터 판단하셔야 할거같은데요...;
자체해결....ㅎㅎ 빠른답변ㄳㄳ

게시글 목록

번호 제목
284438
284437
284435
284430
284420
284417
284409
284401
284399
284397
284380
284378
284371
284370
284366
284364
284360
284357
284355
284354