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

혹시 kboard 아시는분 계신가요?

프로그램은어려워
· 10년 전 · 1224 · 12

우선 그누보드와 관련 없는 글이라 죄송합니다(__)

워낙 관련 정보를 찾을 수가 없어서 이곳에 글을 남깁니다ㅠㅠ

 

웨드프레스의 kboard가 아니구요 kport라는 개발그룹에서 만든

php 웹보드인 kboard입니다. 군더더기 없이 깔끔한 게시판이었는데

개발자분들이 손을 떼셔서 공식 사이트도 사라졌더라구요.

 

다름이아니라 이 게시판으로 홈페이지를 만든게 있는데

최근갤러리 출력부분을 수정해야하는데, 도저히 모르겠어서 질문드립니다.

보통 제로보드나 그누보드는 가로몇개, 세로몇줄 이런식으로 설정이 가능한데

kboard는 그런게 없더라구요.

 

메인페이지의 최근갤러리 출력명령은

 

<? $FUNC->print_latest('용품','gallery2','4','kb_gallery','15','50','m-d','',''); ?>

 

입니다.

 

 

현재 한줄로 가로 4개가 출력되게 되어 있는거구요.

저걸 가로4개 세로2줄로 바꿔야 하는데, 도통 모르겠습니다.

m-d 뒤에 비어있는건 다른 옵션입니다.

 

그래서 그누보드의 board.php와 비슷한 역할을 하는 kboard 폴더에 library.php라는

파일의 최근글 관련부분을 봤는데 어딜 고쳐야할지 모르겠습니다ㅠㅠ

 

아래는 관련 소스 일부분인데요.

이게 간단하게 수정해서 해결되는 문제인지 많은 부분을 손대야하는건지 잘 모르겠네요.

복잡한거면 당연히 의뢰를 할 생각입니다. 제가 워낙 php 프로그램쪽을 몰라서 혹시나 하고

소스코드를 올립니다.

 

 

 

 

 ////////////////////////////////////////////////////////////
 }최근 게시물
 ////////////////////////////////////////////////////////////
 function print_latest($subject,$table_id,$limit,$skin,$len_title,$len_content,$date_type,$headline='',$motion='')
 {
  global $FUNC;
  global $_kb_root;
  global $_kb_path;

 
  $_img_path=$_kb_path."skin/latest_skin/".$skin."/img/";
  $_file_path=$_kb_path."data/".$table_id."/";
  
  // 게시판 관리
  $ADMIN=new CLASS_ADMIN("fetch_array",$table_id);
  $ADMIN->data("");
  $_tb_skin=$ADMIN->tb_skin;
  
  // 코멘트
  $COMM=new CLASS_COMM($table_id);
  
  // 첨부파일
  $ATTACH=new CLASS_ATTACH($table_id);
  
  // 날짜 연산
  $_set_date=$ADMIN->size_new;
  $_set_time=24*$_set_date;
  
  $this->subject=$subject;
  $this->table_id=$table_id;
  
  // 스킨 읽기
  $_read_file = $FUNC->Read_File($_kb_root."skin/latest_skin/".$skin."/index.html");
  if(!$_read_file) echo "$skin 스킨이 존재하지 않습니다.";
  
  // 헤드뉴스
  if($headline=="news")
  {
   $query=" SELECT * FROM kport_".$table_id."_board ORDER BY reg_date DESC LIMIT 1 ";
   $row=mysql_fetch_array(mysql_query($query));
   
   $headdate=date("Y-m-d",$row[reg_date]);
   $_content=str_replace("<BR>"," ",$row[content]); // 에디터 적용 때문
   $headno=$row[no];
   $headline=stripslashes($row[title]);
   $headnews=$FUNC->Cut_String(stripslashes($_content),$len_content);
   
   $headview="<a href=".$_kb_path."kboard.php?board=".$table_id."&act=view&no=".$headno.">";
   
   $more="<span style=font-size=8pt><b>more</b></span>";
   $headline=$headview.$headline."</a>";
   $headnews=$headnews.$headview.$more."</a>";
   
   $n=1;
  }else{
   $n=0;
  }
  
  // 데이터 쿼리
  $query=" SELECT * FROM kport_".$table_id."_board ORDER BY reg_date DESC LIMIT $n, $limit ";
  $res=mysql_query($query);
  
  // 페이지 분리
  $tmp = explode("[loop]",$_read_file);
  $header = $tmp[0];
  $tmp2 = explode("[/loop]",$tmp[1]);
  $loop = $tmp2[0];
  $footer = $tmp2[1];
  
  // 헤드라인뉴스
  $header = str_replace("[headline]",$headline,$header); 
  $header = str_replace("[headnews]",$headnews,$header);
  $header = str_replace("[headdate]",$headdate,$header);
  
  // 목록보기 경로
  $_list_path="<a href='".$_kb_path."kboard.php?board=".$table_id."'>";
    
  $_body="";
  while($row=mysql_fetch_array($res))
  {
   $name=stripslashes($row[name]);
   $title=$FUNC->Cut_String(stripslashes($row[title]),$len_title);   
   $content=str_replace("<BR>","",$row[content]); // 에디터 적용 때문
    
   #------------------------------------------------------------------------------------------------
   # setup.php 파일에서 $motion='_array'; 선언 시
   #------------------------------------------------------------------------------------------------
   if($motion == "_array") {
    
    $array_data=explode("||",$content);
    $content = $array_data[(sizeof($array_data)-1)];
    
   }
   $content=$FUNC->Cut_String($content,$len_content);
   
   $reg_date=date($date_type,$row[reg_date]);
   
   // 관련 코멘트 수
   $sql=$COMM->viewData($row[no]);
   $_comm_cnt=mysql_num_rows($sql);
   if($_comm_cnt>0) $_comm_cnt="[".$_comm_cnt."]";
   else $_comm_cnt="";
   
   // 첨부파일 (이미지 등)
   $sql2=$ATTACH->viewData($row[no]);
   $_attach=mysql_fetch_array($sql2);
   $file_name=$_attach[name];
   
   // 파일이 없거나 이미지 파일이 아닌 경우 no_img 출력
   if($FUNC->Check_Image($file_name)==false OR ereg("([^[:space:]]+)",$file_name)==false)
   {
    $file_name=$_img_path."no_img.gif";
   }else{
    $file_name=$_file_path.$file_name;
   }
   
   // new 아이콘 출력
   $_display=$FUNC->Display_New($_set_time,$row[reg_date]);
   if($_display==1)
   {
    if(file_exists($_kb_root."skin/bbs_skin/".$_tb_skin."/img/ico_new.gif")) // new 아이콘
    $_ico_new="<img src='".$_kb_path."skin/bbs_skin/".$_tb_skin."/img/ico_new.gif' border='0'>"; 
   }
   else $_ico_new=""; 
   
   // 내용보기 경로 ( 케이보드 페이지 추가 2004.10.07.)
   if($table_id == "kp_recomm" OR $table_id == "kp_star") $_view_path=$_list_path;
   else $_view_path="<a href='".$_kb_path."kboard.php?board=".$table_id."&act=view&no=".$row[no]."'>";
     
   $body = $loop;
   $body = str_replace("[path]",$_img_path,$body);
   $body = str_replace("[imgfile]",$file_name,$body);
   $body = str_replace("[name]",$name,$body);
   $body = str_replace("[date]",$reg_date,$body);
   $body = str_replace("[href_view]",$_view_path,$body);
   $body = str_replace("[icon]",$_ico_new,$body);
   $body = str_replace("[title]",$_view_path.$title."</a>",$body);
   $body = str_replace("[comment]",$_comm_cnt,$body);
   
   // $motion='_array'
   if($motion=="_array") {
    for($i=0; $i <(sizeof($array_data)-1); $i++) {
     $body = str_replace("[array_data".($i+1)."]",$array_data[$i],$body);
    }
   }
   
   $body = str_replace("[content]",$content,$body);  
   
   $_body.= "\n".$body;
   
  }
  $list = $header.$_body.$footer;
  
  $list = str_replace("[path]",$_img_path,$list);
  $list = str_replace("[href_list]",$_list_path,$list);
  $list = str_replace("[subject]",$_list_path.$subject."</a>",$list);
  echo $list;
  
 }​

 

 

