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

· 11년 전 · 1431 · 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년 전 조회 1,574
10년 전 조회 1,329
10년 전 조회 1,270
10년 전 조회 1,505
10년 전 조회 1,158
10년 전 조회 777
10년 전 조회 1,581
10년 전 조회 2,039
10년 전 조회 1,566
10년 전 조회 1,614
10년 전 조회 2,281
10년 전 조회 3,365
10년 전 조회 953
10년 전 조회 977
10년 전 조회 1,491
10년 전 조회 1,695
10년 전 조회 1,233
10년 전 조회 917
10년 전 조회 1,092
10년 전 조회 1,169
10년 전 조회 1,399
10년 전 조회 1,550
10년 전 조회 2,233
10년 전 조회 882
10년 전 조회 1,068
10년 전 조회 5,183
10년 전 조회 974
10년 전 조회 1,427
10년 전 조회 1,369
10년 전 조회 1,841
10년 전 조회 1,273
10년 전 조회 1,523
10년 전 조회 1,591
10년 전 조회 1,983
10년 전 조회 1,762
10년 전 조회 2,586
10년 전 조회 1,998
10년 전 조회 2,090
10년 전 조회 1,176
10년 전 조회 1,433
10년 전 조회 1,411
10년 전 조회 1,052
10년 전 조회 860
10년 전 조회 1,056
10년 전 조회 1,742
11년 전 조회 1,086
11년 전 조회 1,987
11년 전 조회 3,751
11년 전 조회 1,580
11년 전 조회 1,432
11년 전 조회 1,392
11년 전 조회 1,370
11년 전 조회 1,042
11년 전 조회 2,231
11년 전 조회 961
11년 전 조회 1,390
11년 전 조회 1,499
11년 전 조회 1,567
11년 전 조회 2,566
11년 전 조회 1,289
11년 전 조회 1,752
11년 전 조회 1,169
11년 전 조회 1,186
11년 전 조회 2,049
11년 전 조회 1,468
11년 전 조회 1,274
11년 전 조회 1,639
11년 전 조회 1,011
11년 전 조회 1,467
11년 전 조회 1,590
11년 전 조회 4,655
11년 전 조회 1,335
11년 전 조회 1,057
11년 전 조회 3,582
11년 전 조회 1,558
11년 전 조회 1,324
11년 전 조회 905
11년 전 조회 911
11년 전 조회 1,816
11년 전 조회 4,176
11년 전 조회 2,308
11년 전 조회 1,177
11년 전 조회 720
11년 전 조회 1,643
11년 전 조회 1,665
11년 전 조회 3,545
11년 전 조회 1,342
11년 전 조회 3,114
11년 전 조회 2,268
11년 전 조회 1,010
11년 전 조회 1,282
11년 전 조회 2,805
11년 전 조회 1,382
11년 전 조회 1,599
11년 전 조회 2,503
11년 전 조회 2,311
11년 전 조회 1,060
11년 전 조회 1,213
11년 전 조회 3,525
11년 전 조회 1,474
🐛 버그신고