울라프

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

· 2021-11-17 (수) 12:07:50 · 6409 · 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,751
21-11-17 조회 6,410
21-11-14 조회 6,441
21-11-12 조회 5,757
21-11-10 조회 6,562
21-11-10 조회 7,086
21-11-09 조회 1.1만
21-11-09 조회 6,341
21-11-08 조회 5,309
21-11-06 조회 6,529
21-11-06 조회 7,284
21-11-01 조회 1.5만
21-10-31 조회 5,137
21-10-30 조회 6,018
21-10-23 조회 5,080
21-10-20 조회 6,370
21-10-16 조회 4,951
21-10-16 조회 5,511
21-10-14 조회 5,782
21-10-12 조회 5,852
21-10-08 조회 7,842
21-10-07 조회 5,974
21-10-05 조회 5,755
21-10-03 조회 6,065
21-10-02 조회 5,587
21-09-29 조회 5,059
21-09-28 조회 7,470
21-09-25 조회 5,891
21-09-25 조회 6,578
21-09-25 조회 6,313