ƯԽǵ ׷ֽű

׽   
   ȸ 14865   õ 0     õ 0    

latest.group.lib.php (6.3K), Down : 8, 2011-07

특정게시판들제외 그룹최신글입니다.
팁란이 없어서 여기에 올립니다. 적당한 자리가 있으면 불당님이 옮겨 주시면 고맙겠습니다.
 
 
 
사용법::  원본과 같습니다.
 
ex1)
<? include_once("$g4[path]/lib/latest_group.lib.php"); ?>
<?
$no_table = array(
'free',
'test'
);
echo latest_group_boardselect("basic", "free_group", 4, 38, $no_table);
?>
ex2)
<? include_once("$g4[path]/lib/latest_group.lib.php"); ?>
<?
$no_table = 'free';
echo latest_group_boardselect("basic", "free_group", 4, 38, $no_table);
?>
제외하는 게시판 없이 그룹내 최근게시물을 모두 출력하고 싶으시면
<? include_once("$g4[path]/lib/latest_group.lib.php"); ?>
<? echo latest_group_boardselect("basic", "free_group", 4, 38); ?>
 
아래는 함수입니다.
<?
// 낭만늑대님의 팁을 수정
// http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=11335&sca=&sfl=wr_content&stx=serialize&sop=and&spt=-2383&page=1
if (!defined('_GNUBOARD_')) exit;
// 함수 정의 시작
// 최신글 추출 - 선택한 그룹별로 원하는 게시판을 제외하고 원하는 수만큼 보여줌
function latest_group_boardselect($skin_dir="", $gr_id, $rows=10, $subject_len=40, $no_table="", $category="", $orderby="")
{
 global $config;
 global $g4;
 $list = array();
 $limitrows = $rows;
$sqlgroup = " select bo_table, bo_subject from $g4[board_table] where gr_id = '$gr_id' ";
// 제거할 테이블들
 if ($no_table) {
  $t_flag = serialize($no_table);
  if ($t_flag[0] == "a") { //Array이면
   for ($ic=0; $ic<count($no_table); $ic++) {
    $no_table = implode(" , ", $no_table);     
   }
  } else if ($t_flag[0] == "s") { //String이면
   $sqlgroup .= " and bo_table != '$no_table' ";
  }
 }
 $sqlgroup .= " and bo_use_search=1 order by bo_order_search ";
 $rsgroup = sql_query($sqlgroup);
if ($skin_dir)
  $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
 else
  $latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) {
  $bo_table = $rowgroup[bo_table];
// 테이블 이름구함
  $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_is_comment = 0 ";
  $sql .= (!$category) ? "" : " and ca_name = '$category' ";
  $sql .= (!$orderby) ? "  order by wr_id desc " : "  order by $orderby desc, wr_id desc ";
  $sql .= " limit $limitrows";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++, $k++) {
if(!$orderby) $op_list[$k] = $row[wr_datetime];
   else  {
    $op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]);
    $op_list[$k] .= $row[wr_datetime];
   }
$list[$k] = get_list($row, $board, $latest_skin_path, $subject_len);
$list[$k][bo_table] = $board[bo_table];
   $list[$k][bo_subject] = $board[bo_subject];
$list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len);
  }
 }
 if($k>0) array_multisort($op_list, SORT_DESC, $list);
 if($k>$rows) array_splice($list, $rows);
ob_start();
 include "$latest_skin_path/latest.skin.php";
 $content = ob_get_contents();
 ob_end_clean();
 return $content;
}
/// 함수 정의 끝
?>
도대체 어디에 있는겨? 그저 바람처럼 머무르고 싶지 않다는 거...
Ҵ 2011-07
Ҵѿ ׷ ˻ θ check ְ Ǿ ־.
׷, ֽű ڵ ׺κ ׿. ....

ֽű ø, .
Ӹ Ͻ ʿ, α׷ ٲٰ ڿ üũ ϸ ˴ϴ.

http://opencode.co.kr/bbs/board.php?bo_table=gnu4_pack_book&wr_id=66
     
׽ 2011-07
̰ ׷쿡  Խ ϴ°ǵ.

Ҵֽű ϴ ϱ. ۾ ϸ Ǵ

Ͻô е Ų ֽø .
          
Ҵ 2011-07
ϳ ׷쿡 Ư Խ ϴ ͵ ˴ϴ.

Խǿ ˻ ִµ, װŸ uncheck ϸ ڵ ȳɴϴ.
ø ڵ.
׽ 2011-07
88 ֳ?
     
Ҵ 2011-07


Page 7/28
2011-05   14916   Ҵ
2011-07   14866   ׽
2011-08   14853   Ҵ
2013-06   14850   Ҵ
2012-12   14845   Ҵ
2012-06   14842   Ҵ
2011-09   14775   Ҵ
2011-10   14775   Ҵ
2012-11   14766   Ҵ
2011-09   14634   Ҵ
2012-12   14626   Ҵ
2012-01   14613   Ҵ
2011-10   14599   Ҵ
2012-12   14580   Ҵ
2013-05   14501   Ҵ
2012-04   14456   Ҵ
2012-01   14426   Ҵ
2011-10   14413   Ҵ
2011-10   14397   Ҵ
2011-01   14388   Ҵ