static int inform(char *board, char *user, char *exp, int dt) { FILE *fp; char path[80], title[80], buf[512]; struct tm *tmtime; time_t daytime = now_t + (dt + 1) * 86400; tmtime = gmtime(&daytime); sprintf(title, "%s 被 %s 取消在%s的POST权", user, currentuser->userid, board); sprintf(path, "bbstmpfs/tmp/%d.tmp", thispid); fp = fopen(path, "w"); fprintf(fp, "【此篇文章是由自动发信系统所张贴】\n\n"); snprintf(buf, sizeof (buf), "被封原因: %s\n" "被封天数: %d\n" "解封日期: %d月%d日\n" "管理人员: %s\n" "解封办法: 联系版主提前解封或由系统自动解封\n" "如有异议,可向管理人员提出,或到Arbitration版投诉\n\n\n", exp, dt, tmtime->tm_mon + 1, tmtime->tm_mday, currentuser->userid); fputs(buf, fp); fclose(fp); securityreport(title, buf); post_article(board, title, path, "deliver", "自动发信系统", "自动发信系统", -1, 0, 0, "deliver", -1); if (!hideboard(board)) post_article("Penalty", title, path, "deliver", "自动发信系统", "自动发信系统", -1, 0, 0, "deliver", -1); mail_file(path, user, title, "deliver"); unlink(path); printf("系统已经发信通知了%s.<br>\n", user); return 0; }
int bbseva_main() { char board[80], file[80]; int star; html_header(1); check_msg(); strsncpy(board, getparm("B"), 32); if (!board[0]) strsncpy(board, getparm("board"), 32); strsncpy(file, getparm("F"), 20); if (!file[0]) strsncpy(file, getparm("file"), 32); star = atoi(getparm("star")); if (!loginok) http_fatal("匆匆过客不能进行本项操作"); changemode(READING); if(! getboard(board)) http_fatal("错误的讨论区"); if (hideboard(board)) http_fatal("隐藏版面就不要评价文章啦!"); if (star < 1 || star > 5) http_fatal("错误的参数"); if (star == 1) star++; printf("<center>%s -- 评价文章 [使用者: %s]<hr>\n", BBSNAME, currentuser.userid); printf("<table><td>"); do_eva(board, file, star); printf("</td></table>"); printf("[<a href='javascript:history.go(-1)'>返回</a>]"); http_quit(); return 0; }
static struct boardmem * findboard(struct oneclass *bs, char *bn, int *no) { int i; struct boardmem *x; for (i = 0; i < bs->bcount; i++) { int t; t = cl->bdata[bs->group[0].start + i].bno; x = &(shm_bcache->bcache[t]); if (!strcmp(x->header.filename, bn) && !hideboard(x->header.filename)) { *no = i; return x; } } return NULL; }