최신글 목록 오류 도움이 필요합니다!
본문
초보다보니 요즘 질문을 많이 하게됩니다 가입한지 3일이안되서 답글이 안되니 감사인사도 못드리고 채택만 하게되는군요.
고수님들 덕분에 하나하나씩 성공해가면 홈페이지가 변하고있습니다. 댓글 남겨주신분들 다시한번 감사드립니다. (__
제가 맘에 드는 최신글 스킨을 하나 받았는데요 ~
이미지가 없는 글을 출력하면 폰트로 no image 이렇게 나옵니다. 그래서 폰트배열과 사진정렬이 어긋나는데요
저 폰트 대신 썸네일의 같은 크기로 이미지를 하나 만들어서 대체하려고하는데 이미지는 최상단 /img 에 업로드 해놨는데
이미지 경로를 어디다 넣어야 할지 모르겠습니다.
제가 초보라 자세히 좀 알려주시기 바랍니다!
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$thumb_width=50;
$thumb_height=50;
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
?>
<!-- <?php echo $bo_subject; ?> 최신글 시작 { -->
<div class="ltx">
<strong class="lt_title"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $bo_subject; ?></a></strong>
<ul>
<?php
for ($i=0; $i<count($list); $i++) {
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height);
if($thumb['src']) {
$img = '<img src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$thumb_width.'" height="'.$thumb_height.'">';
} else {
$img = 'NO IMAGE';
}?>
<li>
<div class="img"><a href="<?php echo $list[$i]['href'];?>"><span class="roll sports"></span><?php echo $img;?></a></div>
<div class="inner"><p class="tit"><?php
//echo $list[$i]['icon_reply']." ";
echo "<a href=\"".$list[$i]['href']."\">";
if ($list[$i]['is_notice'])
echo "<strong>".$list[$i]['subject']."</strong>";
else
echo $list[$i]['subject'];
if ($list[$i]['comment_cnt'])
echo $list[$i]['comment_cnt'];
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
if (isset($list[$i]['icon_new'])) echo " " . $list[$i]['icon_new'];
?></a><br><?php echo cut_str(strip_tags($list[$i]['wr_content']),38);?></p>
</div>
</li>
<?php } ?>
<?php if (count($list) == 0) { //게시물이 없을 때 ?>
<li>게시물이 없습니다.</li>
<?php } ?>
</ul>
<!-- <div class="lt_more"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><span class="sound_only"><?php echo $bo_subject ?></span><img src='<?php echo $latest_skin_url ?>/img/more.gif'></a></div> -->
</div>
답변 2
for ( $i =0; $i < count ( $list ); $i ++) { |
22 | $thumb = get_list_thumbnail( $bo_table , $list [ $i ][ 'wr_id' ], $thumb_width , $thumb_height ); |
23 | if ( $thumb [ 'src' ]) { |
24 | $img = '<img src="' . $thumb [ 'src' ]. '" alt="' . $list [ $i ][ 'subject' ]. '" width="' . $thumb_width . '" height="' . $thumb_height . '">' ; |
25 | } else { |
26 | $img = 'NO IMAGE' ; |
27 | }?> |
if ( $thumb [ 'src' ]) { |
24 | $img = '<img src="' . $thumb [ 'src' ]. '" alt="' . $list [ $i ][ 'subject' ]. '" width="' . $thumb_width . '" height="' . $thumb_height . '">' ; |
25 | } else { |
26 | $img = ' |
27 | }?> |
답변을 작성하시기 전에 로그인 해주세요.