미채택 완료
질문에 답을 얻었는데 한가지가 잘안되어서 다시질문 드립니다.
여분필드 6에 등록된글만 목록으로 추출되게 하려 합니다
지난번 질문에서 고맙게도 답을 얻어 실행 해보았습니다
제목은 정확히 출력이되는데 첨부된 사진출력을 하지못하여 이렇게
다시 질문에 올려 봅니다
죄송한일이지만 답변 부탁드립니다.
아래코드는 지난번에 답을 얻은 코드 입니다
여기에 첨부사진출력이 필요한데 잘되지 않는군요
<?php
// 추천된 게시물 가져오기 (wr_6에 추천이 입력된 글)
$sql = " select * from {$write_table}
where wr_6 != ''
and wr_is_comment = 0
order by wr_datetime desc
limit 0, 5 "; // 최근 5개만 출력
$result = sql_query($sql);
?>
<!-- 추천글 목록 출력 -->
<?php if(sql_num_rows($result) > 0) { ?>
<div class="recommended-posts">
<h2>추천 게시물</h2>
<ul>
<?php
while ($row = sql_fetch_array($result)) {
$subject = conv_subject($row['wr_subject'], 40); ?>
<?php echo $subject ?>
<?php
}
} ?>
감사합니다^^
|
답변 2개 / 댓글 6개
Copy
$file = get_file($bo_table, $row['wr_id']);
foreach($file as $view_file) {
echo get_file_thumbnail($view_file);
}
이렇게 해보세요.
답변에 대한 댓글 6개
[code]
<?php
while ($row = sql_fetch_array($result)) {
$subject = conv_subject($row['wr_subject'], 40);
echo $subject;
$file = get_file($bo_table, $row['wr_id']);
foreach($file as $view_file) {
echo get_file_thumbnail($view_file);
}
}
}
?>
[/code]
$bo_table 는 게시판 코드를 지정해주셔야 합니다.
<?php
while ($row = sql_fetch_array($result)) {
$subject = conv_subject($row['wr_subject'], 40);
echo $subject;
$file = get_file($bo_table, $row['wr_id']);
foreach($file as $view_file) {
echo get_file_thumbnail($view_file);
}
}
}
?>
[/code]
$bo_table 는 게시판 코드를 지정해주셔야 합니다.
여전히 안됩니다 ㅠㅠ
<?php
// 추천된 게시물 가져오기 (wr_6에 추천이 입력된 글)
$sql = " select * from {$write_table}
where wr_6 != ''
and wr_is_comment = 0
order by wr_datetime desc
limit 0, 5 "; // 최근 5개만 출력
$result = sql_query($sql);
?>
<!-- 추천글 목록 출력 -->
<?php if(sql_num_rows($result) > 0) { ?>
<div class="recommended-posts">
<h2>추천 게시물</h2>
<ul>
<?php
while ($row = sql_fetch_array($result)) {
$subject = conv_subject($row['wr_subject'], 40);
$file = get_file($bo_table, $row['wr_id']);
foreach($file as $view_file) {
echo get_file_thumbnail($view_file);
}
}
?>
<?php } ?>
이렇게 했습니다.
$bo_table 게시판 코드가 뭔가요?
상단에 require_once G5_LIB_PATH . '/thumbnail.lib.php'; 추가 했습니다만 ..
이걸하려는것은 글목록위에 이목록을 뽑아올려는 겁니다
<?php
// 추천된 게시물 가져오기 (wr_6에 추천이 입력된 글)
$sql = " select * from {$write_table}
where wr_6 != ''
and wr_is_comment = 0
order by wr_datetime desc
limit 0, 5 "; // 최근 5개만 출력
$result = sql_query($sql);
?>
<!-- 추천글 목록 출력 -->
<?php if(sql_num_rows($result) > 0) { ?>
<div class="recommended-posts">
<h2>추천 게시물</h2>
<ul>
<?php
while ($row = sql_fetch_array($result)) {
$subject = conv_subject($row['wr_subject'], 40);
$file = get_file($bo_table, $row['wr_id']);
foreach($file as $view_file) {
echo get_file_thumbnail($view_file);
}
}
?>
<?php } ?>
이렇게 했습니다.
$bo_table 게시판 코드가 뭔가요?
상단에 require_once G5_LIB_PATH . '/thumbnail.lib.php'; 추가 했습니다만 ..
이걸하려는것은 글목록위에 이목록을 뽑아올려는 겁니다
답변을 작성하려면 로그인이 필요합니다.
그러나 에러가 납니다^^