텍스트 정렬이 않되요ㅜㅜ > 그누4 질문답변

그누4 질문답변

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

텍스트 정렬이 않되요ㅜㅜ 정보

텍스트 정렬이 않되요ㅜㅜ

본문

http://www.onuri.co.kr/bbs/board.php?bo_table=04_4&wr_id=1568&sca=&sfl=wr_subject&stx=%C3%D6%BD%C5%B1%DB&sop=and

그림은 위 링크에서 다운받은 최신글 스킨을 적용했는데,

메뉴제목이 좌측으로 정렬되지 않고 거의 가운데에 어정띠게 있네요...

또, 밑에 게시글도 좌측으로 정렬회되지 않고 들쭉 날쭉 합니다.

그리고 게시글 제목길이도 너무 짧아요..메뉴 제목길이 수정은 알겠는데

아래 3개의 게시글 제목 길이는 대체 어디서 수정해야 할까요?

정확한 질문포인트를 다시 한 번 정리하면,

1. 메뉴제목(좌측정렬 방법)

2. 게시글제목(3개) 좌측정렬 방법

3. 게시글 제목(3개) 제목 길이 수정방법

(메뉴제목 길이 조정은 알고 있습니다.)

고수님들 도움 부탁드리겠습니다.

참고로 제가 적용한 최신글 소스 전체 올리겠습니다,

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

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

$img_width = '92'; //썸네일 가로길이
$img_height = '74'; //썸네일 세로길이
$img_quality = '9'; //퀼리티 100이하로 설정

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb'; //썸네일 이미지 생성 디렉토리

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>

<table align="center" cellpadding="0" cellspacing="0" width="99%" border="0">
<tr height="1">
<td bgcolor="#d9d9d9" colspan="3"></td>
</tr>
<tr>
<td width="1" bgcolor="#d9d9d9"></td>
<td>
<table cellpadding="0" cellspacing="2" width="100%">
<tr>
<td background="<?=$latest_skin_path?>/img/title_bg_25.gif">
<table cellpadding="5" cellspacing="0" width="100%" border="0">
<tr height="15">
<td> 
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font color="#555555" ><b><?=$board[bo_subject]?></b></font></a>
</td>
<td align="right"><span style="font-size: 12px; color: #646464; font-family:dotum; letter-spacing:-1;"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'> <img src="<?=$latest_skin_path?>/img/more.gif" border="0"></a></span></td>
</tr>
</table>
</td>
</tr>
</table>  
</td>
<td width="1" bgcolor="#d9d9d9"></td>
</tr>
<tr height="1">
<td bgcolor="#d9d9d9" colspan="3"></td>
</tr>
</table>

