본문
본문보다 작은 이미지를 섬네일로 만들어서 오히려 보기가 좋지 않은경우가 있다.
본문 섬네일을 사용여부를 선택하게 만들기.
1. write.skin.php
<?php if ($is_file) { ?>
<tr>
<th scope="row">본문이미지</th>
<td><input type="checkbox" name="is_orijpg" value='y' <? if (strstr($write["wr_10"],'orijpg')) echo "checked";?> >첨부 이미지 섬네일 생략</td>
</tr>
<?php } ?>
2. write_update.tail.skin.php
if (array_key_exists("is_orijpg",$_POST)) {
$write=sql_fetch("select wr_10 from $write_table where wr_id='$wr_id'");
$ori=$write[wr_10];
if ($is_orijpg) {
if (!strstr($write[wr_10],'orijpg')) $write[wr_10].=' orijpg';
}
else {
$write[wr_10]=str_replace('orijpg','',$write[wr_10]);
}
$write[wr_10]=trim($write[wr_10]);
if ($write[wr_10]!=$ori) {
sql_query("update $write_table set wr_10='".mysql_real_escape_string($write[wr_10])."' where wr_id='$wr_id'");
}
}
3. view.skin.php
if (array_key_exists("is_orijpg",$_POST)) {
$write=sql_fetch("select wr_10 from $write_table where wr_id='$wr_id'");
$ori=$write[wr_10];
if ($is_orijpg) {
if (!strstr($write[wr_10],'orijpg')) $write[wr_10].=' orijpg';
}
else {
$write[wr_10]=str_replace('orijpg','',$write[wr_10]);
}
$write[wr_10]=trim($write[wr_10]);
if ($write[wr_10]!=$ori) {
sql_query("update $write_table set wr_10='".mysql_real_escape_string($write[wr_10])."' where wr_id='$wr_id'");
}
}
댓글목록
등록된 댓글이 없습니다.