소스에 조건을 주어 이미지를 추출하려고 합니다
본문
아래 소스는 이미지를 추출하는 소스입니다.
아래 소스에 조건을 주어 이미지를 추출하려고 합니다.
조건은 wr_12에 카니발이라고 쓰여진 이미지만 추출하려고 합니다.
where 조건문을 어디에 넣어야 하고
where wr_12 = '카니발'; 라고 하면 되는지요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//*** 개인정보보호를 위한 이메일주소 노출방지 ***
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=8; // 이미지 가로갯수
$imgwidth=70; //표시할 이미지의 가로사이즈
$imgheight=80; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=95% border=0 cellpadding='0' cellspacing='0' align='center'>
<tr><td colspan=<?=$cols;?> height=10></td></tr>
<tr>
<td colspan=<?=$cols;?> height=20 align=left>
<a href='<?=$g4[path]?>/car/board.php?bo_table=<?=$bo_table?>'><span style='color:gray; font-weight:bold'>카니발/span></a>
</td>
</tr>
<tr><td colspan=<?=$cols?> height=10></td></tr>
<?
for ($i=0; $i<count($list); $i++)
{
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]) ;
$href = "$g4[path]/car/board.php?bo_table=$bo_table";
//이미지 없을때 표시할 이미지 설정
if (!file_exists($img) || !$list[$i][file][0][file])$img = "$latest_skin_path/img/noimage.gif";
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='5' cellspacing='0' align='center'>
<tr>
<td align='center'>
<a href='$g4[path]/car/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$imgwidth}' height='{$imgheight}' border='0' align='absmiddle' title='$title'></a>
</td>
</tr>
<tr>
<td align='center'><a href='$g4[path]/car/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><font size="1"><b>{$list[$i][wr_32]}/{$list[$i][wr_33]}</b></font><br>
{$list[$i][wr_20]}{$list[$i][wr_21]}</a></td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
<tr><td colspan=<?=$cols;?> height=10></td></tr>
</table>
<? if (count($list) == 0) { ?><br><center>등록된 게시물이 없습니다.</center><br><? } ?>
답변 2
여기는 쿼리를 출력하는 echo 부분이니까요
원하시는 소팅 조건은 쿼리에 걸어야죠
콜라시러님, 답변 대단히 감사드립니다.
조건을 걸기위해서
어느 파일을 찾아야 하는 지요.
답변을 작성하시기 전에 로그인 해주세요.