Esempio n. 1
0
//
// END ARTICLES
//
void EndText (void)
{
	int			artnum;
	char 	*text;
	memptr		layout;


	ClearMemory ();

	CA_UpLevel ();
	MM_SortMem ();
#ifdef JAPAN
	ShowArticle(gamestate.episode + 1);

	VW_FadeOut();

	SETFONTCOLOR(0,15);
	IN_ClearKeysDown();
	if (MousePresent)
		Mouse(MDelta);	// Clear accumulated mouse movement

	FreeMusic ();
	CA_DownLevel ();
	MM_SortMem ();
#else



#ifdef ARTSEXTERN
	artnum = endextern+gamestate.episode;
	CA_CacheGrChunk (artnum);
	text = (char *)grsegs[artnum];
	MM_SetLock (&grsegs[artnum], True);
#else
	endfilename[6] = '1'+gamestate.episode;
	CA_LoadFile (endfilename,&layout);
	text = (char *)layout;
	MM_SetLock (&layout, True);
#endif

	ShowArticle (text);

#ifdef ARTSEXTERN
	MM_FreePtr (&grsegs[artnum]);
#else
	MM_FreePtr (&layout);
#endif


	VW_FadeOut();
	SETFONTCOLOR(0,15);
	IN_ClearKeysDown();
	//if (MousePresent) // PORT
	//	Mouse(MDelta);	// Clear accumulated mouse movement

	//FreeMusic (); 
	CA_DownLevel ();
	MM_SortMem ();
#endif
}
Esempio n. 2
0
static bool ShowText(const FString exitText, const FString flat, const FString music, ClusterInfo::ExitType type)
{
    // Use cluster background if set.
    if(!flat.IsEmpty())
        backgroundFlat = TexMan(flat);
    if(!backgroundFlat) // Get default if needed
        backgroundFlat = TexMan(gameinfo.FinaleFlat);

    switch(type)
    {
    case ClusterInfo::EXIT_MESSAGE:
        SD_PlaySound ("misc/1up");

        Message (exitText);

        IN_ClearKeysDown ();
        IN_Ack ();
        return false;

    case ClusterInfo::EXIT_LUMP:
    {
        int lumpNum = Wads.CheckNumForName(exitText, ns_global);
        if(lumpNum != -1)
        {
            FWadLump lump = Wads.OpenLumpNum(lumpNum);
            char* text = new char[Wads.LumpLength(lumpNum)];
            lump.Read(text, Wads.LumpLength(lumpNum));

            if(!music.IsEmpty())
                StartCPMusic(music);
            ShowArticle(text, !!(IWad::GetGame().Flags & IWad::HELPHACK));

            delete[] text;
        }

        break;
    }

    default:
        if(!music.IsEmpty())
            StartCPMusic(music);
        ShowArticle(exitText, !!(IWad::GetGame().Flags & IWad::HELPHACK));
        break;
    }

    IN_ClearKeysDown();
    if (MousePresent && IN_IsInputGrabbed())
        IN_CenterMouse();  // Clear accumulated mouse movement
    return true;
}
Esempio n. 3
0
void HelpScreens (void)
{
	int			artnum;
	char 	*text;
	memptr		layout;


	CA_UpLevel ();
	MM_SortMem ();
#ifdef JAPAN
	ShowArticle (0);
	VW_FadeOut();
	FreeMusic ();
	CA_DownLevel ();
	MM_SortMem ();
#else




#ifdef ARTSEXTERN
	artnum = helpextern;
	CA_CacheGrChunk (artnum);
	text = (char *)grsegs[artnum];
	MM_SetLock (&grsegs[artnum], True);
#else
	CA_LoadFile (helpfilename,&layout);
	text = (char *)layout;
	MM_SetLock (&layout, True);
#endif

	ShowArticle (text);

#ifdef ARTSEXTERN
	MM_FreePtr (&grsegs[artnum]);
#else
	MM_FreePtr (&layout);
#endif



	VW_FadeOut();

	//FreeMusic (); // PORT
	CA_DownLevel ();
	MM_SortMem ();
#endif
}
Esempio n. 4
0
//
// END ARTICLES
//
void EndText()
{
	int artnum;
	const char *text;

	ClearMemory();

	artnum = endextern+gamestate.episode;
	CA_CacheGrChunk(artnum);
	if (w0 == true){
		text = (const char *)grsegsWL1[artnum];
	} else if (w1 == true){
		text = (const char *)grsegsWL6[artnum];
	} else if (s0 == true){
		text = (const char *)grsegsSDM[artnum];
	} else {
		text = (const char *)grsegsSOD[artnum];
	}

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();
	SETFONTCOLOR(0,15);
	IN_ClearKeysDown();

	IN_GetMouseDelta(NULL, NULL); // Clear accumulated mouse movement
	
	FreeMusic();
}
Esempio n. 5
0
/*
=================
=
= HelpScreens
=
=================
*/
void HelpScreens()
{
	int artnum;
	const char *text;

	artnum = helpextern;
	CA_CacheGrChunk(artnum);
	if (w0 == true){
		text = (const char *)grsegsWL1[artnum];
	} else if (w1 == true){
		text = (const char *)grsegsWL6[artnum];
	} else if (s0 == true){
		text = (const char *)grsegsSDM[artnum];
	} else {
		text = (const char *)grsegsSOD[artnum];
	}

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();

	FreeMusic();
}
Esempio n. 6
0
/*
=================
=
= HelpScreens
=
=================
*/
void HelpScreens (void)
{
    int lumpNum = Wads.CheckNumForName("HELPART", ns_global);
    if(lumpNum != -1)
    {
        FMemLump lump = Wads.ReadLump(lumpNum);

        backgroundFlat = TexMan(gameinfo.FinaleFlat);
        ShowArticle((char*)lump.GetMem());
    }

    VW_FadeOut();
}
Esempio n. 7
0
/*
=================
=
= HelpScreens
=
=================
*/
void HelpScreens()
{
	int artnum;
	signed char *text;

	artnum = helpextern;
	CA_CacheGrChunk(artnum);
	text = (signed char *)grsegs[artnum];

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();

	FreeMusic();
}
Esempio n. 8
0
//
// END ARTICLES
//
void EndText()
{
	int artnum;
	signed char *text;

	ClearMemory();

	artnum = endextern+gamestate.episode;
	CA_CacheGrChunk(artnum);
	text = (signed char *)grsegs[artnum];

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();
	SETFONTCOLOR(0,15);
	IN_ClearKeysDown();

	FreeMusic();
}
Esempio n. 9
0
/*******************************************************************
 *	顯示佈告相關 TAG (一般區 & 精華區 & 信件 通用)
 *
 *
 *******************************************************************/
