갤러리 최신글 뽑는 소스인데요 제목 길이가 길어도 다 출력되서 짧게 출력되게 하고싶습니다. 정보
갤러리 최신글 뽑는 소스인데요 제목 길이가 길어도 다 출력되서 짧게 출력되게 하고싶습니다.본문
메인페이지에서 추출하는 소스는 <?=latest("flair_gallery", "0301", 3, 80, "55, 1");?>입니다.
제목이 길면 모두 출력되어서요 짧게 출력되게 하고싶습니다.
도와주세요(__)
아래는 latest.skin.php파일 소스입니다. 도와주세요~!
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
list($height, $row_cnt) = explode(",", $options);
$all_cnt = 0;
?>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='left'>
<tr>
</tr>
<tr><td align='center'>
<table width='95%'>
<? for ($k=0; $k<$row_cnt; $k++ ) { ?>
<tr>
<?
for ($i=0; $i<count($list)/$row_cnt; $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$all_cnt][wr_subject]);
$content = cut_str(get_text($list[$all_cnt][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
if (!file_exists($img) || !$list[$all_cnt][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='<?=$subject_len?>' valign='top' align='center'>
<table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'>
<div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$list[$all_cnt][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
$all_cnt++;
}
?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align='center' height=25>게시물이 없습니다.</td></tr>
<? } ?>
</table>
</td></tr>
</table>
제목이 길면 모두 출력되어서요 짧게 출력되게 하고싶습니다.
도와주세요(__)
아래는 latest.skin.php파일 소스입니다. 도와주세요~!
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
list($height, $row_cnt) = explode(",", $options);
$all_cnt = 0;
?>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='left'>
<tr>
</tr>
<tr><td align='center'>
<table width='95%'>
<? for ($k=0; $k<$row_cnt; $k++ ) { ?>
<tr>
<?
for ($i=0; $i<count($list)/$row_cnt; $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$all_cnt][wr_subject]);
$content = cut_str(get_text($list[$all_cnt][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
if (!file_exists($img) || !$list[$all_cnt][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='<?=$subject_len?>' valign='top' align='center'>
<table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'>
<div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$list[$all_cnt][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
$all_cnt++;
}
?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align='center' height=25>게시물이 없습니다.</td></tr>
<? } ?>
</table>
</td></tr>
</table>
댓글 전체
<?=latest("flair_gallery", "0301", 3, 80, "55, 1");?>
다음과 같이 적당한 숫자로 변경해 보세요.
<?=latest("flair_gallery", "0301", 3, 20, "55, 1");?>
최신글의 사용법은 다음과 같습니다.
<?=latest(스킨, 게시판아이디, 출력라인, 글자수);?>
다음과 같이 적당한 숫자로 변경해 보세요.
<?=latest("flair_gallery", "0301", 3, 20, "55, 1");?>
최신글의 사용법은 다음과 같습니다.
<?=latest(스킨, 게시판아이디, 출력라인, 글자수);?>
80은 글자수가 아니라 출력되는 이미지 가로 사이즈이더라구요..ㅠㅠ
<?=latest(스킨, 게시판아이디, 출력갯수, 이미지가로사이즈, 이미지세로사이즈, 출력되는 이미지 줄 수);?> 이렇게 되는거 같습니다.ㅠ
<?=latest(스킨, 게시판아이디, 출력갯수, 이미지가로사이즈, 이미지세로사이즈, 출력되는 이미지 줄 수);?> 이렇게 되는거 같습니다.ㅠ