diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-04-16 10:59:01 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-04-16 10:59:01 +0800 |
commit | 48049f58fca08253facdfa66371b48ea046abcc9 (patch) | |
tree | ae91c8ca340b4ccfdf355291472ca97fd74d7f73 /util | |
parent | 54ab3b0886feb9faa8ead846c2bd1e2b688023e5 (diff) | |
download | pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.gz pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.bz2 pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.lz pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.xz pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.zst pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.zip |
horoscope flavor birthday card
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3503 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
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); |