void
ShowPost(char *tag, BOARDHEADER * board, POST_FILE * pf)
{
	char *p, *para = NULL;
	int pagesize, start, end;
	char value[256];

	if (request_rec->URLParaType != PostRead
	    && request_rec->URLParaType != TreaRead
	    && request_rec->URLParaType != MailRead
	    && request_rec->URLParaType != SkinModify)
	{
		return;
	}

	if ((p = strchr(tag, ' ')) != NULL)
	{
		*p = '\0';
		para = p + 1;
	}

#if 0
	fprintf(fp_out, "<%d>, tag=[%s], \n", request_rec->URLParaType, tag);
	fflush(fp_out);
#endif

	if (!strcasecmp(tag, "Num"))
	{
		fprintf(fp_out, "%d", pf->num);
	}
	else if (!strcasecmp(tag, "Date"))
	{
		fprintf(fp_out, "%s", pf->date);
	}
	else if (!strcasecmp(tag, "Sender"))
	{
		fprintf(fp_out, "%s", pf->fh.owner);
	}
	else if (!strcasecmp(tag, "BackList"))
	{
#ifdef TORNADO_OPTIMIZE
		if (isTORNADO)
			return;
#endif

		GetPara3(value, "PAGE", para, 4, "-1");
		pagesize = atoi(value);
		find_list_range(&start, &end, pf->num, pagesize, pf->total_rec);

		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostBackList);
		fprintf(fp_out, "<A HREF=\"%d-%d\">%s</A>", start, end, value);
	}
	else if (!strcasecmp(tag, "BackListNum"))
	{
		GetPara3(value, "PAGE", para, 3, "-1");
		pagesize = atoi(value);
		find_list_range(&start, &end, pf->num, pagesize, pf->total_rec);

		fprintf(fp_out, "%d-%d", start, end);
	}
	else if (!strcasecmp(tag, "Last"))
	{
#if 0
		if (isTORNADO)
			return;
#endif
		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostLast);

		if (!strcmp(pf->lfname, "-1"))
		{
			fprintf(fp_out, "%s", value);
		}
		else
		{
			if (pf->type & LAST_POST_IS_HTML)
				fprintf(fp_out, "<A HREF=\"%s/PostHtml.html\" target=\"new\">%s</A>", pf->lfname, value);
			else
				fprintf(fp_out, "<A HREF=\"%s.html\">%s</A>", pf->lfname, value);
		}
	}
	else if (!strcasecmp(tag, "Next"))
	{
#if 0
		if (isTORNADO)
			return;
#endif
		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostNext);

		if (!strcmp(pf->nfname, "-1"))
		{
			fprintf(fp_out, "%s", value);
		}
		else
		{
			if (pf->type & NEXT_POST_IS_HTML)
				fprintf(fp_out, "<A HREF=\"%s/PostHtml.html\" Target=\"new\">%s</A>", pf->nfname, value);
			else
				fprintf(fp_out, "<A HREF=\"%s.html\">%s</A>", pf->nfname, value);
		}
	}