<table align="center" cellpadding="0" cellspacing="0" width="99%" border="0">
 <tr height="5"><td width="1" bgcolor="#d9d9d9"></td><td colspan="2"></td><td width="1" bgcolor="#d9d9d9"></td></tr>
 <? for ($i=0; $i<count($list); $i++) {?>
 <tr>
  <td width="1" bgcolor="#d9d9d9"></td>
  <td width="5"></td>
  <td height="21">
<!-- 게시물 추출 글자 설정 시작 -->
<table align="center" cellpadding="0" cellspacing="0" width="99%" border="0">   
<tr>
<!--게시물 아래 점선 색상을 바꾸고 싶으시면 211,211,211부분을, 게시물 추출부분 세로 길이를 늘리시려면 25을 수정하세요-->
<td width="20%" height="25" valign=middle style="PADDING-LEFT: 1px; PADDING-BOTTOM: 0px; PADDING-TOP: 2px" style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
 <?=$viewLayer?>
    <?
     // 게시물이 없으면 이미지 영역없음[2008-03-29]
     if( count($list) ) {
     
      $thumb = $thumb_path.'/'.$list[0][wr_id];
      if (!file_exists($thumb)) {
      $file = $list[0][file][0][path] .'/'. $list[0][file][0][file];
      // 업로드된 파일이 이미지라면
      if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
       $size = getimagesize($file);
       if ($size[2] == 1)
        $src = imagecreatefromgif($file);
       else if ($size[2] == 2)
        $src = imagecreatefromjpeg($file);
       else if ($size[2] == 3)
        $src = imagecreatefrompng($file);
       else
        break;

       $rate = $img_width / $size[0];
       $height = (int)($size[1] * $rate);

       // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
       if ($height < $img_height)
        // 계산된 이미지 높이로 복사본 이미지 생성
        $dst = imagecreatetruecolor($img_width, $height);
       else
        // 설정된 이미지 높이로 복사본 이미지 생성
        $dst = imagecreatetruecolor($img_width, $img_height);
       imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
       imagepng($dst, $thumb_path.'/'.$list[0][wr_id], $img_quality);
       chmod($thumb_path.'/'.$list[0][wr_id], 0606);
      }
      }

      if (file_exists($thumb)) $img_path = $thumb;
      else {
      // 최근게시물 본문 중 이미지태그를 검색하여 그 중 한개만 특정 사이즈로 크롭하여 보여준다.
      // 뉴스웹진 스타일 [2008-03-28]
      $data =  $list[0]['wr_content'] ;
                                              
      // 이미지 주소 찾기
      preg_match('/img.*?src=(.*?) /i', $data, $url_img);
      $img_path = $url_img[1];  // 그림 주소
      $del_str_arr = array('"', "'");
      $img_path = str_replace($del_str_arr, "", $img_path);
      $img_path = trim($img_path);          
      }

    // 이미지 경로가 없을 경우처리 [2008-03-28]
    if( trim(strrchr($img_path, "/")) == '/' ) $img_path = '';    
    $img_path = $img_path ? $img_path : $latest_skin_path.'/img/noimg.JPG';   
    ?>

     <a href='<?=$list[0][href]?>'><img src="<?=$img_path?>" width="<?=$img_width?>" height="<?=$img_height?>" border="0" /></a>  
   

    <? } ?>
    </td>
    <td width="98%" height="14" valign="middle" style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
    <?
    for ($i=0; $i<count($list); $i++) {
    //날짜표시
    $subject = $list[$i][subject];
    $b_subject = "<strong>".$list[$i][subject]."<strong>";
    ?>
<table align="center" cellpadding="0" cellspacing="0" width="90%" height="20" border="0">
<tr>
<td width="1" align="left"></td>
<td><span style='color:#777777;font-weight:bold;'>ㆍ</span><a href='<?=$list[$i][href]?>'><span class="th6">
<?if ($list[$i][is_notice])
        echo $b_subject;
       else
        echo $subject;
       ?></span></a>
       <span style="font-size:7pt;font-family:tahoma;color:#C27F9A;vertical-align:1px;"><?=$list[$i][comment_cnt]?>
       <?
    echo " " . $list[$i]['icon_new'];
    echo " " . $list[$i]['icon_hot'];
    //echo " " . $list[$i]['icon_file'];
    //echo " " . $list[$i]['icon_link'];
    //echo " " . $list[$i]['icon_secret'];
    echo "</td><td width=50 align=left>";
    //echo "<font color=#bababa class=small>{$list[$i][datetime2]}</font>";
        ?>
</span>
</td>
    <td width="60" align="center" class='small'><?=$list[$i][name]?></td>

</tr>
<? } ?>
<? if (count($list) == 0) { ?><font color=#6A6A6A>현재 등록된 글이 없습니다.</a><? } ?>
</table>
</td>
</tr>
</table>
<!--게시물 추출 글자 설정 끝-->
  <td width="1" bgcolor="#d9d9d9"></td>
  </tr>
  <? } ?>
  <? if (count($list) == 0) { ?><? } ?>
  <tr height="5"><td width="1" bgcolor="#d9d9d9"></td><td colspan="2"></td><td width="1" bgcolor="#d9d9d9"></td></tr>
  <tr height="1">
  <td bgcolor="#d9d9d9" colspan="4"></td>
 </tr>
