
Copy
<? for ($j=0; $j<count($file)-1; $j++) { echo "<tr ><td style='border-bottom:0px solid #ddd;border-top:0px solid #ff6600;padding:3px 3px;'>"; $sql = " select *, substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no "; $result = sql_query($sql); while ($row = sql_fetch_array($result)) echo '<img src="'. $board_skin_url .'/filetype/'. $row['ext'].'.gif"> '; if( $list[$i]['wr_1'] <= $member['mb_level']) echo "<a href=\"{$file[$j][href]}\">"; echo $file[$j][source]; echo "(".$file[$j][size].")"; if( $list[$i]['wr_1'] >= $member['mb_level'] ) echo "</a>"; echo "</td></tr>"; } ?>
pdf.txt(5byte)
s.zip(169byte)
이런식으로 나오게끔 할려면 어찌해야 하는지 조언좀 부탁드려봅니다.
나름대로 G4 G5 팁자료실 다찾아서 이리저리 시도해봐도 여기서 또다시 좌절이네요;
|
답변 3개 / 댓글 4개
채택된 답변
+20 포인트
2015-07-01 (수) 16:07:58
이렇게 되셔야 하는거 아닌가요?
Copy
<?for ($j=0; $j<count($file)-1; $j++) { echo "<tr ><td style='border-bottom:0px solid #ddd;border-top:0px solid #ff6600;padding:3px 3px;'>"; $sql = " select *, substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no "); $result = sql_query($sql); while ($row = sql_fetch_array($result)) { echo '<img src="'. $board_skin_url .'/filetype/'. $row['ext'].'.gif"> '; if( $list[$i]['wr_1'] <= $member['mb_level']) { echo "<a href=\"{$file[$j][href]}\">"; echo $file[$j][source]; echo "(".$file[$j][size].")"; echo "</a><br>"; } } echo "</td></tr>";}?>
답변에 대한 댓글 2개
PotatoChips
2015-07-01 (수) 18:11:33
2015-07-01 (수) 20:41:53

카츠님 마지막 소스를 이용했을때의 출력화면 입니다.
출력되는 아이콘이 파일 #1 에 첨부된 것만 보여지는것 같습니다..
답변에 대한 댓글 1개
2015-07-01 (수) 23:25:06
sql 쿼리에 bf_no 값 조건을 추가하세요.
$tempdata = sql_fetch(" select substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' and bf_no='{$j}' order by bf_no ");
$tempdata = sql_fetch(" select substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' and bf_no='{$j}' order by bf_no ");
2015-07-01 (수) 18:09:55

카츠님 답변 감사합니다.
답변대로 시도해 보았는데 첨부이미지 처럼 되어버립니다.
Copy
<?php for ($j=0; $j<count($file)-1; $j++) { echo "<tr ><td style='border-bottom:0px solid #ddd;border-top:0px solid #ff6600;padding:3px 3px;'>"; $sql = " select *, substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no "; $result = sql_query($sql); while ($row = sql_fetch_array($result)) { echo '<img src="'. $board_skin_url .'/filetype/'. $row['ext'].'.gif"> '; echo "<a href=\"{$file[$j][href]}\">"; echo $file[$j][source]; echo "(".$file[$j][size].")"; echo "</a><br>"; } echo "</td></tr>"; }?>
답변에 대한 댓글 1개
2015-07-01 (수) 19:41:50
ㅋ 주신소스만 대충보고 적어드렸군요. while 반복문이 필요없네요.
[code]
<?php
for ($j=0; $j<count($file)-1; $j++) {
echo "<tr><td style='border-bottom:0px solid #ddd;border-top:0px solid #ff6600;padding:3px 3px;'>";
$tempdata = sql_fetch(" select substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ");
echo '<img src="'. $board_skin_url .'/filetype/'. $tempdata['ext'].'.gif"> ';
echo '<a href="'.$file[$j][href].'">'.$file[$j][source].' ('.$file[$j][size].')</a><br></td></tr>';
}
?>
[/code]
[code]
<?php
for ($j=0; $j<count($file)-1; $j++) {
echo "<tr><td style='border-bottom:0px solid #ddd;border-top:0px solid #ff6600;padding:3px 3px;'>";
$tempdata = sql_fetch(" select substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ");
echo '<img src="'. $board_skin_url .'/filetype/'. $tempdata['ext'].'.gif"> ';
echo '<a href="'.$file[$j][href].'">'.$file[$j][source].' ('.$file[$j][size].')</a><br></td></tr>';
}
?>
[/code]
답변을 작성하려면 로그인이 필요합니다.
답변대로 시도해 보았는데 첨부이미지 처럼 되어버립니다.
뭔가 될듯하면서도 참으로 어렵네요..