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

· 11년 전 · 1858 · 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개

4개짜리 2줄 개념으로 바꿈.
라인을 구분 할 수 있는 html태그를 직접 추가.

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

function print_latest($subject,$table_id,$limit,$skin,$len_title,$len_content,$date_type,$headline='',$motion='',$multiline = 1, $multihtml = '' )

...............
$limit2 = $limit * $multiline; //불러오는 데이타는 라인의 배수
// 데이터 쿼리
$query=" SELECT * FROM kport_".$table_id."_board ORDER BY reg_date DESC LIMIT $n, $limit2 ";
$res=mysql_query($query);

.............

$_body="";
$resultcount = mysql_num_rows($res);
$m = 0;
while($row=mysql_fetch_array($res))
{

$m++;
...........

$body = str_replace("[content]",$content,$body);
$_body.= "\n".$body;

if($multiline > 1 && ! $m%$limit && $resultcount > $m )
{

$_body.= $multihtml;
}

...........
키키2님 댓글 감사합니다.
알려주신대로 해봤는데 그대로네요^^;
오류같은건 안뜨는데, 그냥 테이블이 늘어나면서 가로로 8개가 나와요ㅎㅎ

혹시 몰라서 라이브러리 파일을 링크걸어봅니다.
(알려주신대로 수정한 파일이에욤..

http://www.birdwiki.net/library.zip
$_read_file = $FUNC->Read_File($_kb_root."skin/latest_skin/".$skin."/index.html");
여기보면 불러오는 템플릿파일에 맞게끔 $multihtml 에 넘어온 '</tr></tr>'를 알맞게 수정해야 할겁니다.
출력결과 8개나 나온 곳에 $multihtml에 설정된 html태그가 limit 설정값 후에 올바르게 들어가 있는것도 점검이 필요합니다.
이제서야 댓글을 봤네요...
스킨파일의 코드는

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
[loop]
<td align="center" valign="top">
<table>
<tr>
<td bgcolor="#FFFFFF" align="center">
[href_list]<img src=[imgfile] border=0 width="185px" height="150px"></a>
[title]</td>
</tr>
</table>
</td>
[/loop]
</tr>
</table>

이렇게 간단하더라구요.
제가 프로그램을 잘 몰라서 </tr>태그를 어떻게 해야할지 후...
염치없고 너무 죄송스러워서 더 질문을 드리기가 뭐하네요^^;

신경써주시고 코드수정까지 하셔서 알려주셨는데 지가 미천한 관계로ㅠㅠ
친절하신 댓글 진심으로 감사드립니다.
좋은 하루 되세요!
ob_start();
$FUNC->print_latest('용품','gallery2','4','kb_gallery','15','50','m-d','','');
$latest1 = ob_get_clean();

ob_start();
$FUNC->print_latest('용품','gallery2','8','kb_gallery','15','50','m-d','','');
$latest2 = ob_get_clean();

preg_match_all('|<td align.+?</table>.+?</td>|s', $latest2, $loop_elements);
$latest2 = str_replace($loop_elements[0][0],'',$latest2);
$latest2 = str_replace($loop_elements[0][1],'',$latest2);
$latest2 = str_replace($loop_elements[0][2],'',$latest2);
$latest2 = str_replace($loop_elements[0][3],'',$latest2);

echo $latest1;
echo $latest2;
질문은 http://sir.co.kr/qa/ 여기에 올리세요.
네 고맙습니다.
라엘님 근데 댓글 달아주신 내용이 뭔지 여쭤봐도 될까여.
저거 어디다가 넣는건가요ㅎㅎ
$latest1이 첫번째줄 4개.
$latest2가 두번째줄 4개.
출력하고 싶은 곳에 넣으세요.
라엘님 정말 너무너무 고맙습니다ㅠㅠ 이제 되네요ㅠㅠ
디자인만 할줄아는 입장에서 프로그램 잘하시는 분들 너무 존경스럽습니다.
이거때문에 일주일을 해매고 있었는데...
지금 제가 라엘님께 얼마나 감사하고 있는지 모르실거에요.
정말 진심으로 감사드립니다.

근데 3줄이나 4줄로 하는것은 어렵나요?
4줄까지 출력되는 코드를 가르쳐주시면 안될까요...^^;
부탁드립니다....
제가 주말 여행을 가서 컴퓨터를 할 수 없습니다. 그동안 누군가 더 나은 코드를 짜주시거나 혹은 제가 내일 저녁에 짜드릴께요.
넵... 안운하시고 여행 잘 다녀오세요.
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;

출력하고 싶은 위치에 넣으세요.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 2,006
10년 전 조회 1,762
10년 전 조회 1,705
10년 전 조회 1,928
10년 전 조회 1,570
10년 전 조회 1,218
10년 전 조회 2,002
10년 전 조회 2,458
10년 전 조회 2,024
10년 전 조회 2,013
10년 전 조회 2,690
10년 전 조회 3,763
10년 전 조회 1,378
10년 전 조회 1,383
10년 전 조회 1,908
10년 전 조회 2,104
10년 전 조회 1,641
10년 전 조회 1,321
10년 전 조회 1,488
10년 전 조회 1,599
10년 전 조회 1,813
10년 전 조회 1,965
10년 전 조회 2,669
10년 전 조회 1,279
10년 전 조회 1,496
10년 전 조회 5,587
10년 전 조회 1,376
10년 전 조회 1,844
10년 전 조회 1,791
10년 전 조회 2,263
11년 전 조회 1,692
11년 전 조회 1,932
11년 전 조회 1,997
11년 전 조회 2,373
11년 전 조회 2,159
11년 전 조회 3,019
11년 전 조회 2,417
11년 전 조회 2,509
11년 전 조회 1,594
11년 전 조회 1,845
11년 전 조회 1,842
11년 전 조회 1,478
11년 전 조회 1,290
11년 전 조회 1,478
11년 전 조회 2,291
11년 전 조회 1,492
11년 전 조회 2,441
11년 전 조회 4,142
11년 전 조회 2,008
11년 전 조회 1,859
11년 전 조회 1,815
11년 전 조회 1,787
11년 전 조회 1,461
11년 전 조회 2,650
11년 전 조회 1,374
11년 전 조회 1,790
11년 전 조회 1,925
11년 전 조회 1,986
11년 전 조회 2,978
11년 전 조회 1,706
11년 전 조회 2,191
11년 전 조회 1,604
11년 전 조회 1,599
11년 전 조회 2,482
11년 전 조회 1,893
11년 전 조회 1,687
11년 전 조회 2,172
11년 전 조회 1,410
11년 전 조회 1,876
11년 전 조회 1,990
11년 전 조회 5,057
11년 전 조회 1,773
11년 전 조회 1,466
11년 전 조회 3,994
11년 전 조회 1,983
11년 전 조회 1,745
11년 전 조회 1,321
11년 전 조회 1,325
11년 전 조회 2,210
11년 전 조회 4,600
11년 전 조회 2,713
11년 전 조회 1,570
11년 전 조회 1,128
11년 전 조회 2,061
11년 전 조회 2,084
11년 전 조회 3,948
11년 전 조회 1,750
11년 전 조회 3,507
11년 전 조회 2,683
11년 전 조회 1,417
11년 전 조회 1,717
11년 전 조회 3,227
11년 전 조회 1,778
11년 전 조회 1,995
11년 전 조회 2,917
11년 전 조회 2,715
11년 전 조회 1,476
11년 전 조회 1,618
11년 전 조회 3,947
11년 전 조회 1,892