作者itoc.bbs@cpu.tfcis.org (核心動力) 看板: plan
標題Re: [請益] 有沒有那種"好友版加入邀請函"
時間動力核心 (2004/11/22 Mon 02:18:49) Updated: 2004/11/24
※ 引述《vividcat46.bbs@bbs.wretch.cc (祕密德˙凱特)》之銘言:
> 因為站內有很多的好友版跟個人版
> 被對方加入的人都不知道
> 如果那個版的版主主動加入對方為板友
> 然後可以按個鍵就寄一封信給對方邀請他加入
: pal.c:pal_add()
pal_edit(&pal, DOECHO);
strcpy(pal.userid, acct.userid);
pal.userno = userno;
rec_add(xo->dir, &pal, sizeof(PAL));
utmp_admset(userno, STATUS_PALDIRTY);
+ if (xo->dir[0] == 'b' && /* 板友才需要寄信 */
+ vans("是否發函通知他(Y/N)?[N] ") == 'y')
+ {
+ char fpath[64], *title;
+ FILE *fp;
+
+ sprintf(fpath, "tmp/pal_add.%s", cuser.userid); /* 暫存檔 */
+ if (fp = fopen(fpath, "w"))
+ {
+ title = "加入板友通知";
+
+ /* 文章檔頭 */
+ fprintf(fp, "%s %s (%s)\n",
+ str_author1, cuser.userid, cuser.username);
+ fprintf(fp, "標題: %s\n時間: %s\n\n", title, Now());
+
+ /* 文章內容 */
+ fprintf(fp, "%s 將您加入 [%s] 的板友\n\n", cuser.userid, currboard);
+ fclose(fp);
+
+ mail_him(fpath, acct.userid, title, 0);
+ unlink(fpath);
+ }
+ }
xo->pos = XO_TAIL; /* 放在最後 */
return pal_init(xo);
--
◤◥ Origin: Maple-itoc˙動力核心 cpu.tfcis.org
◣◢ Author: itoc 從 itoc.Dorm11.NCTU.edu.tw 發表