From 73ccd0e5631c5143e53b8982401b0d7075abf266 Mon Sep 17 00:00:00 2001
From: piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>
Date: Sun, 9 Dec 2007 09:30:35 +0000
Subject: - hinting outposts may not receive recommendations

git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3660 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
---
 mbbsd/bbs.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 52c175c1..ff8a4350 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2358,6 +2358,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
     static char lastrecommend_fname[FNLEN] = "";
     int isGuest = (strcmp(cuser.userid, STR_GUEST) == EQUSTR);
     int logIP = 0;
+    int ymsg = b_lines -1;
 
     assert(0<=currbid-1 && currbid-1<MAX_BOARD);
     bp = getbcache(currbid);
@@ -2391,7 +2392,6 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
 #ifndef DEBUG
     if (!CheckPostRestriction(currbid))
     {
-	move(5, 10); // why move (5, 10)?
 	vmsg("�A������`��I (�i���j�g I �d�ݭ���)");
 	return FULLUPDATE;
     }
@@ -2453,8 +2453,6 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
 
     type = 0;
 
-    move(b_lines, 0); clrtoeol();
-
     // why "recommend == 0" here?
     // some users are complaining that they like to fxck up system
     // with lots of recommend one-line text.
@@ -2472,7 +2470,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
     {
 	// owner recommend
 	type = 2;
-	move(b_lines-1, 0); clrtoeol();
+	move(ymsg--, 0); clrtoeol();
 #ifndef OLDRECOMMEND
 	outs("�@�̥��H, �ϥ� �� �[���覡\n");
 #else
@@ -2492,7 +2490,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
     {
 	// too close
 	type = 2;
-	move(b_lines-1, 0); clrtoeol();
+	move(ymsg--, 0); clrtoeol();
 	outs("�ɶ��Ӫ�, �ϥ� �� �[���覡\n");
     }
 #endif
@@ -2506,6 +2504,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
 	 */
 #define RECOMMEND_DEFAULT_VALUE (0) /* current user behavior */
 
+	move(b_lines, 0); clrtoeol();
 	outs(ANSI_COLOR(1)  "�zı�o�o�g�峹 ");
 	prints("%s1.%s %s2.%s %s3.%s " ANSI_RESET "[%d]? ",
 		ctype_attr[0], ctype_long[0],
@@ -2522,6 +2521,15 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
     }
 #endif
 
+    // warn if article is outside post
+    if (strchr(fhdr->owner, '.')  != NULL)
+    {
+	move(ymsg--, 0); clrtoeol();
+	outs(ANSI_COLOR(1;31) 
+	    "���o�g�峹�Ӧۥ~����H�O�A��@�̥i��L�k�ݨ����C" 
+	    ANSI_RESET "\n");
+    }
+
     if(type > 2 || type < 0)
 	type = 0;
 
@@ -2549,14 +2557,11 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
 	    cuser.userid);
 #endif // !OLDRECOMMEND
 
-    if (!getdata(b_lines, 0, buf, msg, maxlength, DOECHO))
-	return FULLUPDATE;
+    move(b_lines, 0);
+    clrtoeol();
 
-#if 0
-    scroll();
-    if(getans("�T�w�n%s��? �ХJ�ӦҼ{[y/N]: ", ctype[type]) != 'y')
+    if (!getdata(b_lines, 0, buf, msg, maxlength, DOECHO))
 	return FULLUPDATE;
-#else
 
     // make sure to do modification
     {
@@ -2587,8 +2592,6 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
     }
 #endif // LOG_PUSH
 
-#endif // !DEBUG
-
     STATINC(STAT_RECOMMEND);
 
     {
@@ -2631,6 +2634,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
     if (type ==0 && (fhdr->filemode & FILE_MARKED) && fhdr->recommend % 10 == 0)
 	inc_goodpost(fhdr->owner, 1);
 #endif
+
     lastrecommend = now;
     lastrecommend_bid = currbid;
     strlcpy(lastrecommend_fname, fhdr->filename, sizeof(lastrecommend_fname));
@@ -3328,12 +3332,14 @@ b_config(void)
     boardheader_t   *bp=NULL;
     int touched = 0, finished = 0;
     bp = getbcache(currbid); 
-    int ytitle = b_lines - 15;
     int i = 0;
 
+    const int ytitle = b_lines - 
 #ifndef OLDRECOMMEND
-    ytitle --;
-#endif 
+	16;
+#else // OLDRECOMMEND
+	15;
+#endif  // OLDRECOMMEND
 
     grayout_lines(0, ytitle-1, 0);
 
-- 
cgit v1.2.3