[분류] 사용할때, 답변작성시 원글과 분류를 일치시키기 --  2.62 버전 > 그누3 팁자료실

그누3 팁자료실

[분류] 사용할때, 답변작성시 원글과 분류를 일치시키기 --  2.62 버전 정보

그누호환 [분류] 사용할때, 답변작성시 원글과 분류를 일치시키기 --  2.62 버전

본문

// 분류 옵션을 얻음
// 수정일 : 4336-07-17
// 수정한 사람: 길선아빠
// 수정 내용:  답변 작성시에 분류를 원글에 일치시키도록 함.
function get_category_option($table)
{
    global $cfg, $stext, $w, $wr_id;
$sql = " select * from {$table}_cat order by ca_id ";
    $result = sql_query_error($sql);
$stext_b ="";
if ($w == "r") {
$sql_b = " select ca_id from $table where wr_id = $wr_id";
$row_b = sql_fetch_array($sql_b);
 $stext_b = $row_b[0];
}
    $str = "";
    while ($row = mysql_fetch_array($result)) {
 &nbsp; &nbsp; &nbsp; &nbsp;$str .= "<option value='$row[ca_id]'";
if ((("" != $stext) && ($row[ca_id] == $stext)) ||
(("" != $stext_b) && $row[ca_id] == $stext_b)) {
$str .= " selected";
}
$str .= ">$row[ca_name]</option>\n";
 &nbsp; &nbsp;}
 &nbsp; &nbsp;mysql_free_result($result);
 &nbsp; &nbsp;return $str;
}
추천
2
  • 복사

댓글 전체

일반 게시판에서는 그리 필요한 기능은 아닙니다. ^ ^;

게시판의 리스트를  책, 논문, 강좌 등의 목차(장,절...)로 쓸때,
글작성을 조금 편하게 하려고 수정한 것입니다.
© SIRSOFT
현재 페이지 제일 처음으로