최신글 제목길이문의 > 그누4 질문답변

그누4 질문답변

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

최신글 제목길이문의 정보

최신글 제목길이문의

본문

이스킨을 쓰는데요,..
리스트의 제목길이는 줄였는데
이미지밑에 글자수 어떻게 줄여야하나요?
재목이 길어지면 3줄로 나오네요..ㅜㅜ
 
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$latest_img    = "$g4[path]/img/latest/";
?>
<style>
.rtop, .rbottom{display:block; background: #ffffff;} 
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden; background: #F0F0F0;}
.rtop2, .rbottom2{display:block; background: #f0f0f0;}
.rtop2 *, .rbottom2 *{display: block; height: 1px; overflow: hidden; background: #f9f9f9;}
.rtop3, .rbottom3{display:block; background: #ffffff;} 
.rtop3 *, .rbottom3 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop5, .rbottom5{display:block; background: #ffffff;} 
.rtop5 *, .rbottom5 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop6, .rbottom6{display:block; background: #ffffff;} 
.rtop6 *, .rbottom6 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}
.r5{margin: 0 5px}
.r6{margin: 0 3px}
.r7{margin: 0 2px}
.r8{margin: 0 1px; height: 2px}
</style>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<div style="background-color:white; width:395px;" align=center>
    <p style="background-color:white; width:395px;"><table width="395" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($k=0; $k<count($list); $k++)
{
    if ($k > 0)
     $title =  cut_str(get_text($list[$k][wr_subject]),29);
    $content = cut_str(get_text($list[$k][wr_content]), 10);
    $img = "$g4[path]/data/file/{$list[$k][bo_table]}/".urlencode($list[$k][file][0][file]);
    if (!file_exists($img) || !$list[$k][file][0][file])
    $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
 $thumbx=100;
 $thumby=75;
 $thumbyy = $thumby+6;
    $destfile =$img.'Thumb';
   
    $size = @getimagesize($img);
    if(is_array($size) && !is_file($destfile)) {
     switch($size[2]) {
      case(1) :
       if(function_exists('ImageCreateFromGif')) $im = ImageCreateFromGif($img);
       break;
      case(2) :
       if(function_exists('ImageCreateFromJpeg')) $im = ImageCreateFromJpeg($img);
       break;
      case(3) :
       if(function_exists('ImageCreateFromPng')) $im = ImageCreateFromPng($img);
       break;
     }
     $fixsize = mando_image_size($size[0], $size[1], $thumbx, $thumby);
     if($im) {
      if($k==0) @exec("rm ".dirname($_SERVER[SCRIPT_FILENAME])."/data/file/$bo_table/*Thumb-rf");
      if(function_exists('ImageCreateTrueColor')) $newim = ImageCreateTrueColor($fixsize[x],$fixsize[y]);
      else $newim = ImageCreate($fixsize[x],$fixsize[y]);
      if(function_exists('ImageCopyResampled')) ImageCopyResampled($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      else ImageCopyResized($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      ImageDestroy($im);
      ImageJpeg($newim, $destfile, 100);
      ImageDestroy($newim);
      unset($im, $newim);
     }
     $list[$k][img][x] = $fixsize[x];
     $list[$k][img][y] = $fixsize[y];
    } else {
     if(is_file($destfile)) {
      $size = @getimagesize($destfile);
      $list[$k][img][x] = $size[0];
      $list[$k][img][y] = $size[1];
     } else {
      $img = "";
      $size = @getimagesize($img);
      $list[$k][img][x] = $thumbx;
      $list[$k][img][y] = $thumby;
     }
    }
    if(is_file($destfile))$img = $destfile;
 if($k==0){   
    echo <<<HEREDOC
    <td align="center" width="86">
      <table width=100 cellpadding="0" cellspacing="0" border="0" style="padding:0px;">
       <tr align=center>
        <td width=100 align="center"  style='padding-top:0px;'>
             <div align=center><table width=100 align="center"  bgcolor='#ffffff' cellpadding="3" cellspacing="0" border="0">
          <tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$k][href]}"><img src=" {$destfile}" width="{$list[$k][img][x]}" height="{$list[$k][img][y]}" border="0" alt="$content"></a></td>
          </tr>
         </table></div>
        </td>
       </tr>
       <tr>
        <td height=17 align="center" valign="middle" style='padding-top:5px;padding-bottom:5px;border:0px solid #777777'><a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#444444'>{$list[$k][wr_subject]}</a></td>
       </tr>
      </table>
     </td>
  <td align="center" >
      <table width="100%" height=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;" >
HEREDOC;
 }else{
  echo <<<HEREDOC
         <tr>
        <td height=17 align="left" valign="middle" style='padding-top:2px;padding-bottom:2px;border:0px solid #777777'> <img src="$latest_skin_path/img/board_icon.gif" width="9" height="13"> <a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#999999'>[{$list[$k][bo_subject]}]</a> <a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#444444'>$title</a></td>
       </tr>
HEREDOC;
   if($i<(count($list)-1)){echo "<tr><td colspan='9' height='1'></td></tr>";}
 }
}
?></table></table>
  • 복사

댓글 전체

중간에 보시면 {$list[$k][wr_subject]} 이 있습니다 이게 출력부분인데
if($k==0){ 
    echo <<<HEREDOC
부분 사이에
if($k==0){
    $list[$k][wr_subject] = conv_subject($list[$k][wr_subject], 10, "…");  //10은 출력글자수
    echo <<<HEREDOC
로 바꾸시면 될듯하네요
for ($k=0; $k<count($list); $k++)
{
    if ($k > 0)
    $title =  cut_str(get_text($list[$k][wr_subject]),29);
    $content = cut_str(get_text($list[$k][wr_content]), 10);
    $img = "$g4[path]/data/file/{$list[$k][bo_table]}/".urlencode($list[$k][file][0][file]);
    if (!file_exists($img) || !$list[$k][file][0][file])
    $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

cut_str 명령이 해당글자수를 제어하는 명령입니다.
$title =  cut_str(get_text($list[$k][wr_subject]),29);
이부분보면 현재 29자까지 나오게되어있네요..이러니 3줄을 넘겠죠.
보통 이런경우 13자쯤이어야 한줄로 나오겠네요
밑에 덮어쒸우기 하시고....<?=latest_group("cunic_group","그룹명", 6, 12);?> 이 부분에서 조정해 보세요.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$latest_img    = "$g4[path]/img/latest/";
?>
<style>
.rtop, .rbottom{display:block; background: #ffffff;} 
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden; background: #F0F0F0;}
.rtop2, .rbottom2{display:block; background: #f0f0f0;}
.rtop2 *, .rbottom2 *{display: block; height: 1px; overflow: hidden; background: #f9f9f9;}
.rtop3, .rbottom3{display:block; background: #ffffff;} 
.rtop3 *, .rbottom3 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop5, .rbottom5{display:block; background: #ffffff;} 
.rtop5 *, .rbottom5 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop6, .rbottom6{display:block; background: #ffffff;} 
.rtop6 *, .rbottom6 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}
.r5{margin: 0 5px}
.r6{margin: 0 3px}
.r7{margin: 0 2px}
.r8{margin: 0 1px; height: 2px}
</style>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<div style="background-color:white; width:395px;" align=center>
    <p style="background-color:white; width:395px;"><table width="395" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($k=0; $k<count($list); $k++)
{
    if ($k > 0)
    $title =  cut_str(get_text($list[$k][wr_subject]),30);
    $content = cut_str(get_text($list[$k][wr_content]), 50);
    $wr_subject = cut_str(get_text($list[$k][wr_subject]), 15, '...');  //목록 글 줄이는 함수
    $img = "$g4[path]/data/file/{$list[$k][bo_table]}/".urlencode($list[$k][file][0][file]);
    if (!file_exists($img) || !$list[$k][file][0][file])
    $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
 $thumbx=100;
 $thumby=75;
 $thumbyy = $thumby+6;
    $destfile =$img.'Thumb';
 
    $size = @getimagesize($img);
    if(is_array($size) && !is_file($destfile)) {
    switch($size[2]) {
      case(1) :
      if(function_exists('ImageCreateFromGif')) $im = ImageCreateFromGif($img);
      break;
      case(2) :
      if(function_exists('ImageCreateFromJpeg')) $im = ImageCreateFromJpeg($img);
      break;
      case(3) :
      if(function_exists('ImageCreateFromPng')) $im = ImageCreateFromPng($img);
      break;
    }
    $fixsize = mando_image_size($size[0], $size[1], $thumbx, $thumby);
    if($im) {
      if($k==0) @exec("rm ".dirname($_SERVER[SCRIPT_FILENAME])."/data/file/$bo_table/*Thumb-rf");
      if(function_exists('ImageCreateTrueColor')) $newim = ImageCreateTrueColor($fixsize[x],$fixsize[y]);
      else $newim = ImageCreate($fixsize[x],$fixsize[y]);
      if(function_exists('ImageCopyResampled')) ImageCopyResampled($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      else ImageCopyResized($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      ImageDestroy($im);
      ImageJpeg($newim, $destfile, 11);
      ImageDestroy($newim);
      unset($im, $newim);
    }
    $list[$k][img][x] = $fixsize[x];
    $list[$k][img][y] = $fixsize[y];
    } else {
    if(is_file($destfile)) {
      $size = @getimagesize($destfile);
      $list[$k][img][x] = $size[0];
      $list[$k][img][y] = $size[1];
    } else {
      $img = "";
      $size = @getimagesize($img);
      $list[$k][img][x] = $thumbx;
      $list[$k][img][y] = $thumby;
    }
    }
    if(is_file($destfile))$img = $destfile;
 if($k==0){ 
    echo <<<HEREDOC
    <td align="center" width="86">
      <table width=100 cellpadding="0" cellspacing="0" border="0" style="padding:0px;">
      <tr align=center>
        <td width=100 align="center"  style='padding-top:0px;'>
            <div align=center><table width=100 align="center"  bgcolor='#ffffff' cellpadding="3" cellspacing="0" border="0">
          <tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$k][href]}"><img src=" {$destfile}" width="{$list[$k][img][x]}" height="{$list[$k][img][y]}" border="0" alt="$content"></a></td>
          </tr>
        </table></div>
        </td>
      </tr>
      <tr>
        <td height=17 align="center" valign="middle" style='padding-top:5px;padding-bottom:5px;border:0px solid #777777'><a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#444444'>{$list[$k][subject]}</a></td>
      </tr>
      </table>
    </td>
  <td align="center" >
      <table width="100%" height=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;" >
HEREDOC;
 }else{
  echo <<<HEREDOC
        <tr>
        <td height=17 align="left" valign="middle" style='padding-top:2px;padding-bottom:2px;border:0px solid #777777'>&nbsp;<img src="$latest_skin_path/img/board_icon.gif" width="9" height="13"> <a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#999999'>[{$list[$k][bo_subject]}]</a> <a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#444444'>$title</a></td>
      </tr>
HEREDOC;
  if($i<(count($list)-1)){echo "<tr><td colspan='9' height='1'></td></tr>";}
 }
}
?></table></table>
wr_ 안 지웠군요.
밑에꺼 복사해서 붙여넣기 하시면 제대로 출력 될겁니다.
<?=latest_group("cunic_group","그룹명", 6, 12);?> 글자 목록은 이 부분에서 조정하시면 됩니다.


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$latest_img    = "$g4[path]/img/latest/";
?>
<style>
.rtop, .rbottom{display:block; background: #ffffff;} 
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden; background: #F0F0F0;}
.rtop2, .rbottom2{display:block; background: #f0f0f0;}
.rtop2 *, .rbottom2 *{display: block; height: 1px; overflow: hidden; background: #f9f9f9;}
.rtop3, .rbottom3{display:block; background: #ffffff;} 
.rtop3 *, .rbottom3 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop5, .rbottom5{display:block; background: #ffffff;} 
.rtop5 *, .rbottom5 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop6, .rbottom6{display:block; background: #ffffff;} 
.rtop6 *, .rbottom6 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}
.r5{margin: 0 5px}
.r6{margin: 0 3px}
.r7{margin: 0 2px}
.r8{margin: 0 1px; height: 2px}
</style>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<div style="background-color:white; width:395px;" align=center>
    <p style="background-color:white; width:395px;"><table width="395" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($k=0; $k<count($list); $k++)
{
    if ($k > 0)
    $title =  cut_str(get_text($list[$k][wr_subject]),29);
    $content = cut_str(get_text($list[$k][wr_content]), 10);
$subject = cut_str(get_text($list[$k][subject]), 15, '...');  //목록 글 줄이는 함수
    $img = "$g4[path]/data/file/{$list[$k][bo_table]}/".urlencode($list[$k][file][0][file]);
    if (!file_exists($img) || !$list[$k][file][0][file])
    $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
 $thumbx=100;
 $thumby=75;
 $thumbyy = $thumby+6;
    $destfile =$img.'Thumb';
 
    $size = @getimagesize($img);
    if(is_array($size) && !is_file($destfile)) {
    switch($size[2]) {
      case(1) :
      if(function_exists('ImageCreateFromGif')) $im = ImageCreateFromGif($img);
      break;
      case(2) :
      if(function_exists('ImageCreateFromJpeg')) $im = ImageCreateFromJpeg($img);
      break;
      case(3) :
      if(function_exists('ImageCreateFromPng')) $im = ImageCreateFromPng($img);
      break;
    }
    $fixsize = mando_image_size($size[0], $size[1], $thumbx, $thumby);
    if($im) {
      if($k==0) @exec("rm ".dirname($_SERVER[SCRIPT_FILENAME])."/data/file/$bo_table/*Thumb-rf");
      if(function_exists('ImageCreateTrueColor')) $newim = ImageCreateTrueColor($fixsize[x],$fixsize[y]);
      else $newim = ImageCreate($fixsize[x],$fixsize[y]);
      if(function_exists('ImageCopyResampled')) ImageCopyResampled($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      else ImageCopyResized($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      ImageDestroy($im);
      ImageJpeg($newim, $destfile, 100);
      ImageDestroy($newim);
      unset($im, $newim);
    }
    $list[$k][img][x] = $fixsize[x];
    $list[$k][img][y] = $fixsize[y];
    } else {
    if(is_file($destfile)) {
      $size = @getimagesize($destfile);
      $list[$k][img][x] = $size[0];
      $list[$k][img][y] = $size[1];
    } else {
      $img = "";
      $size = @getimagesize($img);
      $list[$k][img][x] = $thumbx;
      $list[$k][img][y] = $thumby;
    }
    }
    if(is_file($destfile))$img = $destfile;
 if($k==0){ 
    echo <<<HEREDOC
    <td align="center" width="86">
      <table width=100 cellpadding="0" cellspacing="0" border="0" style="padding:0px;">
      <tr align=center>
        <td width=100 align="center"  style='padding-top:0px;'>
            <div align=center><table width=100 align="center"  bgcolor='#ffffff' cellpadding="3" cellspacing="0" border="0">
          <tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$k][href]}"><img src=" {$destfile}" width="{$list[$k][img][x]}" height="{$list[$k][img][y]}" border="0" alt="$content"></a></td>
          </tr>
        </table></div>
        </td>
      </tr>
      <tr>
        <td height=17 align="center" valign="middle" style='padding-top:5px;padding-bottom:5px;border:0px solid #777777'><a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#444444'>{$list[$k][subject]}</a></td>
      </tr>
      </table>
    </td>
  <td align="center" >
      <table width="100%" height=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;" >
HEREDOC;
 }else{
  echo <<<HEREDOC
        <tr>
        <td height=17 align="left" valign="middle" style='padding-top:2px;padding-bottom:2px;border:0px solid #777777'>&nbsp;<img src="$latest_skin_path/img/board_icon.gif" width="9" height="13"> <a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#999999'>[{$list[$k][bo_subject]}]</a> <a href="{$list[$k][href]}" style='font-family:굴림;font-size:12px;color:#444444'>$title</a></td>
      </tr>
HEREDOC;
  if($i<(count($list)-1)){echo "<tr><td colspan='9' height='1'></td></tr>";}
 }
}
?></table></table>
참고로 말씀드리면 td 사이즈 조절도 잘해야됩니다.
td 사이즈가 너무 작게 되어 있으면 이미지에 의해 가로가 늘어나더라도
글자의 가로폭은 td 사이즈만큼 됩니다.
에러내용 이렇게 하시면 됩니다.
저도 에러가 발생해서 이렇게 했더니 되더군요.
따라해보세요?

"스킨원본파일"에서
(여기서 중요한건 원본파일 그대로 적용하셔야 합니다. 위에 소스를 전체적으로 복사해서 붙여넣기 하지마세요.)

34번째줄을 $content = cut_str(get_text($list[$k][wr_content]), 10); 이 부분 바로 밑에 추가해준다.

$subject = cut_str(get_text($list[$k][subject]), 15, '...');  //목록 글 줄이는 함수

98번째줄 맽끝부분에..

{$list[$k][wr_subject]} 이 부분을..

{$list[$k][subject]} 이렇게 해주시고, 저장하신 다음 적용해 보세요?
© SIRSOFT
현재 페이지 제일 처음으로