이미지 파일이 없을때, 혹은 이미지 파일을 등록하지 않을때 표시방법좀 알려주세요 > 그누4 질문답변

그누4 질문답변

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

이미지 파일이 없을때, 혹은 이미지 파일을 등록하지 않을때 표시방법좀 알려주세요 정보

이미지 파일이 없을때, 혹은 이미지 파일을 등록하지 않을때 표시방법좀 알려주세요

본문

안녕하세요.
여기저기 고수님들 올려놓은 방법들을 감사히 잘 사용하고 있습니다만,
한가지 잘 되지 않는 부분이 있어서 이렇게 도움을 요청합니다..

본문 : http://sir.co.kr/bbs/tb.php/g4_tiptech/7921/c66b0c0b767f8972dfea6282b499688b

브레인하트님이 올려주신 소스인데요..
이 소스를 적용해서 잘 사용하고 있는데..이미지를 등록하면 잘 나옵니다..

하지만, 이미지 표출을 7개로 했을때...3개만 등록하고 4개는 등록을 하지 않았을때..
기본으로 지정한 이미지를 노출하는 방법좀 알려주세요..

다시 말씀드려서....
이미지 등록을 하지 않았을때...기본으로 지정한 이미지가 노출이 되게 하고 싶습니다...









<SCRIPT language=javascript>
var currentItem = '1';
var rotateTimmer;
var isStop = '0';
</SCRIPT>

<TABLE onmouseover="isStop='1'" onmouseout="isStop='0'" cellSpacing=0
cellPadding=0 width=400 border=1>
  <TBODY>
  <TR>
    <TD width=400 height=400>
      <DIV id="oTransContainer"
      style="width:400px; height:400px; position:absolute; left:0px; top:0px; z-index:1; FILTER: progid:DXImageTransform.Microsoft.Iris(irisStyle='CIRCLE', motion='out', duration=0.6);"><!-- ITEM 1 -->
     
 
  <DIV id="oDIV1" style="width:400px; height:400px; position:absolute; left:0px; top:0px; z-index:1; visibility:visible;">
     
     
     
     
     

<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==0) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

//    echo"<a href='{$view[file][$i][href]}'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=$image[$i]><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=image_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=images_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='300' height=300 border='1'><br>";

echo"<img src='$f_path/$f_file' width='300' height=300 border='1' onclick=image_window('$image[$i]') style='cursor:pointer'>";
echo"<br>";

// echo"</a><br>";
    echo"이미지크기:<font color='red'>{$view[file][$i][image_width]} x {$view[file][$i][image_height]}</font><br>";
    echo"이미지설명:<font color='blue'>{$view[file][$i][bf_content]}</font><br>";
    echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>


 















  </DIV><!-- ITEM 2 -->
      <DIV id="oDIV2"
      style="width:400px; height:400px; position:absolute; left:0px; top:0px; z-index:1; visibility:hidden;">
 
 
 
 
 


<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==1) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

//    echo"<a href='{$view[file][$i][href]}'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=$image[$i]><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=image_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=images_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='300' height=300 border='1'><br>";

echo"<img src='$f_path/$f_file' width='300' height=300 border='1' onclick=image_window('$image[$i]') style='cursor:pointer'>";
echo"<br>";

// echo"</a><br>";
    echo"이미지크기:<font color='red'>{$view[file][$i][image_width]} x {$view[file][$i][image_height]}</font><br>";
    echo"이미지설명:<font color='blue'>{$view[file][$i][bf_content]}</font><br>";
    echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>












 
 
 
 
 
  </DIV><!-- ITEM 3 -->
      <DIV id="oDIV3"
      style="width:373px; height:214px; position:absolute; left:0px; top:0px; z-index:1; visibility:hidden;">



 

<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==2) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

//    echo"<a href='{$view[file][$i][href]}'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=$image[$i]><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=image_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=images_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='300' height=300 border='1'><br>";

echo"<img src='$f_path/$f_file' width='300' height=300 border='1' onclick=image_window('$image[$i]') style='cursor:pointer'>";
echo"<br>";

// echo"</a><br>";
    echo"이미지크기:<font color='red'>{$view[file][$i][image_width]} x {$view[file][$i][image_height]}</font><br>";
    echo"이미지설명:<font color='blue'>{$view[file][$i][bf_content]}</font><br>";
    echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>


 




      </DIV><!-- ITEM 4 -->
      <DIV id="oDIV4"
      style="width:373px; height:214px; position:absolute; left:0px; top:0px; z-index:1; visibility:hidden;">





 