#ifdef TTT
	else if (!strcasecmp(tag, "LastRelated"))
	{
		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostLastRelated);

		if (!strcmp(pf->lrfname, "-1"))
		{
			fprintf(fp_out, "%s", value);
		}
		else
		{
			fprintf(fp_out, "<A HREF=\"%s.html\">%s</A>", pf->lrfname, value);
		}
	}
	else if (!strcasecmp(tag, "NextRelated"))
	{
		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostNextRelated);

		if (!strcmp(pf->nrfname, "-1"))
		{
			fprintf(fp_out, "%s", value);
		}
		else
		{
			fprintf(fp_out, "<A HREF=\"%s.html\">%s</A>", pf->nrfname, value);
		}
	}
#endif
	else if (!strcasecmp(tag, "Reply"))
	{
#ifdef TORNADO_OPTIMIZE
		if (isTORNADO)
			return;
#endif
		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostReply);

		fprintf(fp_out, "<A HREF=\"%s/%s\">%s</A>",
			pf->fh.filename,
			(request_rec->URLParaType == MailRead) ? HTML_MailReply : HTML_PostReply,
			value);
	}
	else if (!strcasecmp(tag, "Send"))
	{
#ifdef TORNADO_OPTIMIZE
		if (isTORNADO)
			return;
#endif
		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostSend);
		fprintf(fp_out, "<A HREF=\"%s\">%s</A>", HTML_PostSend, value);
	}
	else if (!strcasecmp(tag, "Edit"))
	{
#ifdef TORNADO_OPTIMIZE
		if (isTORNADO)
			return;
#endif
		if (PSCorrect != Correct)
			return;

		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostEdit);
		fprintf(fp_out, "<A HREF=\"%s/%s\">%s</A>",
			pf->fh.filename, HTML_PostEdit, value);
	}
	else if (!strcasecmp(tag, "Forward"))
	{
#ifdef TORNADO_OPTIMIZE
		if (isTORNADO)
			return;
#endif
		if (request_rec->URLParaType != MailRead && PSCorrect != Correct)
			return;

		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostForward);

		fprintf(fp_out, "<A HREF=\"%s/%s\">%s</A>",
			pf->fh.filename,
			(request_rec->URLParaType == MailRead) ? HTML_MailForward : HTML_PostForward,
			value);
	}
	else if (!strcasecmp(tag, "Delete"))
	{
#ifdef TORNADO_OPTIMIZE
		if (isTORNADO)
			return;
#endif
		if (request_rec->URLParaType != MailRead && PSCorrect != Correct)
			return;

		GetPara3(value, "VALUE", para, sizeof(value), MSG_PostDelete);

		fprintf(fp_out, "<A HREF=\"%s/%s\">%s</A>",
			pf->fh.filename,
			(request_rec->URLParaType == MailRead) ? HTML_MailDelete : HTML_PostDelete,
			value);
	}
	else if (!strcasecmp(tag, "Content"))
	{
		if (request_rec->URLParaType == MailRead && PSCorrect != Correct)
			return;

		if (request_rec->URLParaType == SkinModify)
			ShowArticle(pf->POST_NAME, FALSE, FALSE);
		else
			ShowArticle(pf->POST_NAME, FALSE, TRUE);
	}
	else if (!strcasecmp(tag, "Title") || !strcasecmp(tag, "Subject"))
	{
#ifdef QP_BASE64_DECODE
		if (strstr(pf->fh.title, "=?"))		/* title maybe encoded */
		{
			char source[STRLEN];

			strcpy(source, pf->fh.title);
			decode_line(pf->fh.title, source);
		}
#endif
		souts(pf->fh.title, STRLEN);
		fprintf(fp_out, "%s", pf->fh.title);
	}
	else if (!strcasecmp(tag, "ReplyContent"))
	{
		if (request_rec->URLParaType == MailRead && PSCorrect != Correct)
			return;

		include_ori(pf->POST_NAME, NULL);	/* lthuang */
	}
	else if (!strcasecmp(tag, "ReplyTitle") || !strcasecmp(tag, "ReplySubject"))
	{
#ifdef QP_BASE64_DECODE
		if (strstr(pf->fh.title, "=?"))		/* title maybe encoded */
		{
			strcpy(value, pf->fh.title);
			decode_line(pf->fh.title, value);
		}
#endif
		souts(pf->fh.title, STRLEN);
		if (strncmp(pf->fh.title, STR_REPLY, REPLY_LEN))
			fprintf(fp_out, "%s", STR_REPLY);

		fprintf(fp_out, "%s", pf->fh.title);
	}
	else if (!strcasecmp(tag, "Body"))
	{
		if (request_rec->URLParaType == MailRead && PSCorrect != Correct)
			return;

		if (strstr(skin_file->filename, "PostHtml.html")
		    || strstr(skin_file->filename, HTML_PostEdit))
		{
			ShowArticle(pf->POST_NAME, TRUE, FALSE);
		}
		else
			ShowArticle(pf->POST_NAME, TRUE, TRUE);

	}
	else if (!strcasecmp(tag, "FileName"))
	{
		fprintf(fp_out, "%s", pf->fh.filename);
	}
	else if (!strcasecmp(tag, "LastFileName"))
	{
		fprintf(fp_out, "%s.html", pf->lfname);
	}
	else if (!strcasecmp(tag, "NextFileName"))
	{
		fprintf(fp_out, "%s.html", pf->nfname);
	}
}
Esempio n. 10
0
int ParseKMP(char *cmd, REQUEST_REC *r)
{

	char kmp[STRLEN], proto[STRLEN], data[STRLEN], arg1[STRLEN], arg2[STRLEN], arg3[STRLEN], arg4[STRLEN];
	int result;
	*proto = *data = *arg1 = *arg2 = *arg3 = *arg4 = 0x00;

	sscanf(cmd, "%s\t%s\t%s\t%s\t%s\t%s",
		kmp, proto, arg1, arg2, arg3, arg4);

#if 0
	fprintf(fp_out, "[%s]\r\n", cmd);
	fprintf(fp_out, "arg1=%s, arg2=%s, arg3=%s, arg4=%s\r\n",
		arg1, arg2, arg3, arg4);
	fflush(fp_out);
#endif

	if(!strcmp(proto, "USERNEW"))
	{
		sprintf(data, "ID=%s&PASSWORD=%s&PASSWORD1=%s&NICKNAME=%s&EMAIL=%s",
			arg1, arg2, arg2, arg3, arg4);

		result = NewUser(data, &curuser);

		if(result != WEB_OK)
		{
			if(strstr(WEBBBS_ERROR_MESSAGE, "帳號已存在") != NULL)
				fprintf(fp_out, "622  使用者帳號已存在\r\n");
			else
				fprintf(fp_out, "721  註冊失敗\r\n");
		}
		else
			fprintf(fp_out, "800  OK!!\r\n");
	}
	else if(!strcmp(proto, "USERQUERY"))
	{
		if (!get_passwd(&curuser, arg1))
		{
			bzero(&curuser, sizeof(USEREC));
			fprintf(fp_out, "621  使用者帳號不存在\r\n");
		}
		else
		{
			USER_INFO *quinf;
			char user_status[1024];

			if ((quinf = search_ulist(cmp_userid, curuser.userid)) && !(quinf->invisible))
			{
				sprintf(user_status, "線上狀態: %s, 呼喚鈴: %s.",
					modestring(quinf, 1),
					(quinf->pager != PAGER_QUIET) ? MSG_ON : MSG_OFF);
			}
			else
				sprintf(user_status, "目前不在線上");

			fprintf(fp_out, "800  OK!!\r\n");
			fprintf(fp_out, "%s\t%s\t%d\t%d\t%d\t%d\t%d\t%s\t%s\r\n",
				curuser.userid,
				curuser.username,
				curuser.userlevel,
				curuser.ident,
				curuser.numlogins,
				curuser.numposts,
				(int)curuser.lastlogin,
				curuser.lasthost,
				user_status);
		}
	}
	else if(!strcmp(proto, "USERDATA"))
	{
		if(!get_passwd(&curuser, arg1))
			bzero(&curuser, sizeof(USEREC));
		if(CheckUserPassword(arg1, arg2)!=Correct)
			fprintf(fp_out, "724  密碼錯誤\r\n");
		else
		{
			fprintf(fp_out, "800  OK!!\r\n");
			fprintf(fp_out, "%d\t%s\t%s\t%d\t%d\t%d\t%s\t%d\t%s\r\n",
				curuser.uid,
				curuser.userid,
				curuser.username,
				curuser.userlevel,
				curuser.numlogins,
				curuser.numposts,
				curuser.lasthost,
				curuser.lastctype,
				curuser.email);
		}
	}
	else if(!strcmp(proto, "USERPLAN"))
	{
		if (!get_passwd(&curuser, arg1))
		{
			bzero(&curuser, sizeof(USEREC));
			fprintf(fp_out, "621  使用者帳號不存在\r\n");
		}
		else
		{
			char userfile[PATHLEN];

			sethomefile(userfile, curuser.userid, UFNAME_PLANS);
			if(isfile(userfile))
			{
				fprintf(fp_out, "800  OK!!\r\n");
				ShowArticle(userfile, FALSE, FALSE);
			}
			else
			{
				fprintf(fp_out, "761  使用者無名片檔\r\n");
			}
		}
	}
	else if(!strcmp(proto, "USERLIST"))
	{
		int start = 0, end = 0;

		if(*arg1)
			start = atoi(arg1);
		if(*arg2)
			end = atoi(arg2);

	#if 0
		fprintf(fp_out, "%p %p", post_file, &post_file);
		fflush(fp_out);
	#else
		post_file->list_start = start;
		post_file->list_end = end;
		ShowUserList("KMP", post_file);
	#endif
	}
#if 0
	else if(!strcmp(proto, "USERLOGIN"))
	{
		result = user_login(&cutmp, &curuser, CTYPE_WEBBBS, arg1, arg2,
			       r->fromhost);
		if (result == ULOGIN_OK)
		{
			memcpy(&uinfo, cutmp, sizeof(USER_INFO));
			break;
		}
		else if (result == ULOGIN_PASSFAIL)
		{
			outs(_msg_formosa_27);
			continue;
		}
		outs(_msg_formosa_44);


	}
#endif

	return WEB_OK;

}
Esempio n. 11
0
File: bbsweb.c Progetto: wtj/formosa
/*******************************************************************
 *	Dispatch command according to $type, $tag in skin tags
 *
 *******************************************************************/
