/*
* p ] w H \� �� � ��� � �
* ================================================================
*
* 1. p G z Ϊ bbs { O q j Ǹ T u { t PhoenixBBS, и L� � � � � � ��� �� � � � � � � �� � �
* B J. j u BBS w @ n��� � �� �� ���� � � � ����ק�.
*
* 2. p G z Ϊ O з Eagle BBS 2.0, аѦҥH U { .� � � � ������ � � � � ������ ��
*
* 3. p G z Ϊ O� � � � �� �䥦����, ЦV o i d� � � ��ߦp ] w H.�� � ��
*
*/
/*
* Э� ק � bbs.c, X Ӭ H Ƶ{ del_post(), R ɮ�� �� � ��� �� ��� ��� ת�
* { X, M [ J H U /* add by mfchen ... */ { X.� ��� � �� � � � ������� ���
* [�ק鷺�e ]��
* 1. b unlink ɮ� � פ��e I s cancelpost().� �
* 2. N� � 峹�� �Q�װϦW , ɮ�� � צW , H , o ,�� �� �� �� ���
* H H | O cancelpost.lst ɮ .� �� �� �� � ��� � �
* 3. H { (bntplink) |�� � �� � �۰��ˬd cancelpost.lst e,���
* e X H T , q� � �� � �� � ��� 䥦 news server/BBS H.�� ��
*/
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] = ' ';
while( fgets( genbuf, sizeof( genbuf ), fh ) != NULL ) {
len = strlen( genbuf ) - 1;
genbuf[ len ] = ' ';
if( len <= 8 ) {
break;
} else if( strncmp( genbuf, " o H H: ", 8 ) == 0 ) {� � �
if( (ptr = rindex( genbuf, ',' )) != NULL )
*ptr = ' ';
strcpy( from, genbuf + 8 );
} else if( strncmp( genbuf, " H : ", 8 ) == 0 ) {�� ��
strcpy( path, genbuf + 8 );
}
}
fclose( fh );
sprintf( genbuf, "%s %s %s %s %s",
board, file, userid, from, path );
评论1
最新资源