특정 조건에 맞는 최신글만 보이게 하려면..?

· 2012-11-30 (금) 17:04:46 · 1848 · 2
<input type=radio name="wr_1" value="고양이" <? if($write[wr_1] == "고양이") echo "checked"; ?> > 고양이
<input type=radio name="wr_1" value="멍멍이" <? if($write[wr_1] == "멍멍이") echo "checked"; ?> > 멍멍이

이런 식의 글을 작성 시..
최신 글(latest)에..
고양이로 작성된 글만 보이게 하려면 어떡해야하나요..?
|

댓글 2개

lib/latest.lib.php 를 여시면
중간쯤에
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
부분이 있습니다

if($bo_table=='해당게시판명')
{
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_1= '고양이' order by wr_num limit 0, $rows ";
}
else
{
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
}
으로 처리하시면 되실듯 합니다
다른 방법
lib/latest.lib.php
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows "; ---> 수정 $options 추가
//수정 후
$sql = " select * from $tmp_write_table where wr_is_comment = 0 $options order by wr_num limit 0, $rows ";

최신글 출력시
<?=latest("basic", 'test', 10, 70, "'and wr_1='고양이'");
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
12-11-30 조회 833
12-11-30 조회 1,389
12-11-30 조회 930
12-11-30 조회 1,624
12-11-30 조회 1,849
12-11-30 조회 1,303
12-11-30 조회 917
12-11-30 조회 1,612
12-11-30 조회 2,877
12-11-30 조회 1,684
12-11-30 조회 1,169
12-11-30 조회 2,000
12-11-30 조회 1,675
12-11-30 조회 2,422
12-11-30 조회 1,525
12-11-30 조회 1,350
12-11-30 조회 927
12-11-30 조회 1,057
12-11-30 조회 1,075
12-11-30 조회 3,458