안녕하세요.. 저희 서버에서 한 게시판이 2000번이 넘어서... 서버 버벅댐에 고뇌하던중..
;; 평소에 좋아하던 PHP로 된 보드를 찾아보다 가 적수보드 0.4를 찾았습니다.
그래서
적수보드를 설치했는 데 너무 좋더군요.. 근데.. 기존 게시판의 데이타가 날아가는게 너
무 아까워서.. 컨버팅을 하려고 했는데.. 2000개를 손으로 하려니깐 도저히.. 두려워서 --;;
그래서 컨버팅 프로그램을 만들어 봤는데요. 원래 쓰던 Perl보드는 서풍님의 ScB이구요..
대부분의 Perl보드가 데이터 형식이 비슷하기 때매 조금만 고치시면 컨버터로 쓰실 수 있
을거 같네요..
참.. 그리고 적수보드 오픈소스프로젝트 공간이 필요한거 같다 는 얘기
도 있는거 같은데.. 구하기 힘드시면 제가 제공해 드릴 수도 있어요.. 학교동아리서버인데
요 최근 622Mbps ATM에 T3 1개 T1 1개 깔아서.. 요즘 날아다녀요..
;;;;; 참.. 소스가 1회용으로
만든거라.. 좀 지저분 하니 용서를
;;<pre>#include <stdio.h>#include <stdlib.h>char *pstr[20];char text[327
68];void parse(char *str,int limit);int numberst=5000;void deletequote(char *str){ char *cur; cur=str; while(*cur) { if
(*cur==''' || *cur=='"') *cur=' '; cur++; }}int main(void){ FILE *fp,*msg; char str[1024],fn[256]; int reyn[5000],ret
o[5000],reno[5000],rede[5000]; int i; int refer=0; int depth=0; int root[50]; int nownum=5000; int ndepth=0; for(i=0;i<5
0;i++) root[i]=5000; fp=fopen("idx.dat","rt"); while(!feof(fp)) { fgets(str,1023,fp); str[strlen(str)-1]=0; parse(str
,9); depth=atoi(pstr[1]); if(depth==0) { root[0]=nownum; reyn[nownum]=0; reto[nownum]=0; rede[nownum]=0; ren
o[nownum]=0; } else { reyn[root[depth-1]]=1; reyn[nownum]=0; reto[nownum]=root[0]; rede[nownum]=depth; reno[n
ownum]=root[depth-1]; root[depth]=nownum; } nownum--; } fseek(fp,0,SEEK_SET); nownum=5000; while(!feof(fp)) { fgets
(str,1023,fp); deletequote(str); str[strlen(str)-1]=0; parse(str,9); sprintf(fn,"%s.msg",pstr[2]); msg=fopen(fn,"rt
"); fgets(text,32767,msg); fgets(text,32767,msg); text[strlen(text)-1]=0; depth=atoi(pstr[1]); deletequote(text);
printf("insert into plaza values(%d,%s,UNIX_TIMESTAMP('%s'), '165.132.134.51','%s','','%s','http://sbtm.yonsei.ac.kr',
'%s', '%s',%s,%d,%d,%d,%d,'','',0);",nownum,pstr[0],pstr[7],pstr[5], pstr[6],pstr[4],text,pstr[8],reyn[nownum],reno[
nownum], rede[nownum],reto[nownum]); fclose(msg); nownum--; } fclose(fp);}void parse(char *str,int limit){ char *sta
rtpt, *cursor; int seq=0; startpt=cursor=str; while(*cursor && seq<limit) { if(*cursor=='|') { pstr[seq]=startpt; s
tartpt=cursor+1; seq++; *cursor=0; } cursor++; } pstr[seq]=startpt;}</pre>