스킨 코드수정부탁드립니다 정보
스킨 코드수정부탁드립니다본문
한줄메모장처럼 쓰는 스킨으로 입맛에 맞게 바꾸고 있습니다.
리스트에 글과 리플들이 바로 보이는 스킨입니다
여기서 관리자에게는 re(리플쓰기), m(수정) d(삭제) 버튼이 보이고, 글 쓴 멤버는 수정, 삭제버튼만 보입니다.
여기서 리플쓰기버튼이 관리자뿐만아니라 모든 멤버도 볼수있게하고, re( )버튼에도 똑같이 리플을 쓸수있게 링크를 걸고싶습니다ㅠㅠ
----list.skin.php----
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 3;
//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
<tr><td height="10"></td></tr>
<? if ($write_href) { ?>
<tr>
<td align="center" style="padding:7px 0px 25px 0px;"><? include ("$board_skin_path/write.skin.php"); ?></td>
</tr>
<? } ?>
<tr><td height="1" style="background:#DDD;"></td></tr>
<tr><td height="10"></td></tr>
<tr>
<td align="center">
<!-- 게시물 리스트 시작 -->
<?
$lists = array();
for ($i=0; $i<count($list); $i++) {
$lists[$i] = $list[$i];
}
?>
<? for ($ii=0; $ii < count($lists); $ii++) {
$profile = get_member($lists[$ii][mb_id]);
include "$board_skin_path/inc.list_main.php";
// 수정, 삭제 링크
$update_href = "{$write_href}&w=u&bo_table=$bo_table&wr_id={$lists[$ii][wr_id]}&page=$page" . $qstr;
$delete_href = "javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table={$bo_table}&wr_id={$lists[$ii][wr_id]}&page=$page".urldecode($qstr)."');";
if ($lists[$ii][wr_1] == "")
$lists[$ii][wr_1] = "1.gif";
$lists[$ii][datetime]=substr($lists[$ii][wr_datetime],0,4)."/".substr($lists[$ii][wr_datetime],5,2)."/".substr($lists[$ii][wr_datetime],8,2)." (".substr($lists[$ii][wr_datetime],11,8).")";
//$lists[$ii][date]=date("Y-m-d H:i:s", $lists[$ii][wr_datetime]) ;
?>
<table width="<?=$width?>" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="fboardlist" method="post" action="" style="margin:0">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<tr>
<td width="20" height="30" align="center" valign="middle" class="small color_666" style="padding-left:6px;">*</td>
<td align="left" valign="middle" class="small color_666" style="padding-left:6px;">
<?=$lists[$ii][name]?>
l <? echo nl2br(url_auto_link($lists[$ii][wr_content])); ?><? echo $secret_msg; ?></span></span></span></td>
<td width="10%" class="small color_666" style="padding-left:6px;"><span class="v7 color_ccc" style="padding-right:4px;">
<? if($is_admin || $lists[$ii][comment_cnt]) { ?>
<? if($is_admin) { ?>
<a href="javascript:comment_wri('comment_write', '<?=$lists[$ii][wr_id]?>');">
<? } ?>
<? if($lists[$ii][comment_cnt]) { ?>
re
<?=$lists[$ii][comment_cnt]?><? } else { ?>
re
<? } ?>
<? if($is_admin) { ?>
</a>
<? } ?>
<? } ?>
<? if(($member[mb_id] && ($member[mb_id] == $lists[$ii][mb_id])) || $is_admin) { ?>
| <a href="<?=$write_href?>&w=u&wr_id=<?=$lists[$ii][wr_id]?>&sca=<?=$sca?>&page=<?=$page?>">m</a> | <a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$lists[$ii][wr_id]?>&sca=<?=$sca?>&page=<?=$page?>';}">d</a>
<? } else if (!$lists[$ii][mb_id]) { ?>
<a href="./password.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$lists[$ii][wr_id]?>&sca=<?=$sca?>&page=<?=$page?>">d</a>
<? } ?>
</span></td>
</tr>
</form>
<tr>
<td colspan="3" valign="top">
<!-- 게시물 내용 보기 끝 -->
<?
$wr_id = $lists[$ii][wr_id];
include ("$board_skin_path/view_comment.php");
?>
</td>
</tr>
</table>
</td>
</tr>
<? if ($ii+1 < count($lists)) { //마지막 라인 생략?>
<tr><td height="1" style="background:#DDD;"></td></tr>
<tr><td height="10"></td></tr>
<? } ?>
</table>
<?
}
// 필터
echo "<script language='javascript'> var g4_cf_filter = '$config[cf_filter]'; </script>\n";
echo "<script language='javascript' src='$g4[path]/js/filter.js'></script>\n";
if (!$member[mb_id]) // 비회원일 경우에만
echo "<script language='javascript' src='$g4[path]/js/md5.js'></script>\n";
?>
<? if (count($lists) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align=center colspan='2' height=100 class='small'>방문 흔적이 없습니다.</td></tr></table>"; } ?>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td height="1" colspan="2" style="background:#DDD;"></td></tr>
<tr>
<td width="40%" height="18" class="v7 color_999">
<? if ($list_href) { ?> <a href="<?=$list_href?>">list</a><? } ?><? if ($admin_href) { ?><a href="<?=$admin_href?>"> *</a><?}?>
</td>
<td width="60%" align="right" style="padding:4;" class="v7 color_999">
<!-- 버튼 링크 -->
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<input type="hidden" name=sfl value='wr_subject||wr_content'><input type="hidden" name=sop value="and">
<input name=stx maxlength=15 size=26 itemname="검색어" required value="<?=$stx?>" class="ed"><input type=image src="<?=$board_skin_path?>/img/e_search.gif" border=0 align=absmiddle></td>
</form>
</tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width="100%" height="30" align="center">
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<<", $write_pages);
$write_pages = str_replace("이전", "Prev", $write_pages);
$write_pages = str_replace("다음", "Next", $write_pages);
$write_pages = str_replace("맨끝", ">>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font class=\"color_gold2\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
//if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</script>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;
</script>
<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str)
{
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete()
{
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
------
간간히 보이는데 잘못건드릴까봐 무서워서 보고만 있습니다^^;;
부탁드립니다ㅠㅠ
리스트에 글과 리플들이 바로 보이는 스킨입니다
여기서 관리자에게는 re(리플쓰기), m(수정) d(삭제) 버튼이 보이고, 글 쓴 멤버는 수정, 삭제버튼만 보입니다.
여기서 리플쓰기버튼이 관리자뿐만아니라 모든 멤버도 볼수있게하고, re( )버튼에도 똑같이 리플을 쓸수있게 링크를 걸고싶습니다ㅠㅠ
----list.skin.php----
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 3;
//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
<tr><td height="10"></td></tr>
<? if ($write_href) { ?>
<tr>
<td align="center" style="padding:7px 0px 25px 0px;"><? include ("$board_skin_path/write.skin.php"); ?></td>
</tr>
<? } ?>
<tr><td height="1" style="background:#DDD;"></td></tr>
<tr><td height="10"></td></tr>
<tr>
<td align="center">
<!-- 게시물 리스트 시작 -->
<?
$lists = array();
for ($i=0; $i<count($list); $i++) {
$lists[$i] = $list[$i];
}
?>
<? for ($ii=0; $ii < count($lists); $ii++) {
$profile = get_member($lists[$ii][mb_id]);
include "$board_skin_path/inc.list_main.php";
// 수정, 삭제 링크
$update_href = "{$write_href}&w=u&bo_table=$bo_table&wr_id={$lists[$ii][wr_id]}&page=$page" . $qstr;
$delete_href = "javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table={$bo_table}&wr_id={$lists[$ii][wr_id]}&page=$page".urldecode($qstr)."');";
if ($lists[$ii][wr_1] == "")
$lists[$ii][wr_1] = "1.gif";
$lists[$ii][datetime]=substr($lists[$ii][wr_datetime],0,4)."/".substr($lists[$ii][wr_datetime],5,2)."/".substr($lists[$ii][wr_datetime],8,2)." (".substr($lists[$ii][wr_datetime],11,8).")";
//$lists[$ii][date]=date("Y-m-d H:i:s", $lists[$ii][wr_datetime]) ;
?>
<table width="<?=$width?>" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="fboardlist" method="post" action="" style="margin:0">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<tr>
<td width="20" height="30" align="center" valign="middle" class="small color_666" style="padding-left:6px;">*</td>
<td align="left" valign="middle" class="small color_666" style="padding-left:6px;">
<?=$lists[$ii][name]?>
l <? echo nl2br(url_auto_link($lists[$ii][wr_content])); ?><? echo $secret_msg; ?></span></span></span></td>
<td width="10%" class="small color_666" style="padding-left:6px;"><span class="v7 color_ccc" style="padding-right:4px;">
<? if($is_admin || $lists[$ii][comment_cnt]) { ?>
<? if($is_admin) { ?>
<a href="javascript:comment_wri('comment_write', '<?=$lists[$ii][wr_id]?>');">
<? } ?>
<? if($lists[$ii][comment_cnt]) { ?>
re
<?=$lists[$ii][comment_cnt]?><? } else { ?>
re
<? } ?>
<? if($is_admin) { ?>
</a>
<? } ?>
<? } ?>
<? if(($member[mb_id] && ($member[mb_id] == $lists[$ii][mb_id])) || $is_admin) { ?>
| <a href="<?=$write_href?>&w=u&wr_id=<?=$lists[$ii][wr_id]?>&sca=<?=$sca?>&page=<?=$page?>">m</a> | <a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$lists[$ii][wr_id]?>&sca=<?=$sca?>&page=<?=$page?>';}">d</a>
<? } else if (!$lists[$ii][mb_id]) { ?>
<a href="./password.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$lists[$ii][wr_id]?>&sca=<?=$sca?>&page=<?=$page?>">d</a>
<? } ?>
</span></td>
</tr>
</form>
<tr>
<td colspan="3" valign="top">
<!-- 게시물 내용 보기 끝 -->
<?
$wr_id = $lists[$ii][wr_id];
include ("$board_skin_path/view_comment.php");
?>
</td>
</tr>
</table>
</td>
</tr>
<? if ($ii+1 < count($lists)) { //마지막 라인 생략?>
<tr><td height="1" style="background:#DDD;"></td></tr>
<tr><td height="10"></td></tr>
<? } ?>
</table>
<?
}
// 필터
echo "<script language='javascript'> var g4_cf_filter = '$config[cf_filter]'; </script>\n";
echo "<script language='javascript' src='$g4[path]/js/filter.js'></script>\n";
if (!$member[mb_id]) // 비회원일 경우에만
echo "<script language='javascript' src='$g4[path]/js/md5.js'></script>\n";
?>
<? if (count($lists) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align=center colspan='2' height=100 class='small'>방문 흔적이 없습니다.</td></tr></table>"; } ?>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td height="1" colspan="2" style="background:#DDD;"></td></tr>
<tr>
<td width="40%" height="18" class="v7 color_999">
<? if ($list_href) { ?> <a href="<?=$list_href?>">list</a><? } ?><? if ($admin_href) { ?><a href="<?=$admin_href?>"> *</a><?}?>
</td>
<td width="60%" align="right" style="padding:4;" class="v7 color_999">
<!-- 버튼 링크 -->
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<input type="hidden" name=sfl value='wr_subject||wr_content'><input type="hidden" name=sop value="and">
<input name=stx maxlength=15 size=26 itemname="검색어" required value="<?=$stx?>" class="ed"><input type=image src="<?=$board_skin_path?>/img/e_search.gif" border=0 align=absmiddle></td>
</form>
</tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width="100%" height="30" align="center">
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<<", $write_pages);
$write_pages = str_replace("이전", "Prev", $write_pages);
$write_pages = str_replace("다음", "Next", $write_pages);
$write_pages = str_replace("맨끝", ">>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font class=\"color_gold2\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
//if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</script>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;
</script>
<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str)
{
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete()
{
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
------
간간히 보이는데 잘못건드릴까봐 무서워서 보고만 있습니다^^;;
부탁드립니다ㅠㅠ
댓글 전체