PttNewhand 板


LINE

 关於「文章代码(AID)」说明 ├╯ ⒈ 文章识别系统 (AIDS)   Article IDentification System   目的在告知他人某篇特定的文章  请那个人顺利找到   同时,有效地解决传统上,仅告知   看板的文章编号;却因为前面文章   被删除并且清理索引的空位,导致   之後的文章向前递补之後所造成的   文章编号不同困境。 ⒉ 在 PttBBS 的应用 (telnet) :  ① 任何文章前,按 大写 Q 即可,    系统显示该篇文章代码 (AID)   该篇文章网址(预设关闭)。  ② 将查询到的文章代码 (AID)复制    如:#14rWZ-E4 (PttNewhand)  ③ 对方进入 PttNewhand 看板後,    按下 # (符号) 并输入文章代码    ,或直接贴上即可查阅。  ④ 以上操作为 PC 电脑版的说明,    若您使用手机版、平板电脑版等    连线 Ptt BBS,可能因该软体的    开发商(作者)不同而有所不同。 ⒊ 在 PttBBS 的应用 (Web BBS) :  ① 假设使用者在:    某篇文章推文文章代码 (AID)    #14rWZ-E4    #14rWZ-E4 (PttNewhand)    PttNewhand 看板 #14rWZ-E4    ▲备注:三种形式皆可。  ② 浏览批踢踢实业坊 WebBBS 介面    发现 PttNewhand 板的该篇文章    内推文出现超连结。    ❶ Web BBS 原始文章:    https://webptt.com/cn.aspx?n=bbs/PttNewhand/M.1189784400.A.FAD.html    ❷ Web BBS 文章内的超连结:    https://webptt.com/cn.aspx?n=bbs/PttNewhand/M.1154877694.A.384.html ⒋ 目前 PttBBS 所使用的文章及文摘   档名为: M(文章)G(文摘)   、接着十进位的 31-bit 数字(事   实上是一个 32-bit time_t 的正   数部分)、接着 ".A" 之後,再接   着 "." 及一个三位的大写十六进   位数字,以 Regular Expression   拮取:   /^(M|G)\.(\d+)\.A(?:\.([0-9A-F]{3}))?$/   $type = $1   $v1 = $2   $v2 = (defined($3) ? hex($3) : 0) ⒌ 目前 AID 另外有几种表现形态:  ① AIDu (AID uncompressed)    即 AID,以 uncompressed 强调    其为原始形态。  ② AIDc (AID compressed)    以类似 Base64 的表现方式(即    每 6-bit 以一个字元表示),    用字串表示 AIDu。    目前以 0-9, A-Z, a-z, -, _,    共 64 个符号代表 6-bit 里面    0~64 的值。    AIDv1 使用 48-bit,故再转换    成 AIDc 时为 8 个字元长。  ③ AIDu 与 AIDc 可完全互相转换。 [相关代码-一]  //若未定义则无 AID /* AIDS */ #define AID_DISPLAYNAME "文章代码(AID)" /* end of AIDS */ /* QUERY_ARTICLE_URL */ #define URL_DISPLAYNAME "文章网址" /* end of QUERY_ARTICLE_URL */ [相关代码-二] static int pvrb_search(char key, int curr, int total, pvrb_ctx *cx) { fileheader_t *fh; static char search_str[FNLEN] = ""; static char search_cmd = 0; const char *prompt = ""; const char *aid_str = NULL; aidu_t aidu = 0; int need_input = 1; if (key == 'n') { key = search_cmd; if (key) { need_input = 0; if (curr + 1 < total) curr ++; } else key = '/'; } if (key == '#') prompt = "请输入文章代码: #"; else if (key == '/') prompt = "请输入标题关键字: "; else if (key == 'a') prompt = "请输入作者关键字: "; else { assert(!"unknown search command"); return PSB_NA; } assert(sizeof(search_str) >= FNLEN); if (need_input && getdata(b_lines-1, 0, prompt, search_str, FNLEN, DOECHO) < 1) return PSB_NA; // cache for next cache. search_cmd = key; if (key == '#') { // AID search is very special, we have to search from begin to end. curr = 0; aid_str = search_str; while (*aid_str == ' ' || *aid_str == '#') aid_str++; aidu = aidc2aidu(aid_str); if (!aidu) return PSB_NOP; } // the records was in reversed ordering for (; curr < total; curr++) { fh = &cx->records[total - curr - 1]; if ((key == '/' && DBCS_strcasestr(fh->title, search_str)) || (key == 'a' && DBCS_strcasestr(fh->owner, search_str)) || (key == '#' && fn2aidu(fh->filename) == aidu)) { // found something. return as current index. return curr; } } return PSB_NOP; } [相关代码-三] #ifdef AID_DISPLAYNAME // quick exit if (r <= 0) break; // LatestRef only works if system supports AID. // try to load next reference. lua_getglobal(L, "toc"); // stack 1 lua_getfield(L, -1, "latestref"); // stack 2 lastref = lua_tostring(L, -1); while (lastref && *lastref) { // try to load by AID char bn[IDLEN+1] = ""; aidu_t aidu = 0; unsigned char *p = (unsigned char*)bn; if (*lastref == '#') lastref++; aidu = aidc2aidu((char*)lastref); if (aidu <= 0) break; while (*lastref > ' ') lastref ++; // lastref points to zero of space while (*lastref && *lastref <= ' ') lastref++; // lastref points to zero or board name if (*lastref == '(') lastref ++; if (!*lastref) break; strlcpy(bn, lastref, sizeof(bn)); // truncate board name // (not_alnum(ch) && ch != '_' && ch != '-' && ch != '.') while (*p && (isalnum(*p) || *p == '_' || *p == '-' || *p == '.')) p++; *p = 0; if (bn[0]) { bfpath[0] = 0; setaidfile(bfpath, bn, aidu); } if (bfpath[0]) loadnext = 1; break; } lua_pop(L, 2); if (loadnext) continue; #endif // AID_DISPLAYNAME break; } while (r-- > 0); } --         ╱     ╱ [个人板] BS2 P_HWBA板         ████◣╱ █████  weifeng板 ╱       ╱  █      ─────────── █████      █████  ╱     热心 爱心 耐心 服务心      ╱  █  █████  真意 善意 美意 诚意 HWBA █████ █████   ────── ψHWBA --



※ 发信站: 批踢踢兔(ptt2.cc), 来自: 118.168.40.196



※ 发信站: 批踢踢实业坊(ptt.cc)
※ 转录者: HWBA (118.168.40.196), 05/01/2015 23:25:44



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 118.168.40.196
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/PttNewhand/M.1430493990.A.FE0.html ※ 编辑: HWBA (118.168.40.196), 05/01/2015 23:26:41 ymsgcat:转录至某隐形看板 05/01 23:29
1F:推 holishing: 推专业! 05/07 00:13
2F:推 name2name2: 这看起来有点C++可是好像不是,可以请问是哪个语言吗 06/25 19:03
3F:→ name2name2: ? 随意问问~~ 06/25 19:03
4F:推 holishing: c语言? 08/29 12:23
5F:推 holishing: https://github.com/ptt/pttbbs.git 去看里面就知道了 01/06 12:46







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:e-shopping站内搜寻

TOP