Example #1
0
void
savemyclass()
{
	struct brcinfo *brcinfo;
	struct boardmem *bx;
	char *ptr = getparm("myclass");
	bx = getboard2(ptr);
	if (!bx) {
		printf("<b>没有找到 %s 版,请用“搜索”功能搜索版面</b><br>\n",
		       ptr);
		return;
	}
	if (!has_read_perm_x(currentuser, bx)) {
		printf
		    ("<b>%s 版是一个封闭版面,请先向版务申请加入,或者用“搜索”功能另选其他版面</b><br>\n",
		     ptr);
		return;
	}
	brcinfo = brc_readinfo(currentuser->userid);
	strsncpy(brcinfo->myclass, bx->header.filename,
		 sizeof (brcinfo->myclass));
	ptr = strtrim(getparm("myclasstitle"));
	if (!strcmp(ptr, "版面标题"))
		brcinfo->myclasstitle[0] = 0;
	else
		strsncpy(brcinfo->myclasstitle, ptr,
			 sizeof (brcinfo->myclasstitle));
	brc_saveinfo(currentuser->userid, brcinfo);
	printf
	    ("<b>设置成功</b>(以后可以到菜单“个人工具箱”-->“设定底栏显示的版面”进行修改)<br>");
	printf("<script>top.f4.location.reload();</script>");
}
Example #2
0
int
index2009_main()
{
	//struct boardmem *x;
	//int i, total = 0;
	char *secstr;
	//char ydq[3];
	const struct sectree *sec;
	struct brcinfo *brcinfo;

	brcinfo = brc_readinfo(currentuser->userid);

	secstr = getparm("secstr");
	sec = getsectree(secstr);

	if (secstr[0] != '*' && !strcmp(sec->basestr, brcinfo->lastsec)) {
		if (cache_header
		    (max(thisversion, file_time(MY_BBS_HOME "/wwwtmp")), 120))
			return 0;
	}

	if (secstr[0] != '*' && strcmp(sec->basestr, brcinfo->lastsec)) {
		strsncpy(brcinfo->lastsec, sec->basestr,
			 sizeof (brcinfo->lastsec));
		brc_saveinfo(currentuser->userid, brcinfo);
	}
	html_header(1);
	printf("<title>一路BBS 凝聚华人力量,加强中外交流</title>");
	//check_msg();
	printf("<style type=text/css>A {color: #0000f0}</style>");
	printf("<script src=" BBSJS "></script>\n");
	printf("<script src=" BBSBOAJS "></script>\n");	
	printf("</head><body topmargin=0 leftMargin=1 MARGINWIDTH=1 MARGINHEIGHT=0>" WWWLEFT_DIV);
	showsecpage2009(sec);
	printf(WWWFOOT_DIV "</body></html>");
	return 0;
}