게시판 내용 숨김 클릭시 내용 출력 [ 참고 ]

by 조쉬 posted Jul 24, 2018
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
  <td><strong><font color="#FFFFFF">번호</font></strong></td>
  <td><strong><font color="#FFFFFF">제목</font></strong></td>
  <td><strong><font color="#FFFFFF">작성자</font></strong></td>
  <td><strong><font color="#FFFFFF">작성일</font></strong></td>
  <td><strong><font color="#FFFFFF">평점</font></strong></td>
 </tr>
 <?
 $code="게시판 코드명";
 include "../게시판정보경로";
 $sql = "select * from 테이블명 where code = '$code' and notice != 'Y' and prdcode='$prdcode' order by prino desc";
 $result = mysql_query($sql) or error(mysql_error());

 if($bbs_info->rows == "") $bbs_info->rows = 20;
 if($bbs_info->lists == "") $bbs_info->lists = 5;

 $total = mysql_num_rows($result);
 $page_count = ceil($total/$bbs_info->rows);
 if(!$page || $page > $page_count) $page = 1;
 $start = ($page-1)*$bbs_info->rows;
 $no = $total-$start;
 if($start>1) mysql_data_seek($result,$start);

 while(($row = mysql_fetch_object($result)) && $bbs_info->rows)
 {
?>
<script>
 var tt<?=$no?> = 1;
 function div_view_<?=$no?>(){
  if(tt<?=$no?>==1){
   document.all.cview_<?=$no?>.style.display="";
   tt<?=$no?> = 0;
  }else{
   document.all.cview_<?=$no?>.style.display="none";    
   tt<?=$no?> = 1;
  }
 }
</script>
<?
  if($row->privacy == "Y")
  {
   $row->subject = "<span onclick='div_view_$no();' style='cursor:hand'>$row->subject</span> <img src=/images/bbsimg/lock.gif>";
   $row->content = "비밀글입니다. 게시판으로 이동후 비밀번호를 입력하세요.";
  }
  else
  {
    $row->subject = "<span onclick='div_view_$no();' style='cursor:hand'>$row->subject</span>";
  }
  $re_space = ""; for($ii=0; $ii < $row->depno; $ii++) $re_space .= "&nbsp;&nbsp;";   // respace
  $row->subject = $re_space.$row->subject;
  if($row->depno != 0) $row->subject = "<img src=/images/bbsimg/re.gif>".$row->subject;  // re
  switch($row->star)
  {
   case 1:
    $star = "/img/icon_star_1";
    break;
   case 2:
    $star = "/img/icon_star_2";
    break;
   case 3:
    $star = "/img/icon_star_3";
    break;
   case 4:
    $star = "/img/icon_star_4";
    break;
   case 5:
    $star = "/img/icon_star_5";
    break;
  } 
?>
 <tr>
  <td align="center" height="25"><?=$no?></td>
  <td><?=$row->subject?></td>
  <td align="center"><?=$row->name?></td>
  <td align="center"><?=$row->wdate?></td>
  <td align="center"><img src="<?=$star?>.gif"></td>
 </tr>
 <tr>
  <td colspan="5" style="padding: 10 20 20 20">
<div id="cview_<?=$no?>" style="display:none">  
    <?=$row->content?><br>
    <a href="/bbs/input.php?code=review&prdcode=<?=$prdcode?>&mode=reply&idx=<?=$row->idx?>"><strong>[ 답변하기 ]</strong></a>
</div>
  </td>
 </tr>

 <tr>
  <td colspan="5" height="1" background="/images/bbsimg/board_bg.gif"></td>
 </tr>
<?
  $no--;
  $bbs_info->rows--;
 }
?>
</table>



Articles

3 4 5 6 7 8 9 10 11 12