울라프

게시판 글쓰기에서 분류 선택 radio 버튼으로 바꾸기

· 2021-11-17 (수) 12:07:50 · 5866 · 3
  • bbs/write.php 

    263라인 

  •  

     

     

    function get_category_option1($bo_table='', $ca_name='')
    {
        global $g5, $board, $is_admin;

        $categories = explode("|", $board['bo_category_list'].($is_admin?"|공지":"")); // 구분자가 | 로 되어 있음
        $str = "";
        for ($i=0; $i<count($categories); $i++) {
            $category = trim($categories[$i]);
            if (!$category) continue;

            $str .= "<label class='radio'><input type=\"radio\" name=\"ca_name\" value=\"$categories[$i]\" ";
            if($i==0) $str .= ' checked';
            if ($category == $ca_name) {
                $str .= ' checked';
            }
            $str .= ">  $categories[$i]     </label>";
        }

        return $str;
    }
    $category_option1 = '';
    if ($board['bo_use_category']) {
        $ca_name = "";
        if (isset($write['ca_name']))
            $ca_name = $write['ca_name'];
        $category_option1 = get_category_option1($bo_table, $ca_name);
        $is_category = true;
    }

     

     

     

     

     

  •  

  •  

  •  

  • write.skin.php 

  •  

  • <?php if ($is_category) { echo $category_option1;}?>

|

댓글 3개

좋은 팁 공유 감사합니다.
bbs/write.php 위 라인에 저것을 넣으라는 말인가요? 어떤 소스 아래 넣어야 하는 것인지? 조금만 더 자세한 설명 부탁드려도 될까요?
감사합니다.~
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
21-11-19 조회 5,199
21-11-17 조회 5,867
21-11-14 조회 5,949
21-11-12 조회 5,282
21-11-10 조회 6,108
21-11-10 조회 6,625
21-11-09 조회 1만
21-11-09 조회 5,930
21-11-08 조회 4,881
21-11-06 조회 6,088
21-11-06 조회 6,837
21-11-01 조회 1.4만
21-10-31 조회 4,716
21-10-30 조회 5,576
21-10-23 조회 4,631
21-10-20 조회 5,912
21-10-16 조회 4,511
21-10-16 조회 5,064
21-10-14 조회 5,354
21-10-12 조회 5,382
21-10-08 조회 7,359
21-10-07 조회 5,508
21-10-05 조회 5,290
21-10-03 조회 5,598
21-10-02 조회 5,149
21-09-29 조회 4,625
21-09-28 조회 7,026
21-09-25 조회 5,437
21-09-25 조회 6,123
21-09-25 조회 5,826