diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-01-18 22:24:12 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-01-18 22:24:12 +0800 |
commit | d42e85a1888aedc01523aa130d19edb6c644300c (patch) | |
tree | 6d460306284c6bfead8b5efc627931cc57dcbe62 | |
parent | fa0f1515de173ea246b22e81c736cce5253ca4f8 (diff) | |
download | pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.tar pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.tar.gz pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.tar.bz2 pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.tar.lz pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.tar.xz pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.tar.zst pttbbs-d42e85a1888aedc01523aa130d19edb6c644300c.zip |
Support browsing posts in ALLPOST directly from source boards.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5518 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index d575e681..bce703a4 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -1437,6 +1437,8 @@ do_general(int garbage GCC_UNUSED) if (cuser.numlogindays < NEWIDPOST_LIMIT_DAYS) do_crosspost(BN_NEWIDPOST, &postfile, fpath, 0); + // TODO when USE_LIVE_ALLPOST is enabled, we probably don't need + // to post into BN_ALLPOST. if (!(currbrdattr & BRD_HIDE) ) do_crosspost(BN_ALLPOST, &postfile, fpath, 0); else @@ -2251,7 +2253,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) static int read_post(int ent, fileheader_t * fhdr, const char *direct) { - char genbuf[100]; + char genbuf[PATHLEN]; int more_result; if (fhdr->owner[0] == '-' || fhdr->filename[0] == 'L' || !fhdr->filename[0]) @@ -2260,6 +2262,25 @@ read_post(int ent, fileheader_t * fhdr, const char *direct) STATINC(STAT_READPOST); setdirpath(genbuf, direct, fhdr->filename); +#if defined(BN_ALLPOST) && defined(USE_LIVE_ALLPOST) + if (strstr(genbuf, "/" BN_ALLPOST "/")) { + char bnbuf[IDLEN + 1] = ""; + const char *bn = strrchr(fhdr->title, '.'); + + while (bn) { + int bnlen = strlen(++bn) - 2; + if (bnlen < 1 || bnlen > IDLEN) + break; + snprintf(bnbuf, sizeof(bnbuf), "%*.*s", bnlen, bnlen, bn); + setbfile(genbuf, bnbuf, fhdr->filename); +#ifdef DEBUG + vmsgf("redirect: %s", genbuf); +#endif + break; + } + } +#endif + more_result = more(genbuf, YEA); #ifdef LOG_CRAWLER |