latest.lib.php 에서 회원정보 불러오기 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

latest.lib.php 에서 회원정보 불러오기 정보

latest.lib.php 에서 회원정보 불러오기

본문

<?
if (!defined('_GNUBOARD_')) exit;

// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
 
global $g4;

    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/basic";

    $list = array();

    $sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
    $board = sql_fetch($sql);

    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
    //$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
    // 위의 코드 보다 속도가 빠름


/////////////////////////////////////////////////////////////////

    $sql = " select * from $tmp_write_table where  wr_is_comment = 0 order by wr_num limit 0, $rows ";
    //explain($sql);
    $result = sql_query($sql);
    for ($i=0; $row = sql_fetch_array($result); $i++)
        $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len); 

////////////////////////////////////////////////////////////




    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}
?>

######################################### #############################

위쪽의 ////////////////////////////// 안의

$sql = " select * from $tmp_write_table where  wr_is_comment = 0 order by wr_num limit 0, $rows ";
구문에서요.. 

$sql = " select * from $tmp_write_table where mb_id = $member[mb_id] and wr_is_comment = 0 order by wr_num limit 0, $rows ";

이렇게 $member[mb_id]를 추가해서 회원정보도 함께 쓸려고 하는데 구문은 맞는거 같은데

function 안에 넣으니까 못불러오네요. 펑션 밖으로 빼니까 호출은 되던데요...

아시는분 좀 부탁드립니다. 새해 복많이 받으세요.
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로