학

코멘트 비밀글 작성시 구분 쉽게...

· 2007-06-09 (토) 13:25:33 · 3142 · 3
그누보드가 4.21 번대로 업데이트 되면서 코멘트에도 비밀글을 작성할 수 있게 되었습니다.
 
게시물 작성자나 코멘트 작성자 외에는 비밀글입니다라는 표시가 있지만...
정작 게시물 작성자나 코멘트 작성자 자신은 비밀글인지 아닌지 표시가 없습니다.
 
view_comment.skin.php
                <?
                $str = $list[$i][content];
                if ($str == '비밀글 입니다.')
                    $str = "<span class='cloudy small'>$str</span>";
                $str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
                $str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
                $str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
                echo $str;
                ?>
위를 아래와 같이 수정하면 됩니다.
 
                <?
                $str = $list[$i][content];
//                if ($str == '비밀글 입니다.')
//                    $str = "<span class='cloudy small'>$str</span>";
                $str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
                $str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
                $str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
//                echo $str;
                if (strstr($list[$i][wr_option], "secret")) { // 비밀글이라면
                    echo "<span class='cloudy small'>[비밀글]</span> $str";
                } else {
                    echo $str;
                }
                ?>
|

댓글 3개

2007-06-09 (토) 13:29:03
오~~ 감사합니다.
<?
$str = $list[$i][content];
// if ($str == '비밀글 입니다.')
// $str = "<span class='cloudy small'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
// echo $str;

if (strstr($list[$i][wr_option], "secret")) { // 비밀글이라면
echo "<img src=/gnuboard4/skin/board/basic/img/icon_secret.gif> $str";
} else {
echo $str;
}
?>

아이콘으로 하는게 좀 더 이쁜거 같아요~
2007-10-20 (토) 20:37:47
비밀 코멘트에 열쇠 아이콘 표시
댓글을 작성하시려면 로그인이 필요합니다.

그누4 팁자료실

3,309건

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
07-06-30 조회 3,873
07-06-30 조회 2,837
07-06-29 조회 5,630
07-06-29 조회 2,795
07-06-28 조회 3,211
07-06-28 조회 5,297
07-06-27 조회 2,963
07-06-26 조회 5,542
07-06-26 조회 7,353
07-06-21 조회 3,960
07-06-20 조회 3,974
07-06-20 조회 3,999
07-06-20 조회 5,258
07-06-19 조회 4,208
07-06-19 조회 4,542
07-06-16 조회 4,623
07-06-14 조회 5,690
07-06-12 조회 4,857
07-06-09 조회 3,685
07-06-09 조회 3,143