From 852373458e0f309276ad3a32624aabb3b41ec6a7 Mon Sep 17 00:00:00 2001
From: mhsin <mhsin@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>
Date: Wed, 7 Jan 2009 14:11:46 +0000
Subject: Add support for querying article URL.

git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4424 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
---
 include/common.h   |  4 ++++
 mbbsd/bbs.c        | 15 ++++++++++++++-
 sample/pttbbs.conf |  9 +++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/include/common.h b/include/common.h
index b0d1a61f..a98b69c7 100644
--- a/include/common.h
+++ b/include/common.h
@@ -106,6 +106,10 @@
 #define AID_DISPLAYNAME	"�峹�N�X(AID)"
 /* end of AIDS */
 
+/* QUERY_ARTICLE_URL */
+#define URL_DISPLAYNAME "�峹���}"
+/* end of QUERY_ARTICLE_URL */
+
 /* LONG MESSAGES */
 #define MSG_SELECT_BOARD ANSI_COLOR(7) "�i ��ܬݪO �j" ANSI_RESET "\n" \
 			"�п�J�ݪO�W��(���ť���۰ʷj�M): "
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 3831ec12..a3fcbc76 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -3429,7 +3429,7 @@ view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln
     aidu_t aidu = 0;
     int l = crs_ln + 3;  /* line of cursor */
     int area_l = l + 1;
-    const int area_lines = 4;
+    const int area_lines = 5;
 
     if(!fhdr || fhdr->filename[0] == '.' || !fhdr->filename[0])
       return DONOTHING;
@@ -3480,6 +3480,19 @@ view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln
       prints("�x\n");
     }
 
+#ifdef QUERY_ARTICLE_URL
+    if(currboard && currboard[0])
+    {
+      prints("�x " URL_DISPLAYNAME ": " 
+             ANSI_COLOR(1) URL_PREFIX "/%s/%s.html" ANSI_RESET "\n",
+             currboard, fhdr->filename);
+    }
+    else
+    {
+      prints("�x\n");
+    }
+#endif
+
     if(fhdr->filemode & FILE_ANONYMOUS)
 	/* When the file is anonymous posted, fhdr->multi.anon_uid is author.
 	 * see do_general() */
diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf
index 31984f87..866afa11 100644
--- a/sample/pttbbs.conf
+++ b/sample/pttbbs.conf
@@ -6,6 +6,15 @@
 #define MYHOSTNAME      "ptt2.cc"          		/* ������} */
 #define MYIP            "140.112.30.143"		/* IP��} */
 
+/* �w�q�O�_�d�ߤ峹�� web �� URL�A�� URL �Ϊ� hostname/prefix */
+#define QUERY_ARTICLE_URL                   /* �O�_���Ѭd�ߤ峹 URL */
+#define URL_PREFIX      "http://www.ptt.cc/bbs/"        /* URL prefix */
+        /*
+                         http://www.ptt.cc/bbs/SYSOP/M.1197864962.A.476.html
+                         ^^^^^^^^^^^^^^^^^^^^^^
+                         �o�ӳ���
+         */
+
 /* �U�C��T���t�ήį�A�w�]�Ȭ����q�p�t���W�� */
  
 /* �̦h���U�H��, �C�ӤH�|�α� 21 bytes �� shared-memory */
-- 
cgit v1.2.3