연

도와주세요 작성된 소스에서 이미가 없으면 이미지 없음 출력하고 싶습니다. 도와주세요.

이미지 최신글입니다.

소스에서 이미가 없으면 이미지 없음 출력하고 싶습니다. 도와주세요. 지금은 아무것도 뜨지 않아서요. 부탁드려요.


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

<table width="462" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- <tr>
<td bgcolor="F4F4F4" class="title1"><?=$board[bo_subject]?>
<img src="<?=$latest_skin_path?>/img/left_news_icon.gif" align="absmiddle"></td>
</tr>
<tr>
<td height="1" bgcolor="D9D9D9"></td>
</tr>-->
<tr>
<td style="padding:10px 5px 10px 8px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? for ($i=0; $i<count($list); $i++) {?>
<?
$subject = cut_str($list[$i][wr_subject],500,"...");
?>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="85" rowspan="2">
<?
// 파일 출력
$file_url = $list[$i][file][0][path]."/".$list[$i][file][0][file];
$img_info = @getimagesize($file_url);
if (preg_match("/\.($config[cf_image_extension])$/i", $file_url) || $img_info[2]==1 || $img_info[2]==2 )
echo "<a href='{$list[$i][href]}'><img src='$file_url' width='120' height='85' border='0'></a>";

?>

<?$filter_arr = array("[미디어인뉴스]");
$wr_content = str_replace($filter_arr, "[미디어인뉴스]", $wr_content); ?> </td>
<td width="50" rowspan="2"> </td>
<td width="1344"><span class="t_board" style="padding-bottom:3px;"><span class="t_board" style="padding-bottom:3px;"><span class="t_board" style="padding-bottom:3px;"><a href='<?=$list[$i][href]?>'>
<?=$subject?>
</a></span></span></span></td>
</tr>
<tr>
<td><span style="color:666666; letter-spacing:-0.5px; font-size:11px; font-family:돋음;">
<?
$html = 0;
if (strstr($list['wr_option'], "html1"))
$html = 1;
else if (strstr($list['wr_option'], "html2"))
$html = 2;

echo cut_str(strip_tags(str_replace("미디어인뉴스", "코리아닷미", $list[$i]['wr_content']) ),500,"...");
?>
</span></td>
</tr>
</table> </td>
</tr>
<? if( $i < count($list)-1 ) { ?>
<tr>
<td height="10"></td>
</tr>
<? } ?>
<? } ?>
</table> </td>
</tr>
</table>
</td>
</tr>
</table>
|

댓글 4개

// 파일 출력
$file_url = $list[$i][file][0][path]."/".$list[$i][file][0][file];
if(!$file_url) $file_url = "noimage 파일 경로"; // 첫번재 첨부(위 경로) 없을 경우 출력할 noimage

추가 후 우선 테스트
추가해봤는데 출력이 되지 않습니다.
if (preg_match("/\.($config[cf_image_extension])$/i", $file_url) || $img_info[2]==1 || $img_info[2]==2 )
echo "<a href='{$list[$i][href]}'><img src='$file_url' width='120' height='85' border='0'></a>";

else
echo "<img src="노이미지 경로" width="120" height="85" border="0">
현님 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
12-12-15 조회 1,065
12-12-15 조회 1,649
12-12-15 조회 1,349
12-12-14 조회 965
12-12-14 조회 986
12-12-14 조회 1,133
12-12-14 조회 1,059
12-12-14 조회 925
12-12-14 조회 1,552
12-12-14 조회 1,099
12-12-14 조회 887
12-12-14 조회 1,078
12-12-14 조회 1,067
12-12-14 조회 1,283
12-12-14 조회 834
12-12-14 조회 1,340
12-12-14 조회 1,104
12-12-14 조회 1,366
12-12-14 조회 1,084
12-12-14 조회 778