수정가능한 컨텐츠만들기
내용관리가 있지만 레이아웃이 다르거나 일부내용만 수정해야할때 사용하시면 됩니다
head.php 나 head_sub.php 적당한곳에 넣어주세요
[code]
function we_content($c_id)
{
$c_id_centent = sql_fetch("select * from g5_content where co_id = '$c_id' ");
echo $c_id_centent[co_content];
}
[/code]
컨텐츠를 넣을 곳에
[code]
<?=we_content('컨텐츠 아이디')?>
[/code]
를 넣어주시면됩니다.
adm/contentformupdate.php
72번줄
[code]
goto_url("./contentform.php?w=u&co_id=$co_id");
[/code]
를
[code]
if ($k=="k") {
goto_url("./notice.php?w=u&co_id=$co_id");
} else {
goto_url("./contentform.php?w=u&co_id=$co_id");
}
[/code]
이렇게 변경해주시고,
adm/notice.php 를 만드셔서
[code]
<?php
$sub_menu = '400100';
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
auth_check($auth[$sub_menu], "w");
// 상단, 하단 파일경로 필드 추가
if(!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", false)) {
$sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL ,
ADD `co_include_tail` VARCHAR( 255 ) NOT NULL ";
sql_query($sql, false);
}
// html purifier 사용여부 필드
if(!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ", true);
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
}
// 모바일 내용 추가
if(!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ", true);
}
// 스킨 설정 추가
if(!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ", true);
sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
}
$html_title = "내용";
$g5['title'] = $html_title.' 관리';
if ($w == "u")
{
$html_title .= " 수정";
$readonly = " readonly";
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 자료가 없습니다.');
}
else
{
$html_title .= ' 입력';
$co['co_html'] = 2;
$co['co_skin'] = 'basic';
$co['co_mobile_skin'] = 'basic';
}
include_once (G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="frmcontentform" action="./contentformupdate.php" onsubmit="return frmcontentform_check(this);" method="post" enctype="MULTIPART/FORM-DATA" >
<input type="hidden" name="k" value="k">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="co_html" value="1">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="co_id">ID</label></th>
<td>
<?php echo help('20자 이내의 영문자, 숫자, _ 만 가능합니다.'); ?>
<input type="text" value="<?php echo $co['co_id']; ?>" name="co_id" id ="co_id" required <?php echo $readonly; ?> class="required <?php echo $readonly; ?> frm_input" size="20" maxlength="20">
<?php if ($w == 'u') { ?><a href="<?php echo G5_BBS_URL; ?>/content.php?co_id=<?php echo $co_id; ?>" class="btn_frmline">내용확인</a><?php } ?>
</td>
</tr>
<tr>
<th scope="row"><label for="co_subject">제목</label></th>
<td><input type="text" name="co_subject" value="<?php echo htmlspecialchars2($co['co_subject']); ?>" id="co_subject" required class="frm_input required" size="90"></td>
</tr>
<tr>
<th scope="row">내용</th>
<td><?php echo editor_html('co_content', get_text($co['co_content'], 0)); ?></td>
</tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="./contentlist.php">목록</a>
</div>
</form>
<script>
function frmcontentform_check(f)
{
errmsg = "";
errfld = "";
<?php echo get_editor_js('co_content'); ?>
<?php echo chk_editor_js('co_content'); ?>
<?php echo get_editor_js('co_mobile_content'); ?>
check_field(f.co_id, "ID를 입력하세요.");
check_field(f.co_subject, "제목을 입력하세요.");
check_field(f.co_content, "내용을 입력하세요.");
if (errmsg != "") {
alert(errmsg);
errfld.focus();
return false;
}
return true;
}
</script>
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');
?>
[/code]
이 코드를 넣어주시면됩니다.
관리자 메뉴 추가는
[code]
array('402100', '제목', ''.G5_ADMIN_URL.'/notice.php?w=u&co_id=컨텐츠 아이디', 'bbs_board'),
[/code]
이 형태로 추가해주시면 됩니다.
납품해서 고객이 수정해야한다거나.. 수정이 번거로울 때 사용하시면될듯하네요
보통은 내용관리로 사용하셔도됩니다~
p.s 내용관리에서 먼저 컨텐츠를 만들어야 한다는 단점이 있습니다.. 귀찮아서 아직 그 부분은 만들지 않았네요 ㅠ
head.php 나 head_sub.php 적당한곳에 넣어주세요
[code]
function we_content($c_id)
{
$c_id_centent = sql_fetch("select * from g5_content where co_id = '$c_id' ");
echo $c_id_centent[co_content];
}
[/code]
컨텐츠를 넣을 곳에
[code]
<?=we_content('컨텐츠 아이디')?>
[/code]
를 넣어주시면됩니다.
adm/contentformupdate.php
72번줄
[code]
goto_url("./contentform.php?w=u&co_id=$co_id");
[/code]
를
[code]
if ($k=="k") {
goto_url("./notice.php?w=u&co_id=$co_id");
} else {
goto_url("./contentform.php?w=u&co_id=$co_id");
}
[/code]
이렇게 변경해주시고,
adm/notice.php 를 만드셔서
[code]
<?php
$sub_menu = '400100';
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
auth_check($auth[$sub_menu], "w");
// 상단, 하단 파일경로 필드 추가
if(!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", false)) {
$sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL ,
ADD `co_include_tail` VARCHAR( 255 ) NOT NULL ";
sql_query($sql, false);
}
// html purifier 사용여부 필드
if(!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ", true);
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
}
// 모바일 내용 추가
if(!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ", true);
}
// 스킨 설정 추가
if(!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ", true);
sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
}
$html_title = "내용";
$g5['title'] = $html_title.' 관리';
if ($w == "u")
{
$html_title .= " 수정";
$readonly = " readonly";
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 자료가 없습니다.');
}
else
{
$html_title .= ' 입력';
$co['co_html'] = 2;
$co['co_skin'] = 'basic';
$co['co_mobile_skin'] = 'basic';
}
include_once (G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="frmcontentform" action="./contentformupdate.php" onsubmit="return frmcontentform_check(this);" method="post" enctype="MULTIPART/FORM-DATA" >
<input type="hidden" name="k" value="k">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="co_html" value="1">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="co_id">ID</label></th>
<td>
<?php echo help('20자 이내의 영문자, 숫자, _ 만 가능합니다.'); ?>
<input type="text" value="<?php echo $co['co_id']; ?>" name="co_id" id ="co_id" required <?php echo $readonly; ?> class="required <?php echo $readonly; ?> frm_input" size="20" maxlength="20">
<?php if ($w == 'u') { ?><a href="<?php echo G5_BBS_URL; ?>/content.php?co_id=<?php echo $co_id; ?>" class="btn_frmline">내용확인</a><?php } ?>
</td>
</tr>
<tr>
<th scope="row"><label for="co_subject">제목</label></th>
<td><input type="text" name="co_subject" value="<?php echo htmlspecialchars2($co['co_subject']); ?>" id="co_subject" required class="frm_input required" size="90"></td>
</tr>
<tr>
<th scope="row">내용</th>
<td><?php echo editor_html('co_content', get_text($co['co_content'], 0)); ?></td>
</tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="./contentlist.php">목록</a>
</div>
</form>
<script>
function frmcontentform_check(f)
{
errmsg = "";
errfld = "";
<?php echo get_editor_js('co_content'); ?>
<?php echo chk_editor_js('co_content'); ?>
<?php echo get_editor_js('co_mobile_content'); ?>
check_field(f.co_id, "ID를 입력하세요.");
check_field(f.co_subject, "제목을 입력하세요.");
check_field(f.co_content, "내용을 입력하세요.");
if (errmsg != "") {
alert(errmsg);
errfld.focus();
return false;
}
return true;
}
</script>
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');
?>
[/code]
이 코드를 넣어주시면됩니다.
관리자 메뉴 추가는
[code]
array('402100', '제목', ''.G5_ADMIN_URL.'/notice.php?w=u&co_id=컨텐츠 아이디', 'bbs_board'),
[/code]
이 형태로 추가해주시면 됩니다.
납품해서 고객이 수정해야한다거나.. 수정이 번거로울 때 사용하시면될듯하네요
보통은 내용관리로 사용하셔도됩니다~
p.s 내용관리에서 먼저 컨텐츠를 만들어야 한다는 단점이 있습니다.. 귀찮아서 아직 그 부분은 만들지 않았네요 ㅠ
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2304 | 2년 전 | 1252 | ||
| 2303 | 2년 전 | 2431 | ||
| 2302 | 2년 전 | 2280 | ||
| 2301 | 2년 전 | 1815 | ||
| 2300 | 2년 전 | 2506 | ||
| 2299 | 2년 전 | 1705 | ||
| 2298 |
종이인형친구
|
2년 전 | 2073 | |
| 2297 | 2년 전 | 3747 | ||
| 2296 | 2년 전 | 1441 | ||
| 2295 | 2년 전 | 1791 | ||
| 2294 | 2년 전 | 1518 | ||
| 2293 | 2년 전 | 1978 | ||
| 2292 |
swallow
|
2년 전 | 2966 | |
| 2291 | 2년 전 | 2205 | ||
| 2290 | 2년 전 | 2373 | ||
| 2289 | 2년 전 | 1929 | ||
| 2288 | 2년 전 | 2170 | ||
| 2287 | 2년 전 | 2757 | ||
| 2286 | 2년 전 | 1822 | ||
| 2285 | 2년 전 | 2212 | ||
| 2284 | 2년 전 | 1647 | ||
| 2283 |
|
2년 전 | 2223 | |
| 2282 |
디지털홍익인간
|
2년 전 | 3664 | |
| 2281 | 2년 전 | 1747 | ||
| 2280 | 2년 전 | 1900 | ||
| 2279 |
|
2년 전 | 1857 | |
| 2278 | 2년 전 | 2081 | ||
| 2277 | 2년 전 | 4699 | ||
| 2276 |
WEBOLUTION
|
2년 전 | 2030 | |
| 2275 | 2년 전 | 2809 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기