플레시게임 게시판 오류한가지만 더.. ㅠ > 그누4 질문답변

그누4 질문답변

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

플레시게임 게시판 오류한가지만 더.. ㅠ 정보

플레시게임 게시판 오류한가지만 더.. ㅠ

본문

리스트.php 를 수정하는데 경로좀 봐주세요.
_____________________________________________________

<?
if (!defined("_GNUBOARD_")) exit; // 
?>
<?
$noIMG = $board_skin_path."/img/noimg.gif"; //[필수](URL)
$max = 120 ; //[필수](픽셀) 썸네일 이미지의 가로세로(긴쪽)의 최대치.
$resol = 60 ; //[필수](퍼센트%) 생성되는 썸네일의 JPG압축률.
$str = 15 ; //[필수](글자수) 썸네일 밑의 제목의 글자수.

function smaller( $W, $H ) {
 global $max, $thum_W, $thum_H ;

  if ( $W > $H ) { //가로형일 경우.
   $thum_W = $max ;
   $thum_H = ceil( $H * ( $max / $W ) );
  }
  if ( $W < $H ) { //세로형일 경우.
   $thum_H = $max ;
   $thum_W = ceil( $W * ( $max / $H ) );
  }
  if ( $W == $H ) { //정사각형일 경우.
   $thum_W = ceil( $max * 0.8 );
   $thum_H = ceil( $max * 0.8 );
  }
 
 return $thum_W ;
 return $thum_H ;
}


function maker( $thum_W, $thum_H ) {
 global $thum, $resol, $ori, $ori_info ;

  //$newImg = ImageCreate($thum_W,$thum_H); // GD라이브러리 2.0 (이하일 경우)
  $newImg = ImageCreateTrueColor($thum_W,$thum_H); // GD라이브러리 2.0 전용함수
  
  if($ori_info[2]=="2") $origImg=ImageCreateFromjpeg($ori);
  if($ori_info[2]=="3") $origImg=ImageCreateFrompng($ori);
  
  //ImageCopyResized($newImg,$origImg,0,0,0,0,$thum_W,$thum_H,ImageSX($origImg),ImageSY($origImg));
  imageCopyResampled($newImg,$origImg,0,0,0,0,$thum_W,$thum_H,ImageSX($origImg),ImageSY($origImg));
  
  Imagejpeg($newImg, $thum, $resol );
  
  chmod($thum,0707);
  ImageDestroy($newImg);
  ImageDestroy($origImg);

 return $thum ;
}
?>


<table width="<?=$width?>" cellpadding=0 cellspacing=0>
 <tr>
  <td width="214">
