📄 modify.doc
字号:
/* * 如何设定跨站砍信功能 * ================================================================ * * 1. 如果您用的 bbs 程式是交通大学资讯工程系的 PhoenixBBS, 请跳过 * 此步骤. 交大资工版的 BBS 已作好相关修改. * * 2. 如果您用的版本是标准 Eagle BBS 2.0, 请叁考以下说明更改程式. * * 3. 如果您用的是其它版本, 请向发展者查询如何设定跨站砍信. * *//* * 请修改 bbs.c, 找出原来砍信的副程式 del_post(), 找到删除档案的 * 程式码, 然後加入以下 /* add by mfchen ... */ 之间的程式码. * [修改内容为] * 1. 在 unlink 档案之前呼叫 cancelpost(). * 2. 将文章的 讨论区名称, 档案名称, 砍信者, 原发表者, * 以及 转信路径 记录到 cancelpost.lst 档案. * 3. 转信程式 (bntplink) 会自动检查 cancelpost.lst 内容, * 送出砍信讯息, 通知其它 news server/BBS 站 砍信. */del_post(ent,fileinfo,direct){ ... if(!delete_file(direct,sizeof(struct fileheader),ent,cmpfilename)) {/* add by mfchen, cancel tin's post */ cancelpost( currboard, currfile, currentuser.userid );/* add by mfchen, cancel tin's post */ sprintf(genbuf,"%s/%s",buf,fileinfo->filename) ; unlink(genbuf) ; ...}/* Add by mfchen -- cancel post file begin */cancelpost( board, file, userid )char *board, *file, *userid;{ FILE *fh; char from[ STRLEN ], path[ STRLEN ]; char *ptr; int len; sprintf( genbuf, "boards/%s/%s", board, file ); if( (fh = fopen( genbuf, "r" )) != NULL ) { from[0] = path[0] = '\0'; while( fgets( genbuf, sizeof( genbuf ), fh ) != NULL ) { len = strlen( genbuf ) - 1; genbuf[ len ] = '\0'; if( len <= 8 ) { break; } else if( strncmp( genbuf, "发信人: ", 8 ) == 0 ) { if( (ptr = rindex( genbuf, ',' )) != NULL ) *ptr = '\0'; strcpy( from, genbuf + 8 ); } else if( strncmp( genbuf, "转信站: ", 8 ) == 0 ) { strcpy( path, genbuf + 8 ); } } fclose( fh ); sprintf( genbuf, "%s\t%s\t%s\t%s\t%s\n", board, file, userid, from, path ); if( (fh = fopen( "cancelpost.lst", "a" )) != NULL ) { fputs( genbuf, fh ); fclose( fh ); } }}/* Add by mfchen -- cancel post file end */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -