최근게시물에서 질문드립니다.

최근게시물을 모아서 뽑아오기 위해 아래와 같은 코드를 사용하였습니다.
작성자 이름과 작성시간을 뽑아오려면 어찌해야 하나요....
 
작성자 이름이 세글자 이상일 경우 세글자로 자르고 가운데를 별표 처리 하려면 어찌해야 하나요~
 
<?
function latest_scroll($skin_dir="",$rows, $subject_len,$options="")
{
    global $config;
    global $g4;
    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
    $list = array();

    $sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
        from $g4[board_new_table] a, $g4[board_table] b,  $g4[group_table] c
        where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and  a.wr_id = a.wr_parent
        order by a.bn_id desc limit 0,$rows";

    $result = sql_query($sql);
    for ($i=0; $row = sql_fetch_array($result); $i++)
    {
        $tmp_write_table = $g4[write_prefix].$row[bo_table];
        $row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
        $list[$i] = $row2;
        $list[$i][bo_table] = $row[bo_table];
        $list[$i][bo_subject] = $row[bo_subject];
        $list[$i][gr_subject] = $row[gr_subject];
        $list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
        $list[$i][wr_subject] = cut_str($row2[wr_subject], $subject_len, "…");
        $list[$i][comment_cnt] = "";
        if ($row2[wr_comment])
           $list[$i][comment_cnt] = "($row2[wr_comment])";
     }
        ob_start();
        include "$latest_skin_path/latest.skin.php";
        $content = ob_get_contents();
        ob_end_clean();
    return $content;
}
?>
|

댓글 2개

작성일:{$list[$i][datetime]}
글쓴이 : {$list[$i][name]}
조회 : {$list[$i][wr_hit]}
작성일:{$list[$i][datetime]}
글쓴이 : {$list[$i][name]}
조회 : {$list[$i][wr_hit]}
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
18년 전 조회 1,514
18년 전 조회 1,544
18년 전 조회 2,321
18년 전 조회 1,515
18년 전 조회 1,521
18년 전 조회 1,518
18년 전 조회 1,601
18년 전 조회 1,687
18년 전 조회 1,592
18년 전 조회 1,507
18년 전 조회 1,919
18년 전 조회 1,616
18년 전 조회 1,522
18년 전 조회 1,424
18년 전 조회 1,625
18년 전 조회 1,385
18년 전 조회 1,592
18년 전 조회 1,601
18년 전 조회 1,575
18년 전 조회 1,511
🐛 버그신고