여분필드 wr_1을 10개로 쪼개서 list, write, view에 출력하기 예제.
write.skin.php
=============
[code]add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
하단에 아래 내용 추가.
// 여분필드
$wr_1 = explode("|",$write["wr_1"]);
$wr_1_1 = $wr_1[0];
$wr_1_2 = $wr_1[1];
$wr_1_3 = $wr_1[2];
$wr_1_4 = $wr_1[3];
$wr_1_5 = $wr_1[4];
$wr_1_6 = $wr_1[5];
$wr_1_7 = $wr_1[6];
$wr_1_8 = $wr_1[7];
$wr_1_9 = $wr_1[8];
$wr_1_10 = $wr_1[9];
원하는 곳에
<input type="text" name="wr_1_1" value="<?php echo $wr_1_1 ?>" id="wr_1_1" class="frm_input">
이런 식으로 작성
셀렉트박스일 경우
<option value="내용1" <?=($wr_1_1 == "내용1")?'selected':'';?>>내용1</option>
이런 식으로 작성[/code]
view.skin.php
=============
[code]add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
하단에 아래 내용 추가.
// 여분필드
$wr_1 = explode("|",$write["wr_1"]);
$wr_1_1 = $wr_1[0];
$wr_1_2 = $wr_1[1];
$wr_1_3 = $wr_1[2];
$wr_1_4 = $wr_1[3];
$wr_1_5 = $wr_1[4];
$wr_1_6 = $wr_1[5];
$wr_1_7 = $wr_1[6];
$wr_1_8 = $wr_1[7];
$wr_1_9 = $wr_1[8];
$wr_1_10 = $wr_1[9];
원하는 곳에
<?php echo $wr_1_1 ?>
이런 식으로 작성[/code]
list.skin.php
============
[code] <?php
for ($i=0; $i<count($list); $i++) {
?>
하단에 아래 내용 추가.
<?php
$wr_1 = explode("|",$list[$i]["wr_1"]);
$wr_1_1 = $wr_1[0];
$wr_1_2 = $wr_1[1];
$wr_1_3 = $wr_1[2];
$wr_1_4 = $wr_1[3];
$wr_1_5 = $wr_1[4];
$wr_1_6 = $wr_1[5];
$wr_1_7 = $wr_1[6];
$wr_1_8 = $wr_1[7];
$wr_1_9 = $wr_1[8];
$wr_1_10 = $wr_1[9];
?>
원하는 곳에
<?php echo $wr_1_1 ?>
이런 식으로 작성[/code]
write_update.skin.php
====================
에 아래 내용 입력.
[code]<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$wr_1 = "$wr_1_1|$wr_1_2|$wr_1_3|$wr_1_4|$wr_1_5|$wr_1_6|$wr_1_7|$wr_1_8|$wr_1_9|$wr_1_0|";
$sql1 = " update $write_table set wr_1 = '$wr_1' where wr_id = '$wr_id' ";
sql_query($sql1);
?>[/code]
write_update.skin.php 이 없다면 파일 만든 후 위 내용 첨부.