k

최근글에서 이미지가 있는글만 뽑아오게 하고싶습니다.;;

최근글에서 이미지가 등록된 글만 뽑아와서 순서대로 몇개를 보여주려고 하는데
아무리 찾아도 관련 내용도 못찾겠고,, php 를 몰라서 개인적으로 해결하기가 넘 어렵습니다.
 
좀 도와주시면 감사드리겠습니다.
 
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40)
{
    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 ";
    //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_id desc limit 0, $rows ";     
 
wr_is_comment = 0 요부분을 어떻게 바꾸면 될것같은데 도저히 모르겠습니다.
 
ㅠㅠ
|

댓글 7개

첨부 파일은 모두 image라고 가정합니다.

$sql = " select B.* from $tmp_write_table B join g4_board_file F on B.wr_id= F.wr_id where F.bo_table='$bo_table' and B.wr_is_comment = 0 order by F.wr_id desc limit 0, $rows ";
rolo님 진짜 감사드립니다. 되네요^^
완전히 이해는 못하지만 암튼 대강은 무슨말인지 알거같습니다. 감사합니다.
이렇게 한가지를 또 해결했네요...^^
첨부 파일이 이미지가 아닌 것도 나올 수 있습니다. ^^
그림파일밖에 사용안하니까 걱정없습니다 ^^
그런데 이게 사진을 2장을 올릴경우 올린사진숫자만큼 최신글에서는 다 나오는군요 ;; 쩝..
암튼 좀더 고민을 해봐야겠네요 ㅠㅠ
와 찾던 팁 감사해요!
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
06-06-01 조회 1,642
06-06-01 조회 1,592
06-06-01 조회 1,696
06-06-01 조회 1,600
06-06-01 조회 1,350
06-06-01 조회 1,595
피피터팬
06-06-01 조회 1,490
06-06-01 조회 1,508
피피터팬
06-05-31 조회 1,609
06-05-31 조회 1,083
06-05-31 조회 1,025
06-05-31 조회 1,122
06-05-31 조회 1,616
06-05-31 조회 1,193
06-05-31 조회 1,476
06-05-31 조회 1,692
06-05-31 조회 1,609
06-05-31 조회 1,490
06-05-31 조회 1,578
06-05-31 조회 1,180