<? if (!$wr_id) {  ?>
<?
    $cnt = 1;
    $sql = " SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ";
    $row = sql_fetch($sql);
    $arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
    $str = "";
    $str .= "";
    for ($i=0; $i<count($arr); $i++)
        if (trim($arr[$i]))  {
  $sql1 = " SELECT count(*) as cCount FROM $write_table WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ";
      $row1 = sql_fetch($sql1);         
            $str .= "<td><a href='./board.php?bo_table=$bo_table&page=$page&mode=$mode&sca=$arr[$i]'>$arr[$i] ($row1[cCount])</a> <font color='#ffffff'>|</font> </td>";
  if ($cnt == 5) { $cnt = 1; $str .= ""; }
      $cnt++;
    }
   
    $sql2 = " SELECT count(*) as cCount FROM $write_table WHERE wr_comment >= 0 ";
    $row2 = sql_fetch($sql2);
    $Total_Cat = $row2[cCount]
?>
       
<? } ?>
</td>
 </tr>
 <tr>
  <td height="32" background="<?=$board_skin_path?>/img/title_bg2.gif">
  <table border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td>
    <form name=fsearch method=get style="margin:0px;">
     <input type=hidden name=bo_table value="<?=$bo_table?>">
     <input type=hidden name=sca      value="<?=$sca?>">
     <div align="center">
     <table width="100%" border="0" cellspacing="1">
      <tr>
       <td width=* align="right">
       <table border="0" width="100%" cellspacing="1">
        <tr>
         <td>
        <select name=sfl size="1">
            <option value='wr_subject'>게임명</option>
            <option value='wr_content'>본문내용</option>
            <option value='wr_10'>간단소개</option>
           
           
        </select></td>
         <td>
       <input name=stx maxlength=15 size=34 itemname="검색어" required value="<?=$stx?>"></td>
         <td>
       <select name=sop size="1">
       <option value=and>and</option>
       <option value=or>or</option></select></td>
        </tr>
       </table>
       </td>
       <td align=right width="33">
       <input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle name="I1"></td>
       <td align=right width="33">
        <? if ($admin_href) { ?><a href="../basic/<?=$admin_href?>"><img src="../basic/<?=$board_skin_path?>/img/btn_admin.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><?}?></td>
      </tr>
     </table>
     </div>
    </form></td>
   </tr>
  </table></td>
 </tr>
 <tr>
  <td valign="top">
  <form name="fboardlist" method="post">
   <input type="hidden" name="bo_table" value="<?=$bo_table?>">
   <input type="hidden" name="sfl"  value="<?=$sfl?>">
   <input type="hidden" name="stx"  value="<?=$stx?>">
   <input type="hidden" name="spt"  value="<?=$spt?>">
   <input type="hidden" name="page" value="<?=$page?>">
   <input type="hidden" name="sw"   value="">
   <table width="100%" cellpadding="0" cellspacing="0">
    <tr>
     <td height="10"></td>
    </tr>
    <tr>
        <? for ($i=0; $i<count($list); $i++) {
      // Thumbnail
                  $image = urlencode($list[$i][file][0][file]);
                  $ori="$g4[path]/data/file/$bo_table/" . $image;
                  $ext = strtolower(substr(strrchr($ori,"."), 1)); //확장자
                  if ( $ext=="gif"||$ext=="jpg"||$ext=="jpeg"||$ext=="png"||$ext=="bmp"||$ext=="tif"||$ext=="tiff") $ori_info=getimagesize($ori); else $ori_info="";
                  if ( $ori_info[2]=="2" || $ori_info[2]=="3" ) { //원파일이 [ 2JPG, 2JPEG, 3PNG ] 경우.
            $thum = $ori."" ;
            if ( file_exists($thum) ) { // Thumbnail [O] 경우 
           $thum_info = getimagesize ($thum);
        $thum_W = $thum_info[0] ;
        $thum_H = $thum_info[1] ; 
              } else { // Thumbnail [X] 경우
         if ( smaller( $ori_info[0], $ori_info[1] ) ) {
    maker( $thum_W, $thum_H );
       }
           }
                } else if ( $ori_info[2]=="1" || $ori_info[2]=="6" || $ori_info[2]=="7" ) { //원파일이 [ 1GIF,6BMP,7TIF ] 경우.
        if ( smaller( $ori_info[0], $ori_info[1] ) ) {
    $thum = $ori ;
       }
               } else { //원파일이 [ 1,2,3,6,7 ] 아닐 경우.
               $thum = $noIMG ;
               }
              ?>
        
              <td height="10" valign="top">
     <table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
       <td valign="top" width="1">
       <table border="0" cellspacing="0" cellpadding="0">
        <tr>
         <td valign="top">
         <table border="0" cellspacing="1" bgcolor="#E1E1E1" cellpadding="3">
          <tr>
           <td bgcolor="#FFFFFF">
           <p align="center">
           <a href="<?=$list[$i][href]?>">
           <img src='<?=$thum?>' alt='상세보기' width="72" height="66" border=0></a>          </tr>
         </table></td>
        </tr>
        
       </table></td>
       <td width="5"> </td>
       <td valign="top">
       <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
         <td>
         <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
           <td>
           <table border="0" width="100%" cellspacing="1">
            <tr>
             
             <td colspan=2>
             <b><font color="#0A7299"><?=$list[$i][subject]?></font></b> <?=$list[$i][comment_cnt]?> <?=$list[$i][icon_new]?> <?=$list[$i][icon_hot]?></td>
            </tr>
            <tr>
             <td width=47><img src="<?=$board_skin_path?>/img/hit_level.gif"></td>
        <td align=left><?if($list[$i][wr_hit] > 100){?> <font color=ff0001>
             +++++</font>
      <?}else if($list[$i][wr_hit] > 70){?><font color=ff0001>++++<font color=999999>+</font>
      <?}else if($list[$i][wr_hit] > 50){?>+++<font color=999999>++</font>
      <?}else if($list[$i][wr_hit] > 30){?>++<font color=999999>+++</font>
      <?}else{?>+<font color=999999>++++</font><?}?></td>
             
            </tr>
            <tr>
             
             <td width=47>
              <a href="<?=$list[$i][ca_name_href]?>"><img src="<?=$board_skin_path?>/img/genre.gif"></td>
              <td align=left><font style='font-size:12px;'><?=$list[$i][ca_name]?></font></a></td>
            </tr>
            <tr>
             
             <td width=47><img src="<?=$board_skin_path?>/img/short_title.gif"></td><td align=left><span class=hit><font style='font-size:12px;'><?=cut_str(strip_tags($list[$i][wr_10]),90,"...")?></font></span></td>
            </tr>
            
            </table></td>
          </tr>
          <tr>
           <td> 
           </td>
          </tr>
         </table></td>
        </tr>
       </table></td>
      </tr>
     </table></td>

        <?php
        if($i % 2 == 1){
          echo "</tr><tr>";
        }
        ?>
        <? } ?>
            </tr>
    <tr>
     <td  height="3"></td>
    </tr>
   </table>
        <? if (count($list) == 0) { echo "  <table width=100% border=0 cellpadding=0 cellspacing=0 ><tr><td height=100 align=center> 아직없음.</td></tr></table>"; } ?>
       </form></td>
 </tr>
 <tr>
  <td height=2 bgcolor=#EFEFEF></td>
 </tr>
 <tr>
  <td bgcolor=#0A7299 height=2></td>
 </tr>
 <tr>
  <td valign="top">
       <table width="100%" cellspacing="0" cellpadding="0">
   <tr>
    <td width="60">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
                <? if ($list_href) { ?>
                  <td><a href="<?=$list_href?>">
      <img src="<?=$board_skin_path?>/img/btn_list.gif" vspace="10" border="0"></a></td>
                <? } ?>
                  <td>
                  <? if ($is_checkbox) { ?>
                    <a href="javascript:select_delete();">
      <img src="<?=$board_skin_path?>/img/btn_select_delete.gif" hspace="2" vspace="10" border="0"></a></td>
      <td><a href="javascript:select_copy('copy');">
      <img src="<?=$board_skin_path?>/img/btn_select_copy.gif" vspace="10" border="0"></a></td>
      <td><a href="javascript:select_copy('move');">
      <img src="<?=$board_skin_path?>/img/btn_select_move.gif" hspace="2" vspace="10" border="0"></a><? } ?></td>
     </tr>
    </table></td>
    <td align="center" height=58> 
            <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 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; \">$1</font></b>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:; font-size:9pt; color:#FF6600;\">$1</font></b>", $write_pages);
        ?>
            <?=$write_pages?>
            <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
            </td>
    <td width="60" align="right">
            <? if ($write_href) { ?>
            <a href="<?=$write_href?>">
    <img src="<?=$board_skin_path?>/img/btn_write.gif" vspace="10" border="0"></a>
            <? } ?>
          </td>
   </tr>
  </table></td>
 </tr>
 <tr>
  <td valign="top"><br></td>
 </tr>
</table>

<script language="JavaScript">
function all_checked(sw)
{
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str)
{
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete()
{
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                      
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>

<!-- 게시판 목록 끝 -->


------------------------------------------------------

이상하게 리스트.php 를 나모로 불러와서 수정후 저장하려면 파일경로가 바뀌어서 제대로
출력이 안되는데요.. 이게 나모의 문제인지 아니면 아까 write.php 의 경로를 바꿔서 그런건지
알수가 없네요.
그냥 보드 크기만 줄였는데.. 왜 경로가 바뀌어서 이미지들이 전부 잘 안보이는지요?

  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로