잘되던 최신글이 갑짜기 안됩니다~

잘되던 최신글이 갑짜기 안됩니다~

if ($list[$i][ca_name]==사과 or $list[$i][ca_name]==과자) {
이 줄을 넣어서 사과와 과자 분류만 최신글로 뽑아왔습니다~
잘 돌아가던애가 오늘 갑짜기 안되네요~
아무것도 가져오지못합니다~ 이부분을 삭제하면 잘돌아갑니다~
이유가 뭘까요~

이런방법말고 다른 방법도있으면 알려주세요~

초짜라 상세히 알려주시면 정말 감사하겠습니다~~

latest.skin.php

<?

$thumb_width = 202; // 이미지 가로크기
$thumb_height = 216; // 이미지 세로크기
$data_path = $g4[path]."/data/file/$bo_table";

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

//썸네일 갤러리 전용 최신글

$mod = 4; // 한행당 출력할 썸네일 이미지갯수
?>

<table width='' align='center' cellpadding='0' cellspacing='2' border='0'>
<tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($list[$i][ca_name]==사과 or $list[$i][ca_name]==과자) {
if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; }

$image = $list[$i][file][0][file]; //원본

$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
//$thumb = $thumb_path. "/". $list[$i][wr_id];

//$g4[path]/data/file/$bo_table/$image
?>

<?
echo "<td align='center' width=240>";
echo "<table width=100 border=0 cellspacing=0 cellpadding=0>";
echo "<tr><td><table border=0 cellspacing=0 cellpadding=0>";
echo "<tr><td><img src=/images/tl_01.jpg width=222 height=10></td></tr>";
echo "<tr><td><table width=100% border=0 cellspacing=0 cellpadding=0>";
echo "<tr><td width=10><img src=/images/tl_02.jpg width=10 height=216></td><td align=center>";

echo "<a href='{$list[$i][href]}'><img src='$img' width='$thumb_width' height='$thumb_height' alt='{$list[$i][subject]}' border='0' style='border:0 solid #000000;' ></a>";

echo "</td><td width=10><img src=/images/tl_04.jpg width=10 height=216></td>";
echo "</tr></table></td></tr><tr><td><img src=/images/tl_05.jpg width=222 height=10></td></tr></table></td>";
echo "</tr><tr><td height=8></td></tr><tr><td>";

echo "<a href='{$list[$i][href]}'><center><font class=w_list>[{$list[$i][ca_name]}]

{$list[$i][subject]}</font></center></a>";

echo "</td></tr></table>";
echo "</td>";
?>

</td>
<? }
} ?>

<?
// td(열)의 나머지 갯수를 구한후 빈 td(열)을 출력한다.
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++) {
echo "<td>&nbsp;</td>";
}
?>

<? if (count($list) == 0) { echo "<td colspan=$mod align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
------------------------------------------------

index.php

<?
// 최신글
$sql = " select bo_table, bo_subject from $g4[board_table] order by gr_id, bo_table ";
$result = sql_query($sql);

// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.

// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("la_picture_thumb", "poto1", 12, 70);
echo "<p>\n";

?>
|

댓글 3개

if ($list[$i][ca_name]=="사과" || $list[$i][ca_name]=="과자")
".... if ($list[$i][ca_name]==사과 or $list[$i][ca_name]==과자) {
이 줄을 넣어서 사과와 과자 분류만 최신글로 뽑아왔습니다~
잘 돌아가던애가 오늘 갑짜기 안되네요~ .... "

소스를 보면 이게 아닙니다. 뽑아낸 최근글 중에서 사과나 과자만을 가져 오려고 하는데
없다면 아무것도 안 보이죠.

이런 경우 처음부터 사과나 과자만을 디비에서 가져 오도록 프로그램을 수정해야 합니다.
해결했습니다~ 두분 다 감사드립니다~^^
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
17년 전 조회 750
17년 전 조회 676
17년 전 조회 777
17년 전 조회 737
17년 전 조회 764
17년 전 조회 749
17년 전 조회 849
17년 전 조회 940
17년 전 조회 768
17년 전 조회 773
17년 전 조회 736
17년 전 조회 952
17년 전 조회 1,407
17년 전 조회 812
17년 전 조회 949
17년 전 조회 932
17년 전 조회 841
17년 전 조회 756
17년 전 조회 980
17년 전 조회 814
🐛 버그신고