테스트 사이트 - 개발 중인 베타 버전입니다

swfupload 랜덤 겔러리 출력 latest 관련

· 11년 전 · 1731 · 3
galley 라는 게시판 안의 내용을 랜덤으로 최신글(겔러리) 로 보여지게 하려 합니다.

현 사용 스킨 : http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=142856&sca=&sfl=wr_subject%7C%7Cwr_content&stx=swfupload

swfupload 를 제외한 일반 파일첨부 게시판은 <?=random_latest('')?> 로 정상적으로 출력됩니다.


swfupload 스킨으로 업로드된 사진 중

<?=latest('')?> 는 가장 최신글의 사진은 뽑아지지만

<?=random_latest('')?> 로는 "게시물이 없습니다." 가 출력됩니다.

random_latest.lib.php 의 내용은 아래와 같으며

[code]
//최신글 랜덤 추출 방법
function random_latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;

if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";

$current_time = time();
$opentime = date("Ymd", $current_time); // 컬랜트 타임을 일반시간으로 전환

$list = array();

$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);

$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_10 >='$opentime' order by rand() desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);

ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();

return $content;
}
[/code]

아마도 swfupload 스킨의 이미지 업로드 처리가 달라 게시물이 없다고 나오는듯 한데

어느부분을 수정하고 추가해야할지 도움을 요청합니다 ㅠㅠㅠㅠㅠ

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 3개

스킨이나 함수에는 이상한 점은 없는거같은데요..
function 의 21번째 주석 제거 하고 쿼리문 확인 해보세욤..^^
$opentime 변수가 오늘보다 크거나 같길래 뭔가 했더니 기간제 게시물 뽑아오는 거군요..
혹시 게시글의 기간부분이 지나거나 해서 그런거 아닌가 생각도 드네요..^^;
단순한 $opentime 변수를 변경하였더니 되었습니다. 너무너무 감사합니다.

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440