void 
DoTagCommand(char *type, char *tag)
{
	if (!strcasecmp(type, "Post"))
	{
		ShowPost(tag, &c_board, post_file);
	}
	else if (!strcasecmp(type, "PostList"))
	{
		ShowPostList(tag, &c_board, post_file);
	}
	else if (!strcasecmp(type, "User"))
	{
		ShowUser(tag, &curuser);
	}
	else if (!strcasecmp(type, "UserList"))
	{
		ShowUserList(tag, post_file);
	}
	else if (!strcasecmp(type, "Mail"))
	{
		ShowMail(tag);
	}
	else if (!strcasecmp(type, "Board"))
	{
		ShowBoard(tag, &c_board, post_file);
	}
	else if (!strcasecmp(type, "BoardList"))
	{
		ShowBoardList(tag, post_file);
	}
	else if (!strcasecmp(type, "SubDir"))
	{
		fprintf(fp_out, "/%s", BBS_SUBDIR);
	}
	else if (!strcasecmp(type, "Message"))
	{
		fprintf(fp_out, "%s", WEBBBS_ERROR_MESSAGE);
	}
	else if (!strcasecmp(type, "Server"))
	{
		ShowServerInfo(tag, server, request_rec, file_shm, html_shm);
	}
	else if (!strcasecmp(type, "Proxy"))
	{
		if (strlen(request_rec->via))
		{
			char proxy[STRLEN * 2];

			xstrncpy(proxy, request_rec->via + 4, sizeof(proxy));
			strtok(proxy, ",(");
			fprintf(fp_out, "%s", proxy);
		}
	}
	else if (!strcasecmp(type, "Skin"))
	{
		if (PSCorrect == Correct && (c_board.brdtype & BRD_WEBSKIN) 
			&& (!strcmp(username, c_board.owner) || HAS_PERM(PERM_SYSOP)))
		{
			fprintf(fp_out, "<a href=\"/%sboards/%s/%s\">[BM]修改看板介面</a>",
			     BBS_SUBDIR, c_board.filename, HTML_SkinModify);
		}
	}
	else if (!strcasecmp(type, "Announce"))
	{
		ShowArticle(WELCOME, FALSE, TRUE);
	}
	else if (!strcasecmp(type, "NewGuide"))
	{
		ShowArticle(NEWGUIDE, FALSE, TRUE);
	}

}
Esempio n. 12
0
File: user.c Progetto: wtj/formosa
/*******************************************************************
 *	顯示 <BBS_User_xxxxx> TAG
 *	目前 UserQuery ,UserData 用的TAG一樣, 靠URLParaType區分 
 *
 *	in UserQuery mode , curuser is target for query, not original userdata
 *******************************************************************/
