최근글에서 이미지가 있는글만 뽑아오게 하고싶습니다.;; 정보
최근글에서 이미지가 있는글만 뽑아오게 하고싶습니다.;;본문
최근글에서 이미지가 등록된 글만 뽑아와서 순서대로 몇개를 보여주려고 하는데
아무리 찾아도 관련 내용도 못찾겠고,, php 를 몰라서 개인적으로 해결하기가 넘 어렵습니다.
좀 도와주시면 감사드리겠습니다.
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40)
{
global $g4;
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$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);
$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_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();
$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 요부분을 어떻게 바꾸면 될것같은데 도저히 모르겠습니다.
ㅠㅠ
댓글 전체
첨부 파일은 모두 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 ";
$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장을 올릴경우 올린사진숫자만큼 최신글에서는 다 나오는군요 ;; 쩝..
암튼 좀더 고민을 해봐야겠네요 ㅠㅠ
암튼 좀더 고민을 해봐야겠네요 ㅠㅠ
굿팁
와 찾던 팁 감사해요!