도와주세요 핼프미~~~~ㅜㅜ > 그누4 질문답변

그누4 질문답변

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

도와주세요 핼프미~~~~ㅜㅜ 정보

도와주세요 핼프미~~~~ㅜㅜ

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :  http://dtc21.dyndns.org:2003/test/bbs/board.php?bo_table=gallery2

지금 갤러리를 만들고 있는데요 왼쪽은 큰 그림이고 오른쪽은 작은 그림 5개로 되어있는데요
오늘쪽 작은 그림을 롤오버하면 왼쪽에 그림이 바뀌는건 됬어요. 문제는 제목도 같이 바꾸고 싶거은요.  거진 다온거 같은데 뭔가가 잘 안되서 도움을 청합니다. 도와주세요.  표시한 부분만 수정하면 될꺼 같은데 봐주세요.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

//작은 이미지 사이즈
$small_width = "88";
$small_height = "63";
//큰이미지
$large_width = "590";
$large_height = "470";

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 7;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 게시판 목록 시작 -->
<?
    $i = "0";
$list_file = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");
$list_lfile_view[$i] = "<img id=large src='./../data/file/$bo_table/$list_file[bf_file]' border=0 width=$large_width height=$large_height>";
          $latest_subject_l = $list[$i][subject];              <-----이부분이 제목을 받는부분이구요
?>

<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0 border="1">

  <tr>
    <td>
   
    <table width="100%" cellpadding=0 cellspacing=0 border="0">
   
    <tr><td height="25">
<table width="100%" border="1">
  <tr>
    <td><?=$bo_table?></td>
  </tr>
</table>

</td></tr>
    <tr>
    <td height="100" align="center" valign="middle">
   
        <table cellpadding="0" cellspacing="0" border="0" bordercolor="#E1E1E2">
          <tr>
  <td width="5"></td>
            <td><?=$list_lfile_view[$i]?></td>
          </tr>
<tr>
          <td><?=$latest_subject_l?></td>                  <-----이부분이 제목을 출력하는 부분
          </tr>
    </table>
   
    </td>
  </tr>
  <tr>
    <td height="10">
   
    <table width="100%" cellspacing="0" cellpadding="0" >
    <tr>
      <td width="100%" align="center" height=30>
  <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; }
       
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
            </td>
          </tr>
        </table>
       
        </td>
  </tr>
</table>
</td>

    <td align="center" valign="top">
    <table width="100%" border="1">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

    <table width="100%" cellpadding=0 cellspacing=0 border="0">
      <tr>
        <td height="110">
       
       
        <table cellpadding="0" cellspacing="0" border="1">
<tr><td>

<table width="100%" cellpadding="0" cellspacing="0">
<tr>   
  <td width='93' height='90' align='center' valign='middle'>
<table cellpadding="0" cellspacing="0" border=1 bordercolor="#E1E1E2">
<tr>
        <!-- 목록 -->
    <? for ($i=0; $i<count($list); $i++) {
$list_file = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");


$list_file_view[$i] = "<img src='./../data/file/$bo_table/$list_file[bf_file]' style='cursor:pointer' border=0 width=$small_width height=$small_height onmouseover=\"document.all('large').src='./../data/file/$bo_table/$list_file[bf_file]'\">";

요부분에 onmouseover 이부분을 고치면 될꺼 같은데 document.all해서 id 값주고 해봐도 뭔가 잘안되요 고수님에 손길을 부탁드려요.

                                    $latest_subject_l = $list[$i][subject]; // 제목
$latest_subject = cut_str($list[$i][subject], 12, '...'); // 제목

echo $list_file_view[$i];
echo "<br>";
echo $latest_subject;
echo "</td>";

if($i%2) {
echo "</tr><tr>";
}

} ?>
  </td>     
      </tr>     
  </table>
    </td>
   
    <? if (count($list) == 0) { echo "<td colspan='$colspan' height=50 align=center>게시물이 없습니다.</td>"; } ?>
    </tr>
   
  </table>
 
  </td>
 
  </tr>
</table></td>
      </tr>
    </table></td>
  </tr>
</table>







  <!-- 버튼 링크 -->
  <form name=fsearch method=get style="margin:0px;">
    <input type=hidden name=bo_table value="<?=$bo_table?>">
    <input type=hidden name=sca      value="<?=$sca?>">
    <table width=<?=$width?> cellpadding=0 cellspacing=0 align=center>
      <tr>
        <td width="50%" height="40"><? if ($list_href) { ?>
          <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a>
          <? } ?>
          <? if ($write_href) { ?>
          <a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a>
          <? } ?>
          <? if ($is_checkbox) { ?>
          <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a> <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a> <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
          <? } ?>
        </td>
        <td width="50%" align="right"></td>
      </tr>
    </table>
  </form>
  </td>
 
  </tr>
 
</table>
  • 복사

댓글 전체

td에도 id를 부여해서 마우스오버시 변하도록 만들어주셔야겠죠. 대충 스크립트 하나 만들어 드립니다.
<script language="javascript">
function mouseover(a,b){
document.getElementById('large').src= a;
document.getElementById('td_id').innerHTML = b;
}
</script>
사용법 마우스 오버되는곳에 mouseover('이미지주소','제목');
이런식으로 사용하시면됩니다.
먼저 적어놓은 스크립트를 추가하시고 큰이미지가 출력되는곳에 제목도 함께 출력이되잖아요?

<td><?=$latest_subject_l?></td> 이부분의 <td>에 id를 부여하시구요.
document.getElementById('td_id').innerHTML = b;에서 td_id는 님이 부여하실 id적으세요

$list_file_view[$i] = "<img src='./../data/file/$bo_table/$list_file[bf_file]' style='cursor:pointer' border=0 width=$small_width height=$small_height onmouseover=\"document.all('large').src='./../data/file/$bo_table/$list_file[bf_file]'\">";

여기 onmouseover에서 document.all('large').src 대신 mouseover('./../data/file/$bo_table/$list_file[bf_file]','$latest_subject'); 적으시면 될듯하네요.
마우스 오버시 출력되는 제목이 한줄씩 밀려있는듯하구요. 제목길이가 변하면서 테이블 크기도 바뀌어서 위치가 변경되는듯합니다. 테이블 정렬을 다시해보세요
오른쪽 이미지 밑에적힌 제목과 마우스오버시 출력되는 제목이 다르게 설정되어있네요. 왜그런지 이유부터 우선 파악하셔야겠습니다. 두개가 동일하게 출력되도록 만들어보세요.
© SIRSOFT
현재 페이지 제일 처음으로