summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-04-16 10:59:01 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-04-16 10:59:01 +0800
commit48049f58fca08253facdfa66371b48ea046abcc9 (patch)
treeae91c8ca340b4ccfdf355291472ca97fd74d7f73 /util
parent54ab3b0886feb9faa8ead846c2bd1e2b688023e5 (diff)
downloadpttbbs-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.c35
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)
"¡¹¡¹¡¹¡¹¡¹¡¹ ¹Ø¬P¤jÆ[ "
"¡¹¡¹¡¹¡¹¡¹¡¹ \n\n");
fprintf(fp1, "¡i¥»¤é¹Ø¬P¡j \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,
- " [%2d/%-2d] %-14s %-24s login:%-5d post:%-5d\n",
+ fprintf(fp1,
+ " [%2d/%-2d] %-14s %-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);