댓글 작성

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

로그인하기

댓글 12개

프로그램은어려워
10년 전
넵... 안운하시고 여행 잘 다녀오세요.
function kboard_print_latest($subject,$table_id,$limit,$skin,$len_title,$len_content,$date_type,$headline='',$motion='') {
global $FUNC;
ob_start();
$FUNC->print_latest($subject,$table_id,$limit,$skin,$len_title,$len_content,$date_type,$headline,$motion);
$latest_buffer = ob_get_clean();

preg_match_all('|<td align.+?</table>.+?</td>|s', $latest_buffer, $loop_elements);

for($i = 0; $i < $limit - 4; $i++) {
$latest_buffer = str_replace($loop_elements[0][$i],'',$latest_buffer);
}

return $latest_buffer;
}

$latest1 = kboard_print_latest('용품','gallery2','4','kb_gallery','15','50','m-d','','');
$latest2 = kboard_print_latest('용품','gallery2','8','kb_gallery','15','50','m-d','','');
$latest3 = kboard_print_latest('용품','gallery2','12','kb_gallery','15','50','m-d','','');
$latest4 = kboard_print_latest('용품','gallery2','16','kb_gallery','15','50','m-d','','');

echo $latest1;
echo $latest2;
echo $latest3;
echo $latest4;

출력하고 싶은 위치에 넣으세요.

게시글 목록

번호 제목
32341
32339
32326
32325
32322
32319
32318
32316
32315
32313
32312
32311
32310
32304
32303
32300
32293
32292
32291
32285
32284
32275
32271
32268
32265
32261
32258
32257
32255
32254
32253
32251
32250
32249
32247
32246
32245
32244
32243
32242
32241
32240
32239
32238
32237
32236
32232
32229
32228
32227
32217
32215
32214
32213
32211
32207
32196
32193
32192
32190
32188
32186
32184
32173
32172
32171
32167
32165
32163
32162
32158
32157
32155
32151
32149
32135
32132
32127
32125
32122
32120
32119
32117
32116
32115
32114
32112
32111
32109
32107
32104
32103
32102
32101
32094
32089
20404
31036
8279
8268