diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-30 10:11:48 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-30 10:11:48 +0800 |
commit | 9445994d6e3d2d48ad93848c600d7e39e38ea192 (patch) | |
tree | 913d5711a0ad7a11b03cd2bdb0b9fb1b8afa0637 /util | |
parent | 66390c345733fc2c677b0bfaecaeb34d75c08ae8 (diff) | |
download | pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.tar pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.tar.gz pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.tar.bz2 pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.tar.lz pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.tar.xz pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.tar.zst pttbbs-9445994d6e3d2d48ad93848c600d7e39e38ea192.zip |
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@384 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/toplazyBM.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/util/toplazyBM.c b/util/toplazyBM.c index 7237f170..d0157117 100644 --- a/util/toplazyBM.c +++ b/util/toplazyBM.c @@ -1,10 +1,7 @@ -/* $Id: toplazyBM.c,v 1.10 2002/06/30 01:46:24 ptt Exp $ */ +/* $Id: toplazyBM.c,v 1.11 2002/06/30 02:11:48 ptt Exp $ */ #include "bbs.h" - - #define OUTFILE BBSHOME "/etc/toplazyBM" #define FIREFILE BBSHOME "/etc/firelazyBM" - extern boardheader_t *bcache; extern int numboards; @@ -96,7 +93,9 @@ int main(int argc, char *argv[]) p=strtok(allbrd[i].BM,"/ ]"); for(index=0; p && index<5; index++) { - if(!p[0]) {index--; continue;} + if(!p[0]) {index--; + p=strtok(NULL,"/ ]"); + continue;} bmid=getuser(p); bms[index].bmname = p; bms[index].flag = 0; @@ -107,7 +106,7 @@ int main(int argc, char *argv[]) lostbms[j].title = allbrd[i].brdname; lostbms[j].ctitle = allbrd[i].title; lostbms[j].lostdays = - ((int)time(NULL)-(int)xuser.lastlogin)/(60*60*24); + (now-xuser.lastlogin)/86400; //超過六十天 免職 if(lostbms[j].lostdays > 60){ xuser.userlevel &= ~PERM_BM; @@ -121,8 +120,6 @@ int main(int argc, char *argv[]) } if(flag == 1){ - //boardheader_t *fhp = 0; - printf("%s %s\n", lostbms[j-1].title, lostbms[j-1].bmname); bmbuf[0] = '\0'; for(k = 0 , n = 0; k < index; k++){ if(!bms[k].flag){ @@ -130,17 +127,15 @@ int main(int argc, char *argv[]) strcat(bmbuf, bms[k].bmname); } } -printf("%d) %s:%s ",i,allbrd[i].brdname,bmbuf); - /* + printf("%d) %s:%s ",i,allbrd[i].brdname,bmbuf); strcpy(allbrd[i].BM, bmbuf); - if( substitute_record(FN_BOARD, &allbrd[i], sizeof(boardheader_t), i+1) == -1){ - printf("Update Board Faile : %s\n", allbrd[i].brdname); - } + if( substitute_record(FN_BOARD, &allbrd[i], + sizeof(boardheader_t), i+1) == -1){ + printf("Update Board Faile : %s\n", allbrd[i].brdname); + } reset_board(i+1); -*/ } } - /* qsort(lostbms, j, sizeof(lostbm), bmlostdays_cmp); //write to the etc/toplazyBM @@ -173,17 +168,19 @@ printf("%d) %s:%s ",i,allbrd[i].brdname,bmbuf); if( (lostdays != 30) && (lostdays != 45) && (lostdays <= 60)) continue; - sprintf(genbuf, BBSHOME "/home/%c/%s", lostbms[i].bmname[0], lostbms[i].bmname); + sprintf(genbuf, BBSHOME "/home/%c/%s", + lostbms[i].bmname[0], lostbms[i].bmname); stampfile(genbuf, &mymail); strcpy(mymail.owner, "[PTT警察局]"); - if(lostdays <= 60){ sprintf(mymail.title, - "\033[32m [板主免職警告通知] \033[m %s BM %s", lostbms[i].title, lostbms[i].bmname); + "\033[32m版主通知\033[m %s版版主%s", lostbms[i].title, + lostbms[i].bmname); }else{ sprintf(mymail.title, - "\033[32m [板主免職通知] \033[m %s BM %s", lostbms[i].title, lostbms[i].bmname); + "\033[32m版主自動免職通知\033[m %s BM %s", lostbms[i].title, + lostbms[i].bmname); } unlink(genbuf); if(lostdays <= 60){ @@ -192,10 +189,9 @@ printf("%d) %s:%s ",i,allbrd[i].brdname,bmbuf); LINK(FIREFILE, genbuf); } - sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", lostbms[i].bmname[0], lostbms[i].bmname); + sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", + lostbms[i].bmname[0], lostbms[i].bmname); append_record(genbuf, &mymail, sizeof(mymail)); } - -*/ return 0; } |