채택완료

새글에 ip검색 하고 싶습니다

2019-05-15 (수) 11:11:22 3,829

새글에 ip검색 하고 싶습니다 

답변 1개

채택된 답변
+20 포인트

해당 게시판의 DB Table에 보시면 게시글작성자의 IP(wr_ip)가 존재합니다.

해당 컬럼을 프로그램소스상에서 불러내면됩니다.

IP 검색은 기존에 존재하는 검색 부분 form 에서 <option 을추가하시면됩니다.

<option value = 'wr_ip'>IP</option>

만약 테마를 사용하셨다면 테마안에 존재하는 skin 폴더의 해당게시판스킨의 list.skin.php 파일안에 보시면


<fieldset id="bo_sch">
    <legend>게시물 검색</legend>

    <form name="fsearch" method="get">
    <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
    <input type="hidden" name="sca" value="<?php echo $sca ?>">
    <input type="hidden" name="sop" value="and">
    <label for="sfl" class="sound_only">검색대상</label>
    <select name="sfl" id="sfl">
        <option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option>
        <option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option>
        <option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option>
        <option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option>
        <option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option>
        <option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option>
        <option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option>
    </select>
    <input name="stx" value="<?php echo stripslashes($stx) ?>" placeholder="검색어(필수)" required id="stx" class="sch_input" size="15" maxlength="20">
    <button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i> <span class="sound_only">검색</span></button>
    </form>
</fieldset>

부분이 존재합니다.

해당파일에서 

        <option value="wr_ip,0"<?php echo get_selected($sfl, 'wr_ip,0'); ?>>작성IP</option>

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