void 
ShowUser(char *tag, USEREC * curuser)
{
	if (request_rec->URLParaType != UserQuery && PSCorrect != Correct)
		return;

	if (!strcasecmp(tag, "ID"))
	{
		fputs(curuser->userid, fp_out);
	}
	else if (!strcasecmp(tag, "Name"))
	{
		char buf[STRLEN];
#if defined(NSYSUBBS1)
		if (request_rec->URLParaType == UserQuery && curuser->ident != 7)
			fputs("中山遊客", fp_out);
		else
#endif	
		{
			xstrncpy(buf, curuser->username, STRLEN);
			fputs(buf, fp_out);
		}
	}
	else if (!strcasecmp(tag, "Level"))
	{
		fprintf(fp_out, "%d", curuser->userlevel);
	}
	else if (!strcasecmp(tag, "Login"))
	{
		fprintf(fp_out, "%d", curuser->numlogins);
	}
	else if (!strcasecmp(tag, "Post"))
	{
		fprintf(fp_out, "%d", curuser->numposts);
	}
#ifdef USE_IDENT
	else if (!strcasecmp(tag, "Ident"))
		{
		fputs(curuser->ident == 7 ? MSG_HasIdent : MSG_NotIdent, fp_out);
	}
#endif
	else if (!strcasecmp(tag, "LastLogin"))
	{
		fputs(Ctime(&(curuser->lastlogin)), fp_out);
	}
	else if (!strcasecmp(tag, "LastHost"))
	{
		fputs(curuser->lasthost, fp_out);
	}
	else if (!strcasecmp(tag, "NewMail"))
	{
		if (curuser->flags[0] & FORWARD_FLAG)
			fputs(MSG_MailForwardON, fp_out);
		else if (!strcmp(curuser->userid, "guest"))
			fputs(MSG_MailHasRead, fp_out);
		else
		{
			if ((request_rec->URLParaType != UserQuery && PSCorrect != Correct)
				|| !CheckNewmail(curuser->userid, TRUE))
			{
				fputs(MSG_MailHasRead, fp_out);
			}
			else
			{
				fputs(MSG_MailNotRead, fp_out);
			}
		}
	}
	else if (!strcasecmp(tag, "Status"))	/* print user online status */
	{
		USER_INFO *quinf;

		if ((quinf = search_ulist(cmp_userid, curuser->userid)) && !(quinf->invisible))
		{
			fprintf(fp_out, "線上狀態: %s, 呼喚鈴: %s.",
				modestring(quinf, 1),
				(quinf->pager != PAGER_QUIET) ? MSG_ON : MSG_OFF);
		}				
		else
			fprintf(fp_out, "目前不在線上");
	}
	else if (!strcasecmp(tag, "Plan"))
	{
		char userfile[PATHLEN];

		sethomefile(userfile, curuser->userid, UFNAME_PLANS);
		if (request_rec->URLParaType == UserData)
			ShowArticle(userfile, FALSE, FALSE);
		else
			ShowArticle(userfile, FALSE, TRUE);
	}
	else
	{
		if (request_rec->URLParaType == UserQuery)	/* bug fixed */
			return;
			
		if (!strcasecmp(tag, "Email"))
		{
			fputs(curuser->email, fp_out);
		}
		else if (!strcasecmp(tag, "MailForward"))	/* use in UserData only */
		{
			fputs(curuser->flags[0] & FORWARD_FLAG ? "ON" : "OFF", fp_out);
		}
		else if (!strcasecmp(tag, "Friend"))
		{
			char userfile[PATHLEN];

			sethomefile(userfile, curuser->userid, UFNAME_OVERRIDES);
			ShowArticle(userfile, FALSE, TRUE);
		}
		else if (strstr(tag, "Sign"))
		{
			FILE *fp;
			char fname[PATHLEN];

			sethomefile(fname, curuser->userid, UFNAME_SIGNATURES);
			if ((fp = fopen(fname, "r")) != NULL)
			{
				int line = 0, num;			
				char buffer[512];
				
				GetPara3(buffer, "NUM", tag, 3, "-1");
				num = atoi(buffer);

				for (line = 0; line < num * MAX_SIG_LINES 
						&& fgets(buffer, sizeof(buffer), fp); line++)
				{
					if (line < (num - 1) * MAX_SIG_LINES)
						continue;
					fprintf(fp_out, "%s", buffer);
				}

				fclose(fp);
			}
		}
	}
}