<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==3) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

//    echo"<a href='{$view[file][$i][href]}'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=$image[$i]><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=image_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='$img_width' border='0'><br>";
//echo"<a href=# onclick=images_window('$image[$i]') style='cursor:pointer'><img src='$f_path/$f_file' width='300' height=300 border='1'><br>";

echo"<img src='$f_path/$f_file' width='300' height=300 border='1' onclick=image_window('$image[$i]') style='cursor:pointer'>";
echo"<br>";

// echo"</a><br>";
    echo"이미지크기:<font color='red'>{$view[file][$i][image_width]} x {$view[file][$i][image_height]}</font><br>";
    echo"이미지설명:<font color='blue'>{$view[file][$i][bf_content]}</font><br>";
    echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>


 









</DIV></DIV></TD></TR>

  <TR>
        <TD width=400 height=200>

<!-- <A href="javascript:swapItem(1,%20true)">111111111111</A><BR>
<A href="javascript:swapItem(2,%20true)">2222222222</A><BR>
<A href="javascript:swapItem(3,%20true)">3333333333333333333333</A><BR>
<A href="javascript:swapItem(4,%20true)">4444444444444444444444</A>  -->




















<A href="javascript:swapItem(1,%20true)">






<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==0) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

echo"<img src='$f_path/$f_file' width='50' height=50 border='1' >";
echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>







</A><BR>

<A href="javascript:swapItem(2,%20true)">






<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==1) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

echo"<img src='$f_path/$f_file' width='50' height=50 border='1' >";
echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>









</A><BR>

<A href="javascript:swapItem(3,%20true)">





<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==2) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

echo"<img src='$f_path/$f_file' width='50' height=50 border='1' >";
echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>






</A><BR>

<A href="javascript:swapItem(4,%20true)">





<?
 // 파일 출력
 for($i=0; $i<=count($view[file]); $i++) {
  if($view[file][$i][view])
 ###############################################
  $img_width=100;
  $f_type=""; $f_style=""; $f_path=""; $f_file ="";
  // echo"파일타입: {$view[file][$i][image_type]}<br>";
  $f_type=$view[file][$i][image_type];
  if($f_type=='1' || $f_type=='2' || $f_type=='3' ||$f_type=='6' || $f_type=='7') $f_style="img";
    else if($f_type=='4') $f_style="movie_img";//쭉..형태추가
    else if($f_type=='0') $f_style="file_link";
    $f_file = urlencode($view[file][$i][file]);
    $f_path="{$view[file][$i][path]}";

  ###############################################
//  if($view[file][$i][source])

if($view[file][$i][source] && $i==3) // 이미지출력변수
  {$view[file][$i][href]="$f_path/$f_file";
// $image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];

$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
    if(preg_match("/\.(jp[e]?g|tif|bmp|gif|png)$/i","$f_file")
    && file_exists("$f_path/$f_file")&& $f_style=="img")
  {//이미지면 끝

echo"<img src='$f_path/$f_file' width='50' height=50 border='1' >";
echo"<br>";
  }else
  echo $view[file][$i][view];
  }//if 다운소스가 존재하면
  ###############################################
  }//for 끝
  ?>









        </A>


</TD></TR></TBODY></TABLE>



<SCRIPT language=javascript>
function swapItem(mode, clicked)
{
clearTimeout(rotateTimmer);

if(isStop == '1' && clicked != true)
{
rotateTimmer = setTimeout('swapItem('+mode+')', 5000);
return;
}

oTransContainer.filters[0].Apply();

oDIV1.style.visibility="hidden";
oDIV2.style.visibility="hidden";
oDIV3.style.visibility="hidden";
oDIV4.style.visibility="hidden";
eval("oDIV" + mode).style.visibility="visible";

oTransContainer.filters[0].Play();

//document.sideBar.src = '$board_skin_path/bgi_bar' + (parseInt(mode) - 1) + '.gif';
// eval("btn" + currentItem).src = '$board_skin_path/img/btn_no' + currentItem + '_off.gif';
// eval("btn" + mode).src = '$board_skin_path/img/btn_no' + mode + '_on.gif';

currentItem = mode;

if(mode >= 4)
{
nextItem = 1;
}
else
{
nextItem = parseInt(mode) + 1;
}

rotateTimmer = setTimeout('swapItem('+nextItem+')', 5000);
}

swapItem(currentItem);
</SCRIPT>

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT