diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/birth.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/util/birth.c b/util/birth.c index f0d5626a..e9198ef5 100644 --- a/util/birth.c +++ b/util/birth.c @@ -59,31 +59,28 @@ int main(argc, argv) "[1m¡¹[35m¡¹[34m¡¹[33m¡¹[32m¡¹[31m¡¹[45;33m ¹Ø¬P¤jÆ[ " "[40m¡¹[32m¡¹[33m¡¹[34m¡¹[35m¡¹[1m¡¹[m \n\n"); fprintf(fp1, "[33m¡i[1;45m¥»¤é¹Ø¬P[40;33m¡j[m \n"); + int horoscope = getHoroscope(ptime->tm_mon + 1, ptime->tm_mday); for(j = 1; j <= MAX_USERS; j++) { passwd_query(j, &user); if (bad_user_id(NULL)) continue; - if (user.month == ptime->tm_mon + 1) - { - if (user.day == ptime->tm_mday) - { - char genbuf[200]; - sprintf(genbuf, BBSHOME "/home/%c/%s", user.userid[0], user.userid); - stampfile(genbuf, &mymail); - strcpy(mymail.owner, BBSNAME); - strcpy(mymail.title, "!! ¥Í¤é§Ö¼Ö !!"); - unlink(genbuf); - Link(BBSHOME "/etc/Welcome_birth", genbuf); - sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", user.userid[0], user.userid); - append_record(genbuf, &mymail, sizeof(mymail)); - if ((user.numlogins + user.numposts) < 20) - continue; + if (user.month == ptime->tm_mon + 1 && user.day == ptime->tm_mday) { + char genbuf[200]; + sprintf(genbuf, BBSHOME "/home/%c/%s", user.userid[0], user.userid); + stampfile(genbuf, &mymail); + strcpy(mymail.owner, BBSNAME); + strcpy(mymail.title, "!! ¥Í¤é§Ö¼Ö !!"); + unlink(genbuf); + Link(BBSHOME "/etc/Welcome_birth.%d", genbuf, horoscope); + sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", user.userid[0], user.userid); + append_record(genbuf, &mymail, sizeof(mymail)); + if ((user.numlogins + user.numposts) < 20) + continue; - fprintf(fp1, - " [33m[%2d/%-2d] %-14s[0m %-24s login:%-5d post:%-5d\n", + fprintf(fp1, + " [33m[%2d/%-2d] %-14s[0m %-24s login:%-5d post:%-5d\n", ptime->tm_mon + 1, ptime->tm_mday, user.userid, - user.nickname, user.numlogins, user.numposts); - } + user.nickname, user.numlogins, user.numposts); } } fclose(fp1); |