도와주세요 작성된 소스에서 이미가 없으면 이미지 없음 출력하고 싶습니다. 도와주세요.
이미지 최신글입니다.
소스에서 이미가 없으면 이미지 없음 출력하고 싶습니다. 도와주세요. 지금은 아무것도 뜨지 않아서요. 부탁드려요.
<? 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>
소스에서 이미가 없으면 이미지 없음 출력하고 싶습니다. 도와주세요. 지금은 아무것도 뜨지 않아서요. 부탁드려요.
<? 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
추가 후 우선 테스트
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">