返回信息流转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
版面文章乱码
这是一条镜像帖。来源:北邮人论坛 / bbs-man-dev / #8683同步于 1 周前
BBSMan_Dev机器人发帖
smthbbs 升级到kbs 版面乱码 .DIR文件怎么转换?
mathslimin.
1 周前镜像同步9 回复
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
检查升级前后 fileheader 结构体定义
写个程序慢慢转
【 在 mathslimin (linuxer) 的大作中提到: 】
: 版面文章乱码
转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
【 在 fancyrabbit (fancy★Life is struggling ...★喵) 的大作中提到: 】
: 检查升级前后 fileheader 结构体定义
: 写个程序慢慢转
可不可以给个程序啊?
转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
kbs_bbs/contrib/convert/cnv_fh.c
【 在 mathslimin (linuxer) 的大作中提到: 】
: 可不可以给个程序啊?
转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
【 在 SoapDinosaur (肥龙) 的大作中提到: 】
: kbs_bbs/contrib/convert/cnv_fh.c
谢谢,这个怎么使用哦?
转信站: BYR!news.byr.edu.cn!news.neu.edu.cn!news.newsmth.net!NEWSMTH
修改好新旧的fileheader的定义,然后可能cnv_index函数也要相应的改改。
然后运行就行了,不带参数就转换所有信箱和版面。
带参数的话,就转换第一个参数制定的那个文件。
旧的索引会加.old在文件名后面。
【 在 mathslimin (linuxer) 的大作中提到: 】
: 谢谢,这个怎么使用哦?
转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
【 在 SoapDinosaur (肥龙) 的大作中提到: 】
: 修改好新旧的fileheader的定义,然后可能cnv_index函数也要相应的改改。
: 然后运行就行了,不带参数就转换所有信箱和版面。
: 带参数的话,就转换第一个参数制定的那个文件。
: ...................
具体转化步骤为:
1.在/etc/ld.so.conf中加入/home/bbs/lib(home/bbs/lib是bbs的安装目录)
2.没有改convpasswd.c
3. 拷贝mysql.h等文件,变化权限.
4.编译:gcc
gcc -g -I/home/bbs/kbsbbs-2.0dev -I/home/bbs/kbsbbs-2.0dev/src -lBBS -lsystem -L/home/bbs/lib -I/usr/local/mysql/include/mysql/ -o cnv_fh cnv_fh.c
然后运行
cnv_fh
现在还有乱码,我正在调试
希望能够成功
转信站: BYR!news.byr.edu.cn!news.shec6.edu.cn!news.newsmth.net!NEWSMTH
不需要,直接make就可以了。
【 在 mathslimin (linuxer) 的大作中提到: 】
: 具体转化步骤为:
: 1.在/etc/ld.so.conf中加入/home/bbs/lib(home/bbs/lib是bbs的安装目录)
: 2.没有改convpasswd.c
: ...................
转信站: BYR!news.byr.edu.cn!news.newsmth.net!NEWSMTH
这是新旧对比,为什么还是转换不成功啊?
struct fileheader_old {
char filename[FILENAME_LEN];
unsigned int id, groupid, reid;
int o_bid;
unsigned int o_id;
unsigned int o_groupid;
unsigned int o_reid;
char innflag[2];
char owner[14];
unsigned int eff_size;
time_t posttime;
long attachment;
char title[60];
unsigned char accessed[4];
char postip[16];
char secret_owner[14];
};
struct fileheader_new {
char filename[FILENAME_LEN];
unsigned int id, groupid, reid;
int o_bid;
unsigned int o_id;
unsigned int o_groupid;
unsigned int o_reid;
char innflag[2];
char owner[OWNER_LEN];
unsigned int eff_size;
int posttime;
unsigned int attachment;
char title[ARTICLE_TITLE_LEN];
//unsigned short replycount;
//char last_owner[OWNER_LEN];
//int last_posttime;
//char unused[114];
unsigned char accessed[4];
//char postip[16];
//char secret_owner[OWNER_LEN];
};
转信站: BYR!news.byr.edu.cn!news.shec6.edu.cn!news.newsmth.net!NEWSMTH
成功了,谢谢大家
仔细对比然后多测试几次就成功了
: ...................
struct fileheader_old{ /* This structure is used to hold data in */
char filename[FILENAME_LEN]; /* the DIR files */
unsigned int id, groupid, reid;
int o_bid;
unsigned int o_id;
unsigned int o_groupid;
unsigned int o_reid;
char innflag[2];
char owner[OWNER_LEN];
unsigned int eff_size;
time_t posttime;
long attachment;
char title[ARTICLE_TITLE_LEN];
unsigned char accessed[4];
char postip[16];
char secret_owner[OWNER_LEN];
};
struct fileheader_new { /* This structure is used to hold data in */
char filename[FILENAME_LEN]; /* the DIR files */
unsigned int id, groupid, reid;
/* please kill these four fuckers */
int o_bid;
unsigned int o_id;
unsigned int o_groupid;
unsigned int o_reid;
char innflag[2];
char owner[OWNER_LEN];
unsigned int eff_size; /* 版面文章: 表示有效字节数,信件: 表示文件大小 - atppp */
int posttime;
unsigned int attachment;
char title[ARTICLE_TITLE_LEN];
//unsigned short replycount; /* will be used, pig2532 */
//char last_owner[OWNER_LEN];
//int last_posttime;
//char unused[96];
unsigned char accessed[4];
};