최근글 new아이콘 붙이기 [제목앞에 붙일 것이냐 아니면 뒤에 붙일것이냐?] > Web Development

본문 바로가기
  • kb@lovelet.com
사이트 내 전체검색

RESOURCES Web Development

최근글 new아이콘 붙이기 [제목앞에 붙일 것이냐 아니면 뒤에 붙일것이냐?]

페이지 정보

본문

저 또한 초보인지라 지금까지 유용한팁란을 뒤적이면서 짜집기 해가면서 알아낸것입니다.
제로보드 고수님들에게 감사를 먼저 드리면서 짧게 적겠습니다.

출처: 유용한팁란의 각종 제로보드 고수님들의 팁란에서 추출됨,.

        제로보드팁란 고수님들의 이름들을 밝히지 못해 죄송합니다.
                워낙 여기저기 다니면서 본거라 정리를 할 수가 없네요.      (__^)

유용한 팁란 뒤적이면서 new붙이는 방법 또한 많더군요.
특정 게시판 하나에만 new아이콘 붙이기 하실려면 이 방법을 사용하지 마세요.

모든 게시판에 일률적으로 new아이콘이 붙습니다.


일단 깔끔한 list_check.php파일을 하나 꺼집어 내세요.


원본소스

/*********************************************************************************************
* 넘겨지는 데이타에 대한 일괄 정리
********************************************************************************************/
function list_check(&$data,$view_check=0) {

        global        $keyword, $sn, $ss, $sc, $setup, $member, $href, $id, $dir, $category_data, $is_admin, $_zbResizeCheck,
                        $name,$email,$subject, $sort, $prev_no, $no,$homepage, $memo, $hit, $vote, $ip, $comment_num, $sitelink1, $sitelink2,
                        $file_name1, $file_name2, $file_download1, $file_download2, $file_size1, $file_size2,
                        $upload_image1, $upload_image2, $category_name, $date, $reg_date, $insert, $icon, $face_image,$number,$loop_number,
                        $a_file_link1, $a_file_link2, $a_reply, $a_delete, $a_modify, $zbLayer,  $_zbCheckNum,
                        $_listCheckTime;


수정소스            맨뒷부분에 $_listCheckTime, $cool, $new;    붙이세요.
/*********************************************************************************************
* 넘겨지는 데이타에 대한 일괄 정리
********************************************************************************************/

function list_check(&$data,$view_check=0) {

        global        $keyword, $sn, $ss, $sc, $setup, $member, $href, $id, $dir, $category_data, $is_admin, $_zbResizeCheck,
                        $name,$email,$subject, $sort, $prev_no, $no,$homepage, $memo, $hit, $vote, $ip, $comment_num, $sitelink1, $sitelink2,
                        $file_name1, $file_name2, $file_download1, $file_download2, $file_size1, $file_size2,
                        $upload_image1, $upload_image2, $category_name, $date, $reg_date, $insert, $icon, $face_image,$number,$loop_number,
                        $a_file_link1, $a_file_link2, $a_reply, $a_delete, $a_modify, $zbLayer,  $_zbCheckNum, $file_type, $file_type1, $file_type2,
                        $_listCheckTime, $cool, $new;







다음 밑으로 쭈욱 내려 가셔서 이부분을 찾어세요.
       
// 제목에 링크 거는 부분;





찾어셨어면 그 부분 바로 위에 아래 소스를 붙이세요.
cool마크랑 hot마크의 이미지경로 안에는 cool.gif랑 hot.gif가 있어야 합니다.
new.gif도 있어야 하구요~~~~

//cool 설정하는 곳
$cool="";
if($hit>=30)$cool="<img src=/bbs/images/cool.gif>";    //30회이상 조회시 cool마크
if($hit>=40)$cool="<img src=/bbs/images/hot.gif>";      //40회이상 조회시 hot마크
if($hit<=29)$cool="";


//new 설정하는 곳
$new = " ";
$check_time=(time()-$data[reg_date])/60/60;
if($check_time>48)$new.=" ";
if($check_time<=48)$new.="<img src=/bbs/images/new.gif>";      //48시간이내 등록글 new마크

// 제목에 링크 거는 부분;





그리고 마지막으로 수정할 사항은
       
수정전
=================================================================================================       
        // 제목에 링크 거는 부분;
        if($member[level]<=$setup[grant_view]||$is_admin) {
                //if($setup[use_status]&&!$data[is_secret]) $addShowComment = " onMouseOver=\\"showComment('$showCommentStr',true)\\" onMouseOut=\\"showComment('',false)\\" ";
                if($setup[use_status]&&!$data[is_secret]) $addShowComment = " title=\\"$showCommentStr\\" ";
                $subject="<a href=\\"".$view_file."?$href$sort&no=$data[no]\\" $addShowComment >".$subject."</a>";
        }


아래 수정후의 내용중 한가지만 선택해서 붙여 넣기 하시면 되겠죠?

수정 후[제목앞에 new마크 붙이기]
=================================================================================================       
// 제목에 링크 거는 부분;
        if($member[level]<=$setup[grant_view]||$is_admin) {
                //if($setup[use_status]&&!$data[is_secret]) $addShowComment = " onMouseOver=\\"showComment('$showCommentStr',true)\\" onMouseOut=\\"showComment('',false)\\" ";
                if($setup[use_status]&&!$data[is_secret]) $addShowComment = " title=\\"$showCommentStr\\" ";
                $subject=$new.  $cool."<a href=\\"".$view_file."?$href$sort&no=$data[no]\\" $addShowComment >"  .$subject."</a>";
        }



수정 후[제목뒤에 new마크 붙이기]
=================================================================================================       
// 제목에 링크 거는 부분;
        if($member[level]<=$setup[grant_view]||$is_admin) {
                //if($setup[use_status]&&!$data[is_secret]) $addShowComment = " onMouseOver=\\"showComment('$showCommentStr',true)\\" onMouseOut=\\"showComment('',false)\\" ";
                if($setup[use_status]&&!$data[is_secret]) $addShowComment = " title=\\"$showCommentStr\\" ";
                $subject="<a href=\\"".$view_file."?$href$sort&no=$data[no]\\" $addShowComment >" .$subject. $new. $cool"</a>";
        }



수정이 끝났네요.
그럼 서버에 올리시고 테스트 해보시면 제목의 앞 또는 뒤에 new마크가 붙을것 입니다.

Share Post:

댓글목록

등록된 댓글이 없습니다.

Sign In
OR
Don't have an account? SIGN UP

Keywords

Visits

접속자

Total Visits
1,890,088