</table>

  • 복사

댓글 전체

<table align="center" cellpadding="0" cellspacing="0" width="90%" height="20" border="0">
<tr>
<td width="1" align="left"></td>
<td><span style='color:#777777;font-weight:bold;'>ㆍ</span><a href='<?=$list[$i][href]?>'><span class="th6">
<?if ($list[$i][is_notice])
        echo $b_subject;
      else
        echo $subject;
      ?></span></a>
      <span style="font-size:7pt;font-family:tahoma;color:#C27F9A;vertical-align:1px;"><?=$list[$i][comment_cnt]?>
      <?
    echo " " . $list[$i]['icon_new'];
    echo " " . $list[$i]['icon_hot'];
    //echo " " . $list[$i]['icon_file'];
    //echo " " . $list[$i]['icon_link'];
    //echo " " . $list[$i]['icon_secret'];
    echo "</td><td width=50 align=left>";
    //echo "<font color=#bababa class=small>{$list[$i][datetime2]}</font>";
        ?>
</span>
</td>
</td>
    <td width="60" align="center" class='small'><?=$list[$i][name]?></td>
</tr>
=============================================================================================
이 부분... (라인번호가 없다보니 필요이상으로 많은 카피를 했네요. 여하튼..)
네번째줄...
<td><span style='color:#7..... 를 <td align="left"><span style='color:#7.... 로 해보세요.

글자수가 적게나오는건..
최신글 적용하시면서 <?=latest("스킨명", "게시판명", 게시글수, 표시되는 글자수);  ?> 하셨을텐데,
이부분을 수정하셔야 됩니다.
예를 들면.. <?=latest("basic", "board1", 5, 100); // ?> --> 여기서 100 값을 늘였다 줄였다 하면 됩니다.
table width 값에 맞게 조절해주셔야지 너무 길게 주면 줄바뀜 현상으로 보기 안좋습니다.뭐 이런식이죠.

제 짧은 소견에 이름출력되는 부분도 정렬을
<td width="60" align="center" class='small'><?=$list[$i][name]?></td> 말고
<td width="60" align="right" class='small'><?=$list[$i][name]?></td> 추천합니다. ㅎㅎ
순전히 제 취향이니 무시하시길...
퍼를로즈님 천재~!! 덕분에 제목길이 수정했고 좌측정렬도 잘되었어요..근데 아직 해결이 않된게...

위 그림에 보면 "경매상담하기"라는 메뉴제목 있잖아요? 그것도 좌측으로 정렬하고 싶은데 어디를
건드려야 할까요?ㅜㅜ
본문을 잘 뒤져서... 아래 부분의

<tr height="15">
<td>&nbsp;    <-- 요놈을 <td align="left" > 요롷게 바꿔보세요...
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font color="#555555" ><b><?=$board[bo_subject]?></b></font></a>
</td>

무슨 천재가 3년째 삽질만 한답니까... 저도 ctrl+C 와 ctrl+V 글구 여기 고수님들 도움으로 근근히 버티고 있는 초보랍니다.... 여하튼... 초보 화이팅~~~
범사에 많이많이 감사하시며 사시는군요... 
좀 더 배우시면 정말 별거아니라는걸 아실날이 오실거에요.
해결됬다니 다행이고 미력하나마 도움이 됐다니 저도 기쁘네요...
퍼플로즈님 감사합니다. 문제를 해결해주는데 감사 안할수가 없네요...참으로 고맙습니다. 초보도 아니고 아예 개념도 없는 왕초보라 회원님들께 민폐만 끼치고 있습니다..ㅜㅜ
© SIRSOFT
현재 페이지 제일 처음으로