플리즈~ --;; 열람권한에 대해서...고수님들! 도와주세요. 정보
플리즈~ --;; 열람권한에 대해서...고수님들! 도와주세요.본문
열람할수 있는 권한에 대한 스킨을 수정중입니다.
그런데, 이것이 1:1 게시판의 성격이 있어서 처음 화면에 관리자와 작성자만 리스트 읽기 권한이 보이더라구요..
원본팁 주소:
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=53587
저는 리스트는 모두다 뿌려주고, 열람할 사람을 지정하면 링크걸려서 내용을 볼수 있게 하고 싶습니다.
-------------------------------------------------------------------------------------
아래의 소스는 원본소스로 지정한 사람과 관리자, 작성자만 볼수 있는거 같습니다.
저는 리스트는 다 보이지만 링크를 활성화해서 내용보기를 하고 싶습니다.
아래를 원본소스팁을 수정해서 맨아래 저의 게시판소스에 합치고 싶습니다.
if (ereg("$list[$i][wr_10]",$member[mb_nick])==true || @ereg("$member[mb_nick]",$list[$i][wr_10])==true || $member[mb_nick] == $list[$i][mb_nick] || $member[mb_nick] == $list[$i][wr_10] || $is_admin || $list[$i][is_notice]) {
--------------------------------------------------------------------------------------
아래가 저의 게시판소스입니다.
<?
for ($i=0; $i<count($list); $i++)
{
$_datetime=$list[$i][datetime2];
$_hit=$list[$i][wr_hit];
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$board_skin_path/img/mem_nopic.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
//$view_href = "";
//if ($is_admin)
$view_href = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>";
$checkbox = "";
if ($is_checkbox)
$checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
if($list[$i][wr_3]) $car_icon2 = "<img src='$board_skin_path/img/car_icon_02.jpg' border='0'>";
$tr = "";
if ($i && $i%$board[bo_gallery_cols]==0)
$tr = "</tr><tr>";
echo "$tr";
echo <<<HEREDOC
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="11px_cardfont">
{$checkbox}{$view_href}{$list[$i][subject]}</a>
<span style='color:#888888; cursor:hand;' title='{$list[$i][wr_9]}'>권한</span>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="board_line">
<tr>
<td bgcolor="#fbfbfb">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="11px_cardfont">
{$list[$i][name]}(<strong>ID</strong>:{$list[$i][mb_id]})<br/>
• {$list[$i][wr_1]}<br/>
• e-Mail: {$list[$i][wr_email]}<br/>
• Tel: {$list[$i][wr_tel]}<br/>
• Mobile: {$list[$i][wr_tel]}
</td>
</tr>
</table>
</td>
<td width="60" height="60" valign="top"><img src="{$img}" width="60" height="60" align='left' border="0" style='border:1px #E7E7E7 solid;' onmouseover=this.style.filter='alpha(opacity=70)' onmouseout=this.style.filter=''></td>
</tr>
<tr>
<td class="board_line" colspan="2"></td>
</tr>
<tr>
<td class="11px_cardfont" colspan="2">
• 홈페이지: {$list[$i][wr_homepage]}<br/>
<a href="javascript:NewWindow('$board_skin_path/mail.php?email={$list[$i][wr_3]}','mail_popup','500','400','custom','front');">$car_icon2</a><br/>
<a href='{$list[$i][wr_link1]}' target='_blank'></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
HEREDOC;
}
// 나머지 td 를 채운다.
if (($cnt = $i%$list_mod) != 0)
for ($k=$cnt; $k<$list_mod; $k++)
echo "<td> </td>\n";
if ($i == 0)
echo "<td colspan='$board[bo_gallery_cols]' height=50 align=center>게시물이 없습니다.</td>";
?>
그런데, 이것이 1:1 게시판의 성격이 있어서 처음 화면에 관리자와 작성자만 리스트 읽기 권한이 보이더라구요..
원본팁 주소:
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=53587
저는 리스트는 모두다 뿌려주고, 열람할 사람을 지정하면 링크걸려서 내용을 볼수 있게 하고 싶습니다.
-------------------------------------------------------------------------------------
아래의 소스는 원본소스로 지정한 사람과 관리자, 작성자만 볼수 있는거 같습니다.
저는 리스트는 다 보이지만 링크를 활성화해서 내용보기를 하고 싶습니다.
아래를 원본소스팁을 수정해서 맨아래 저의 게시판소스에 합치고 싶습니다.
if (ereg("$list[$i][wr_10]",$member[mb_nick])==true || @ereg("$member[mb_nick]",$list[$i][wr_10])==true || $member[mb_nick] == $list[$i][mb_nick] || $member[mb_nick] == $list[$i][wr_10] || $is_admin || $list[$i][is_notice]) {
--------------------------------------------------------------------------------------
아래가 저의 게시판소스입니다.
<?
for ($i=0; $i<count($list); $i++)
{
$_datetime=$list[$i][datetime2];
$_hit=$list[$i][wr_hit];
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$board_skin_path/img/mem_nopic.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
//$view_href = "";
//if ($is_admin)
$view_href = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>";
$checkbox = "";
if ($is_checkbox)
$checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
if($list[$i][wr_3]) $car_icon2 = "<img src='$board_skin_path/img/car_icon_02.jpg' border='0'>";
$tr = "";
if ($i && $i%$board[bo_gallery_cols]==0)
$tr = "</tr><tr>";
echo "$tr";
echo <<<HEREDOC
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="11px_cardfont">
{$checkbox}{$view_href}{$list[$i][subject]}</a>
<span style='color:#888888; cursor:hand;' title='{$list[$i][wr_9]}'>권한</span>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="board_line">
<tr>
<td bgcolor="#fbfbfb">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="11px_cardfont">
{$list[$i][name]}(<strong>ID</strong>:{$list[$i][mb_id]})<br/>
• {$list[$i][wr_1]}<br/>
• e-Mail: {$list[$i][wr_email]}<br/>
• Tel: {$list[$i][wr_tel]}<br/>
• Mobile: {$list[$i][wr_tel]}
</td>
</tr>
</table>
</td>
<td width="60" height="60" valign="top"><img src="{$img}" width="60" height="60" align='left' border="0" style='border:1px #E7E7E7 solid;' onmouseover=this.style.filter='alpha(opacity=70)' onmouseout=this.style.filter=''></td>
</tr>
<tr>
<td class="board_line" colspan="2"></td>
</tr>
<tr>
<td class="11px_cardfont" colspan="2">
• 홈페이지: {$list[$i][wr_homepage]}<br/>
<a href="javascript:NewWindow('$board_skin_path/mail.php?email={$list[$i][wr_3]}','mail_popup','500','400','custom','front');">$car_icon2</a><br/>
<a href='{$list[$i][wr_link1]}' target='_blank'></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
HEREDOC;
}
// 나머지 td 를 채운다.
if (($cnt = $i%$list_mod) != 0)
for ($k=$cnt; $k<$list_mod; $k++)
echo "<td> </td>\n";
if ($i == 0)
echo "<td colspan='$board[bo_gallery_cols]' height=50 align=center>게시물이 없습니다.</td>";
?>
댓글 전체

<? if ($is_admin || $member['mb_id'] == $list[$i][wr_2]) { ?><?=$view_href?><?=$list[$i][subject]?></a><? } else { ?><?=$list[$i][subject]?></a><? } ?>
list.skin에서 subject 부분에 위와 같이 넣어주고
write.skin 에서 wr_2 에 원하는 회원의 아이디를 입력해주면 됩니다. 해당 소스 작업은 하셔야겠지요.
주의하실 점은 view.skin 도 막아야 합니다.
상단에
<? if ($is_admin || $member['mb_id'] == $view[wr_2]) { ?>
요놈을 넣고
하단에
<? } else {
// 접근 제한
alert("잘못된 접근입니다.", $g4[path]);
} ?>
이렇게 넣어주어야 잘못된 접근을 막을 수 있겠지요.
전 편의상 wr_2 값에 회원 ID 를 적었는데 다른 wr_ 값을 사용하셔도 상관없지요.
list.skin에서 subject 부분에 위와 같이 넣어주고
write.skin 에서 wr_2 에 원하는 회원의 아이디를 입력해주면 됩니다. 해당 소스 작업은 하셔야겠지요.
주의하실 점은 view.skin 도 막아야 합니다.
상단에
<? if ($is_admin || $member['mb_id'] == $view[wr_2]) { ?>
요놈을 넣고
하단에
<? } else {
// 접근 제한
alert("잘못된 접근입니다.", $g4[path]);
} ?>
이렇게 넣어주어야 잘못된 접근을 막을 수 있겠지요.
전 편의상 wr_2 값에 회원 ID 를 적었는데 다른 wr_ 값을 사용하셔도 상관없지요.
<? if (ereg("$list[$i][wr_9]",$member[mb_nick])==true || @ereg("$member[mb_nick]",$list[$i][wr_9])==true || $member[mb_nick] == $list[$i][mb_nick] || $member[mb_nick] == $list[$i][wr_9] || $is_admin || $list[$i][is_notice])
echo "{$view_href}{$list[$i][subject]}</a>";
else
echo "{$list[$i][subject]}";
?>
위처럼 넣으니까, 관리자라도 제목이 출력이 전혀 안되네여
echo "{$view_href}{$list[$i][subject]}</a>";
else
echo "{$list[$i][subject]}";
?>
위처럼 넣으니까, 관리자라도 제목이 출력이 전혀 안되네여

제가 알려드린 코드로 작성해 보십시오.
전 잘 작동하거든요.
소스를 보니 알려드린 방식과 다르게 작업하셨네요.
핵심은 어드민 관리자와 지정한 회원아이디를 가진 회원만 리스트에서 링크를 걸려야 하는 것으로 아는데 위의 구문은 아이디가 아닌 mb_nick 을 사용하고 계시네요. 닉네임은 변경이 가능한 것이라 추천할 사항이 못 된답니다.
전 잘 작동하거든요.
소스를 보니 알려드린 방식과 다르게 작업하셨네요.
핵심은 어드민 관리자와 지정한 회원아이디를 가진 회원만 리스트에서 링크를 걸려야 하는 것으로 아는데 위의 구문은 아이디가 아닌 mb_nick 을 사용하고 계시네요. 닉네임은 변경이 가능한 것이라 추천할 사항이 못 된답니다.
감사합니다. 잘 해결되었습니다.