모든게시판의 글리스트 만들기

모든게시판의 글리스트 만들기

QA

모든게시판의 글리스트 만들기

본문

질문1

검색해봤더니 new.php를 참고해서 만드신분들이 계시더라구요

근데 new.php는 일정기간이 지나면 삭제되지않나요?

 

질문2

혹여나 새로운 쿼리문을 작성해야한다면 union을 사용해서 만들어야할거같은데 지금 그누보드 보니까

union사용 금지 문구가 있던데 사용할수없나요?

 

질문3

union문구를 사용한다 할때 정규표현식으로 테이블명의 모든 게시판 글작성 테이블을 어떻게 전부 합쳐야할까요?

이 질문에 댓글 쓰기 :

답변 2

참고만 해 보세요.

 

<?php
include_once($_SERVER['DOCUMENT_ROOT'] ."/common.php");

 

$query=sql_query("select bo_table,bo_subject from g5_board");

 

while($rows=sql_fetch_array($query)) { 
$res[]="(select *, '". $rows['bo_table'] ."' as bo_table from g5_write_". $rows['bo_table'] ." where wr_is_comment=0)"; 

 

$tmp="select count(*) as cnt from g5_write_". $rows['bo_table'] ." where wr_is_comment=0";
$row=sql_fetch($tmp);
$total_count +=(int)$row['cnt'];
}

 

$rows=$config['cf_page_rows'];
$total_page=ceil($total_count/$rows);  
if($page<1) { $page=1; } 
$from_record=($page-1)*$rows; 

 

echo "전체글 ". $total_count ."개";

 

$res=implode("union all", $res);
$res .=" order by wr_datetime desc limit {$from_record}, {$rows}";
$query=sql_query($res);

for($i=0; $row=sql_fetch_array($query); $i++) {
$bo_subject=sql_fetch("select * from g5_board where bo_table='{$row['bo_table']}'");

$row['wr_datetime']=substr($row['wr_datetime'],0,10);
echo '<p><a href="'. G5_BBS_URL .'/board.php?bo_table='. $row['bo_table'] .'&wr_id='. $row['wr_id'] .'"><strong>['. $rowt['bo_subject'].']</strong>'. $row['wr_subject'] .'-'.$row['wr_datetime'].'</a></p>';
}

 

echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&page='); 
?>

질문1 답변

일정기간 => 일정기간을 늘리면됩니다.

기본 180일 0 하나만더 붙여도 ㅎㄷㄷ한 기간입니다.

 

질문2 답변

쿼리를 직접 구현하면 사용가능합니다.

일단 만들어서 적용을 해보시면 잘 아실겁니다.

 

질문3 답변

그누보드를 좀더 살펴보시고 시도하시는게 좋겠습니다.

g5_board 라는 테이블에 모든 테이블명이 있습니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 27
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT