초보 메인화면 썸네일 출력관련 질문좀 드립니다.

초보 메인화면 썸네일 출력관련 질문좀 드립니다.

QA

초보 메인화면 썸네일 출력관련 질문좀 드립니다.

본문

지금 현재 게시판에 동영상을 올리면 메인화면에 동영상 썸네일은 출력이 되는데요 동영상파일 없이 이미지만 올리면 엑박으로 뜨는데요 해결방법좀 부탁드립니다. "감사합니다"

이 질문에 댓글 쓰기 :

답변 2

기본적으로 소스라도 올려주셔야 도움을 드리지요........입장바꿔서 질문글을 다시 읽어보세요. 어떻게 도움을 드리나요?

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

$cols  = 4; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=250; //표시할 이미지의 가로사이즈
$imgheight=300; //표시할 이미지의 세로사이즈
$image_h  = 0; // 이미지 상하 간격

$col_width = (int)(100 / $cols);

$data_path = $g4[path]."/data/file/$bo_table";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="F5F5F5">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" align="center" bgcolor="red"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><font color="white">전체보기</font></td>
  <td height="35" style="padding-left:10px;"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><b><?=$board[bo_subject]?></b></a></td>
  <td width="30" height="35" align="center" valign="middle"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>">
  <img src="<?=$latest_skin_path?>/img/btn_more.gif" alt="전체보기" border="0" title="전체보기" /></a></td>
</tr>
      </table>
</td>
  </tr>
  <tr>
    <td height="0"><!--여백--></td>
  </tr>
  <tr>
    <td align="center" valign="top">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
<? for ($i=0; $i<count($list); $i++) {
  if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>  
<td width="<?=$col_width?>%" align="center" valign="top" style="padding-top:10px;">
<?

if (preg_match("@<embed.*src=\"//www.youtube.com/v/([^&]+)&?@",$list[$i][wr_content])) {
preg_match("/<embed.*?src=[\"']\/\/www\.youtube\.com\/v\/([^?]+)\?(.*?)['\"]/", $list[$i][wr_content], $matches);
$v = $matches[1];
$thumb_file="<img src='http://img.youtube.com/vi/".$v."/hqdefault.jpg' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' border='0' style='margin:10px;'>";
}else{
$thumb_file = "<img src='".$g4[path]."/img/noimage.png' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' border='0' style='margin:10px;'>";
}


$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];

    echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td valign='top' align='center'><a href='{$list[$i]['wr_link1']}'target='_blank'>".$thumb_file."</a></td></tr>";
                echo "<tr><td align='center' height='17'><a href='{$list[$i]['href']}'><span style='font-size:9pt;'><b>{$list[$i]['subject']}</b></span></a></td></tr>";echo "</table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%></td>";
}
?>
<? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>
  </tr>
</table>
</td>
  </tr>
</table>

$image = $list[$i][file][0][file]; //원본
$thumb = $data_path. "/".$image;  //썸네일이 없을경우 원본출력
 
if (preg_match("@<embed.*src=\"//www.youtube.com/v/([^&]+)&?@",$list[$i][wr_content])) {
preg_match("/<embed.*?src=[\"']\/\/www\.youtube\.com\/v\/([^?]+)\?(.*?)['\"]/", $list[$i][wr_content], $matches);
$v = $matches[1];
$thumb_file="<img src='".$v."/hqdefault.jpg' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' border='0' style='margin:10px;'>";
}elseif (file_exists($thumb)) {
$thumb_file = "<img src='".$thumb."' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' border='0' style='margin:10px;'>"; 
}else{
$thumb_file = "<img src='".$g4[path]."/img/noimage.png' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' border='0' style='margin:10px;'>";

$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
 
 
빨간색 삭제
초록색 추가
 
 
슈와이님 죄송합니다......답변주셧는데 염치불구하고 저도 조심스럽게 숟가락 올려요......ㅡㅜ;;;;;;;
답변을 작성하시기 전에 로그인 해주세요.
전체 125,873 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT