summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-04 00:28:32 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-04 00:28:32 +0800
commit9bba55fc1bd4fe8899faeb128fe58eff2165aa70 (patch)
tree16ee7acdbcceb91251e898a8bca2b47e8869dcd5 /mbbsd
parent60d87af129d7be6fe6a73362c7144d47aa98fe2c (diff)
downloadpttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.tar
pttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.tar.gz
pttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.tar.bz2
pttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.tar.lz
pttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.tar.xz
pttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.tar.zst
pttbbs-9bba55fc1bd4fe8899faeb128fe58eff2165aa70.zip
- 18x boards should not provide URLs
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4490 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 6dc798c0..2f0686e3 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -3492,15 +3492,35 @@ view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln
}
#ifdef QUERY_ARTICLE_URL
- if(currboard && currboard[0])
{
- prints("│ " URL_DISPLAYNAME ": "
- ANSI_COLOR(1) URL_PREFIX "/%s/%s.html" ANSI_RESET "\n",
- currboard, fhdr->filename);
- }
- else
- {
- prints("│\n");
+ boardheader_t *bp = NULL;
+
+ // XXX currbid should match currboard, right? can we use it?
+ if (currboard && currboard[0])
+ {
+ int bnum = getbnum(currboard);
+ if (bnum > 0)
+ {
+ assert(0<=bnum-1 && bnum-1<MAX_BOARD);
+ bp = getbcache(bnum);
+ }
+ }
+
+ if (!bp)
+ {
+ prints("│\n");
+ }
+ else if (bp->brdattr & BRD_OVER18)
+ {
+ // over18 boards do not provide URL.
+ prints("│ 本看板不提供" URL_DISPLAYNAME " \n");
+ }
+ else
+ {
+ prints("│ " URL_DISPLAYNAME ": "
+ ANSI_COLOR(1) URL_PREFIX "/%s/%s.html" ANSI_RESET "\n",
+ currboard, fhdr->filename);
+ }
}
#endif