갤러리 최신글 수정 부탁드립니다.

갤러리 최신글 수정 부탁드립니다.

QA

갤러리 최신글 수정 부탁드립니다.

답변 2

본문

갤러리 최신글 소스 입니다.

지금은 6개를 출력하면 한줄에 6개가 모두 출력되는데 

한출에 3개씩 두칸에 출력하고 싶습니다.

한줄에 3개

다움줄에 3개 어디를 어떻게 수정해야 하는지요? 부탁드리겠습니다.

 

감사합니다.

 


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/thumb.lib.php"); 
 
$rows = count($list);
$style_name = "mw-group-$bo_table-$rows-$subject_len";
 
$cols  = 6; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$img_width = '120'; //썸네일 가로길이
$img_height = '100'; //썸네일 세로길이
$img_quality = '100'; //퀼리티 100이하로 설정
$data_path = $g4[path]."/data/file"; 
 
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
 
$col_width = (int)(99 / $cols);
?>
 
 
<style type="text/css">
#<?=$style_name?> { clear:both; margin:0; border:0px solid #e1e1e1; }
#<?=$style_name?> .item { clear:both; display:none; }
#<?=$style_name?> .subject { clear:both; height:30px; color:#666666; font-weight:bold; padding-top:5px; font-size:12px; }
#<?=$style_name?> .subject a { color:#666666; text-decoration:none; }
#<?=$style_name?> .prev { float:left; margin:0 0 0 -4px; cursor:pointer; }
#<?=$style_name?> .next	{ float:left; margin:0 0px 0 0; cursor:pointer; }
#<?=$style_name?> .link	{ float:left; margin:0 0 0 5px; text-align:center; }
</style>
 
 
<div id="<?=$style_name?>">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
<? for ($i=0; $i<$rows; $i++) { ?>
<td valign="top">
<table width="80" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:4px; padding:6px;">
  <tr>
    <td valign="top">
<? 
  $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
  if ($file=="/")
      $file = $data_path . "/thumb/" . "noimg.gif";
  $img = thumbnail($file, $img_width, $img_height, 0, 2, $img_quality); 
  $img = "<a href='{$list[$i][href]}'><img src='$img' width='$img_width' height='$img_height' border='0' style='border:1 #eee solid' onmouseover=this.style.filter='alpha(opacity=60)' onmouseout=this.style.filter='' title='{$list[$i][subject]}'></a>"; 
?><a href='<?=$list[$i][href]?>'><?=$img?></a></td> 
</tr><tr>
    <td>
    <div class="subject"><a href="<?=$list[$i][href]?>"><span style="font-size:12px;"><?=$list[$i][subject]?></span></a><span style="color:#FF6633; font-size:10px"><?=$list[$i]['comment_cnt']?></span></div>
	<!-- <div style="color:#9a99aa; padding-top:4px;"><a href="<?=$list[$i][href]?>"><span style="color:#747172; font-size:11px;"><?=cut_str(strip_tags($list[$i][wr_content]),100,"...")?></span></a></div> -->
    </td>
  </tr>
</table>
</td>
<? } ?>
  </tr>
</table>
<? if (count($list) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
  <tr>
    <td></td> 
  </tr>
</table>"; } ?>
 
</div>

이 질문에 댓글 쓰기 :

답변 2

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 10,635
© SIRSOFT
현재 페이지 제일 처음으로