Linux 版 (精华区)
发信人: cucme (说你说我), 信区: Linux
标 题: 一塌糊涂个人精华区代码[part2]
发信站: 紫 丁 香 (Tue Apr 25 09:10:03 2000), 转信
发信人: ecnegrevid (车人一月刀), 信区: Linux
标 题: [转载] Part II
发信站: 一塌糊涂 BBS (Mon Apr 24 18:16:08 2000), 转信
【 以下文字转载自 Personal_Corpus 讨论区 】
【 原文由 ecnegrevid 所发表 】
一塌糊涂(ytht.net)个人精华区代码 Part II
***********************************************************************
个人精华区藏处甚深, 为了方便起见, 在主菜单中加入相应选项, 涉及函数为():
//add by gluon, modified by ecnegrevid
void
Personal(cmd)
char *cmd;
{ char buf[100], ch;
/*strcpy( genbuf, "个人文集");*/
strcpy(genbuf,"");
switch(cmd[0])
{ case '*':
ch=currentuser.userid[0];
ch=(ch>='A'&&ch<='Z')?ch:
(ch>='a'&&ch<='z')?(ch+'A'-'a'):'\0';
sprintf(buf,"0Announce/groups/GROUP_0/Personal_Corpus/%c/%.15s",
ch, currentuser.userid);
break;
case '$':
ch=cmd[1];
ch=(ch>='A'&&ch<='Z')?ch:
(ch>='a'&&ch<='z')?(ch+'A'-'a'):'\0';
sprintf(buf,"0Announce/groups/GROUP_0/Personal_Corpus/%c/%.15s",
ch, &(cmd[1]));
break;
default:
ch=cmd[0];
ch=(ch>='A'&&ch<='Z')?ch:
(ch>='a'&&ch<='z')?(ch+'A'-'a'):'\0';
sprintf( buf, "0Announce/groups/GROUP_0/Personal_Corpus/%c",ch);
break;
}
if( dashd( buf ) )
{ a_menu( genbuf, buf,
(HAS_PERM(PERM_ANNOUNCE)||HAS_PERM(PERM_SYSOP)) ? PERM_BOARDS : 0 ,0);
}else if(cmd[0]=='*')
{ a_prompt( -1,"没有找到您的个人文集, 请到Personal_Corpus版申请,按<Enter>继续...", genbuf, 2);
}
clear();
}
// end
并添加个人文集的菜单, %menu M_PERSONAL
title 0, 0, "个人文集"
screen 3, 0, S_PERSONAL
@Personal 13, 4, 0, "*", "*"
@Personal 14, 4, 0, "A", "A"
@Personal 0, 0, 0, "B", "B"
@Personal 0, 0, 0, "C", "C"
@Personal 0, 0, 0, "D", "D"
@Personal 0, 0, 0, "E", "E"
@Personal 0, 0, 0, "F", "F"
@Personal 13,11, 0, "G", "G"
@Personal 0, 0, 0, "H", "H"
@Personal 0, 0, 0, "I", "I"
@Personal 0, 0, 0, "J", "J"
@Personal 0, 0, 0, "K", "K"
@Personal 0, 0, 0, "L", "L"
@Personal 0, 0, 0, "M", "M"
...
***********************************************************************
在浏览文章时用'X'跳到个人文集
在bbs.c中struct one_key read_comms[] 添加
'x', into_announce,
'X', into_my_Personal, /* ecnegrevid 2000.2.27 */
'Y', UndeleteArticle,
into_my_Personal的定义为
int
into_my_Personal()
{ Personal("*");
return FULLUPDATE;
}
--
※ 修改:.ecnegrevid 于 Apr 24 18:23:20 修改本文.[FROM: 162.105.21.117]
※ 来源:.一塌糊涂 BBS ytht.net.[FROM: 162.105.21.117]
--
※ 转载:.一塌糊涂 BBS ytht.net.[FROM: 162.105.21.117]
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: 202.118.244.207]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:5.321毫秒