[최신글] 조건부에 맞는 필드 최신글로 불러오는 방법 알려주세요. 정보
[최신글] 조건부에 맞는 필드 최신글로 불러오는 방법 알려주세요.본문
최신글에서 다음과 같은 조건에서 불러오는 필드를 설정해야 합니다.
자세히 풀어서 말하자면,
글쓰기에서
월세를 선택을 하면, 최신글에서 보증금($six01)과 월세금($six03)이 보여지고,
전세를 선택하면, 최신글에서 전세금(($six02)이 보여지고,
매매를 선택하며, 최신글에서 매매금(($six04)만 보여지도록 해야됩니다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
리스트에서는 제대로 불러옵니다.
하지만 리스트에 아래내용을 최신글로 복사해 보니 오류가 발생되더군요.
-- list.skin.php --
<? if($list[$i][wr_10] == '월세') {?>
<tr>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_05.gif'></td>
<td> <?=$six01?>만원</td>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_03.gif'></td>
<td> <?=$six03?>만원</td>
</tr>
<? }
else if($list[$i][wr_10] == '전세') {?>
<tr>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_04.gif'></td>
<td> <?=$six02?>만원</td>
</tr>
<? }
else if($list[$i][wr_10] == '매매') {?>
<tr>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_02.gif'></td>
<td> <?=$six04?>만원</td>
</tr>
<? }
?>
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
지금은 아래와 같이 작성해서 "보증금($six01)과 월세금($six03)"만 불러오도록 했지만,
월세,전세, 매매에 따라서 다르게 불러오도록 하고 싶습니다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
-- latest.skin.php --
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$mod = 5;
?>
<table width="96%" cellpadding="0" cellspacing="0"><tr>
<? for ($i=0; $i<count($list); $i++) {
$noimg = $latest_skin_path."/img/noimg.gif";
$image = urlencode($list[$i][file][0][file]);
$ori="$g4[path]/data/file/$bo_table/" . $image;
$ext = strtolower(substr(strrchr($ori,"."), 1));
if ( $ext=="gif"||$ext=="jpg"||$ext=="jpeg"||$ext=="png"||$ext=="bmp"||$ext=="tif"||$ext=="tiff") $ori_info=getimagesize($ori); else $ori_info="";
if ( $ori_info[2]=="2" || $ori_info[2]=="3" ) {
$thum = $ori."" ;
} else if ( $ori_info[2]=="1" || $ori_info[2]=="6" || $ori_info[2]=="7" ) {
$thum = $ori ;
} else {
$thum = $noimg ;
}
?>
<?
$p_six = explode("|",$list[$i][wr_6]);
$six01 = $p_six[0];
$six02 = $p_six[1];
$six03 = $p_six[2];
$six04 = $p_six[3];
$six05 = $p_six[4];
$six06 = $p_six[5];
$six07 = $p_six[6];
$six08 = $p_six[7];
$six09 = $p_six[8];
$six10 = $p_six[9];
$six11 = $p_six[10];
$six12 = $p_six[11];
$six13 = $p_six[12];
$six14 = $p_six[13];
$six15 = $p_six[14];
$six16 = $p_six[15];
$six17 = $p_six[16];
$six18 = $p_six[17];
$six19 = $p_six[18];
$six20 = $p_six[19];
$six21 = $p_six[20];
$six22 = $p_six[21];
$six23 = $p_six[22];
$six24 = $p_six[23];
$six25 = $p_six[24];
$six26 = $p_six[25];
$six27 = $p_six[26];
$six28 = $p_six[27];
$six29 = $p_six[28];
$six30 = $p_six[29];
?>
<?
$p_nine = explode("|",$write[wr_9]);
$nine01 = $p_nine[0];
$nine02 = $p_nine[1];
$nine03 = $p_nine[2];
$nine04 = $p_nine[3];
$nine05 = $p_nine[4];
$nine06 = $p_nine[5];
$nine07 = $p_nine[6];
$nine08 = $p_nine[7];
$nine09 = $p_nine[8];
$nine10 = $p_nine[9];
$nine11 = $p_nine[10];
$nine12 = $p_nine[11];
$nine13 = $p_nine[12];
$nine14 = $p_nine[13];
$nine15 = $p_nine[14];
$nine16 = $p_nine[15];
?>
<?
$p_four = explode("|",$list[$i][wr_4]);
$four01 = $p_four[0];
$four02 = $p_four[1];
$four03 = $p_four[2];
$four04 = $p_four[3];
$four05 = $p_four[4];
$p_seven = explode("|",$list[$i][wr_5]);
$seven01 = $p_seven[0];
$seven02 = $p_seven[1];
$seven03 = $p_seven[2];
$seven04 = $p_seven[3];
$seven05 = $p_seven[4];
$seven06 = $p_seven[5];
$seven07 = $p_seven[6];
$seven08 = $p_seven[7];
$seven09 = $p_seven[8];
$seven10 = $p_seven[9];
?>
<?
if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; }
?>
<?$etc6_exp=explode("|" , $write[wr_6])?>
<?$etc3_exp=explode("|" , $write[wr_7])?>
<script>
function chgImg( imgname, dnimgname, imgdesc ) {
var LureExp = /<br>/gi;
document.gallery_img.src=imgname;
}
</script>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="90" align="center" valign="middle"><table cellpadding="2" cellspacing="1" bgcolor="e4e4e4">
<tr>
<td align="center" onMouseOver=this.style.backgroundColor='#ff6600' onMouseOut=this.style.backgroundColor=''>
<a href='<?=$list[$i][href]?>'><img src='<?=$thum?>' width="110" height="80" border='0'></a><? $image = getimagesize($ori); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="80" align="center" valign="top"><table width="120" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
<tr>
<td align="center" valign="top" style="padding-top:5px">
<span class="text01"><b><a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a></span> </b> </td>
</tr>
<tr>
<< 이부분이 수정되어야 할것 같은데요......
<td height="20" align="center"><span class="small"><img src="<?=$board_skin_path?>/bj114/img/bicon_05.gif"><?=$six01?>만, <img src="<?=$board_skin_path?>/bj114/img/bicon_03.gif"><?=$six03?>만</span></td>
</tr>
<tr>
<td height="20" align="center"><span class="small"><?=$list[$i][wr_4]?>평 / <?=$list[$i][wr_10]?></strong></font></span></td> </tr>
</table></td>
</tr>
</table>
</td><? } ?>
<?
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++)
{ echo "<td> </td>";}
?>
<? if (count($list) == 0) { echo "<td colspan=$mod class=bbs>내용이 없습니다.</td>"; } ?>
</tr></table>
자세히 풀어서 말하자면,
글쓰기에서
월세를 선택을 하면, 최신글에서 보증금($six01)과 월세금($six03)이 보여지고,
전세를 선택하면, 최신글에서 전세금(($six02)이 보여지고,
매매를 선택하며, 최신글에서 매매금(($six04)만 보여지도록 해야됩니다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
리스트에서는 제대로 불러옵니다.
하지만 리스트에 아래내용을 최신글로 복사해 보니 오류가 발생되더군요.
-- list.skin.php --
<? if($list[$i][wr_10] == '월세') {?>
<tr>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_05.gif'></td>
<td> <?=$six01?>만원</td>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_03.gif'></td>
<td> <?=$six03?>만원</td>
</tr>
<? }
else if($list[$i][wr_10] == '전세') {?>
<tr>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_04.gif'></td>
<td> <?=$six02?>만원</td>
</tr>
<? }
else if($list[$i][wr_10] == '매매') {?>
<tr>
<td width='14'><img src='<?=$board_skin_path?>/img/bicon_02.gif'></td>
<td> <?=$six04?>만원</td>
</tr>
<? }
?>
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
지금은 아래와 같이 작성해서 "보증금($six01)과 월세금($six03)"만 불러오도록 했지만,
월세,전세, 매매에 따라서 다르게 불러오도록 하고 싶습니다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
-- latest.skin.php --
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$mod = 5;
?>
<table width="96%" cellpadding="0" cellspacing="0"><tr>
<? for ($i=0; $i<count($list); $i++) {
$noimg = $latest_skin_path."/img/noimg.gif";
$image = urlencode($list[$i][file][0][file]);
$ori="$g4[path]/data/file/$bo_table/" . $image;
$ext = strtolower(substr(strrchr($ori,"."), 1));
if ( $ext=="gif"||$ext=="jpg"||$ext=="jpeg"||$ext=="png"||$ext=="bmp"||$ext=="tif"||$ext=="tiff") $ori_info=getimagesize($ori); else $ori_info="";
if ( $ori_info[2]=="2" || $ori_info[2]=="3" ) {
$thum = $ori."" ;
} else if ( $ori_info[2]=="1" || $ori_info[2]=="6" || $ori_info[2]=="7" ) {
$thum = $ori ;
} else {
$thum = $noimg ;
}
?>
<?
$p_six = explode("|",$list[$i][wr_6]);
$six01 = $p_six[0];
$six02 = $p_six[1];
$six03 = $p_six[2];
$six04 = $p_six[3];
$six05 = $p_six[4];
$six06 = $p_six[5];
$six07 = $p_six[6];
$six08 = $p_six[7];
$six09 = $p_six[8];
$six10 = $p_six[9];
$six11 = $p_six[10];
$six12 = $p_six[11];
$six13 = $p_six[12];
$six14 = $p_six[13];
$six15 = $p_six[14];
$six16 = $p_six[15];
$six17 = $p_six[16];
$six18 = $p_six[17];
$six19 = $p_six[18];
$six20 = $p_six[19];
$six21 = $p_six[20];
$six22 = $p_six[21];
$six23 = $p_six[22];
$six24 = $p_six[23];
$six25 = $p_six[24];
$six26 = $p_six[25];
$six27 = $p_six[26];
$six28 = $p_six[27];
$six29 = $p_six[28];
$six30 = $p_six[29];
?>
<?
$p_nine = explode("|",$write[wr_9]);
$nine01 = $p_nine[0];
$nine02 = $p_nine[1];
$nine03 = $p_nine[2];
$nine04 = $p_nine[3];
$nine05 = $p_nine[4];
$nine06 = $p_nine[5];
$nine07 = $p_nine[6];
$nine08 = $p_nine[7];
$nine09 = $p_nine[8];
$nine10 = $p_nine[9];
$nine11 = $p_nine[10];
$nine12 = $p_nine[11];
$nine13 = $p_nine[12];
$nine14 = $p_nine[13];
$nine15 = $p_nine[14];
$nine16 = $p_nine[15];
?>
<?
$p_four = explode("|",$list[$i][wr_4]);
$four01 = $p_four[0];
$four02 = $p_four[1];
$four03 = $p_four[2];
$four04 = $p_four[3];
$four05 = $p_four[4];
$p_seven = explode("|",$list[$i][wr_5]);
$seven01 = $p_seven[0];
$seven02 = $p_seven[1];
$seven03 = $p_seven[2];
$seven04 = $p_seven[3];
$seven05 = $p_seven[4];
$seven06 = $p_seven[5];
$seven07 = $p_seven[6];
$seven08 = $p_seven[7];
$seven09 = $p_seven[8];
$seven10 = $p_seven[9];
?>
<?
if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; }
?>
<?$etc6_exp=explode("|" , $write[wr_6])?>
<?$etc3_exp=explode("|" , $write[wr_7])?>
<script>
function chgImg( imgname, dnimgname, imgdesc ) {
var LureExp = /<br>/gi;
document.gallery_img.src=imgname;
}
</script>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="90" align="center" valign="middle"><table cellpadding="2" cellspacing="1" bgcolor="e4e4e4">
<tr>
<td align="center" onMouseOver=this.style.backgroundColor='#ff6600' onMouseOut=this.style.backgroundColor=''>
<a href='<?=$list[$i][href]?>'><img src='<?=$thum?>' width="110" height="80" border='0'></a><? $image = getimagesize($ori); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="80" align="center" valign="top"><table width="120" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
<tr>
<td align="center" valign="top" style="padding-top:5px">
<span class="text01"><b><a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a></span> </b> </td>
</tr>
<tr>
<< 이부분이 수정되어야 할것 같은데요......
<td height="20" align="center"><span class="small"><img src="<?=$board_skin_path?>/bj114/img/bicon_05.gif"><?=$six01?>만, <img src="<?=$board_skin_path?>/bj114/img/bicon_03.gif"><?=$six03?>만</span></td>
</tr>
<tr>
<td height="20" align="center"><span class="small"><?=$list[$i][wr_4]?>평 / <?=$list[$i][wr_10]?></strong></font></span></td> </tr>
</table></td>
</tr>
</table>
</td><? } ?>
<?
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++)
{ echo "<td> </td>";}
?>
<? if (count($list) == 0) { echo "<td colspan=$mod class=bbs>내용이 없습니다.</td>"; } ?>
</tr></table>
댓글 전체