테스트 사이트 - 개발 중인 베타 버전입니다

글쓴 인간이 관리자이면... 채택완료

민쯩먼저깔게요 8년 전 조회 3,436

글쓴 인간이 관리자이고 비밀글을 체크하면 회원에게는 안보이게 하려고 도움을 부탁드렸더니

 

<?php 

if (strstr($list[$i]['wr_option'], "secret") && $is_admin) {
$list[$i]['wr_content'] = url_auto_link(str_replace("<img","<img class='click_img'",$list[$i]['wr_content'])); 
echo $list[$i]['wr_content'] ; 

}
?>  

 

이렇게 하라고 감기약님이 알려주셨는데...

 

되긴 되는데

이후에 회원이 댓글 다는 것도 모두 감춰버리네요,,,

어떻게 해야할지...

도움 부탁드려요..

 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
8년 전

위 소스만 보면 비밀글이고 관리자가 아닌 경우에는 아무것도 출력되지 않네요.

else 구문을 추가하여 비밀글이 아닌 일반글을 출력시켜 주시면 됩니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

민쯩먼저깔게요
8년 전
감사한데요.,,그걸 할 줄 몰라서,,ㅋ
죄송,,제가 아주 허접입니다.
민쯩먼저깔게요
8년 전
잘됩니다 감사합니다!!

댓글을 작성하려면 로그인이 필요합니다.

8년 전

관리자가 쓴 비밀글만 빼고 다른 댓글은 다 보여야 한다는 이야기이죠? (관리자만 자신이 쓴 비밀글도 보이고)

그렇다면 위에 소스를 아래처럼 변경해보시고 테스트해보세요.

(관리자 ID가 admin 일 경우 입니다.)

혹시 안되시면 해당페이지 전체소스 올려주시면 제가 한번 봐드릴게요.

 

</p><p><span style="background-color: rgb(247, 247, 247); color: rgb(51, 51, 51); font-size: 12px; font-family: 돋움, Dotum, sans-serif;"><?php </span></p><p style="word-break: break-all; font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; color: rgb(80, 80, 80);"><span style="font-size: 14.004px;">if ( $list[$i]['wr_option']=="secret" && $list[$i]['mb_id'] == "admin" && $is_admin) {</span></p><p style="word-break: break-all; font-family: 돋움, Dotum, sans-serif; margin-left: 40px;"><span style="color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">$list[$i]['wr_content'] = url_auto_link(str_replace("<img","<img class='click_img'",$list[$i]['wr_content'])); </span><br style="color: rgb(51, 51, 51); font-size: 12px;"><span style="color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">echo $list[$i]['wr_content'] ; </span></p><p style="word-break: break-all; font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; color: rgb(80, 80, 80);">} else if ( $list[$i]['wr_option']!="secret" && $list[$i]['mb_id']!="admin" ){</p><p style="word-break: break-all; font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; color: rgb(80, 80, 80); margin-left: 40px;"><span style="color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">$list[$i]['wr_content'] = url_auto_link(str_replace("<img","<img class='click_img'",$list[$i]['wr_content'])); </span><br style="color: rgb(51, 51, 51); font-size: 12px;"><span style="color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">echo $list[$i]['wr_content'] ; </span></p><p style="word-break: break-all; font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; color: rgb(80, 80, 80);">}</p><p style="word-break: break-all; font-family: 돋움, Dotum, sans-serif;"><span style="color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">?> </span><font color="#505050"><span style="font-size: 14.004px;"> </span></font></p><p> </p><p> </p><p>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인