summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
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);