diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-19 10:47:08 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-19 10:47:08 +0800 |
commit | bff9393b7b736910f1d4aafef2502db3e226801d (patch) | |
tree | 4068d0ea69663e45f9656623ca06961b400c5fbc | |
parent | ed05d0880857367c577a8dd4428b0bb76ec50e87 (diff) | |
download | pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.tar pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.tar.gz pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.tar.bz2 pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.tar.lz pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.tar.xz pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.tar.zst pttbbs-bff9393b7b736910f1d4aafef2502db3e226801d.zip |
* change the name of 'movie' to 'adbanner' (advertisement banner), which is more descriptive.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4854 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/common/bbs/cache.c | 6 | ||||
-rw-r--r-- | pttbbs/include/config.h | 5 | ||||
-rw-r--r-- | pttbbs/include/proto.h | 2 | ||||
-rw-r--r-- | pttbbs/include/pttstruct.h | 6 | ||||
-rw-r--r-- | pttbbs/include/uflags.h | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/board.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/menu.c | 50 | ||||
-rw-r--r-- | pttbbs/mbbsd/ordersong.c | 6 | ||||
-rw-r--r-- | pttbbs/mbbsd/register.c | 12 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/xyz.c | 2 |
11 files changed, 53 insertions, 42 deletions
diff --git a/pttbbs/common/bbs/cache.c b/pttbbs/common/bbs/cache.c index d202b61b..19d5b895 100644 --- a/pttbbs/common/bbs/cache.c +++ b/pttbbs/common/bbs/cache.c @@ -650,7 +650,7 @@ void buildBMcache(int bid) /* bid starts from 1 */ } /* - * section - PTT cache (movie cache?) + * section - PTT cache (adbanner cache?) * 動態看板與其它 */ int @@ -780,13 +780,13 @@ reload_pttcache(void) } fclose(fp2); - if (id >= MAX_MOVIE) + if (id >= MAX_ADBANNER) break; } // end of file loop fclose(fp1); - if (id >= MAX_MOVIE) + if (id >= MAX_ADBANNER) break; } // end of .DIR loop fclose(fp); diff --git a/pttbbs/include/config.h b/pttbbs/include/config.h index 4e98c3df..7d63e3dd 100644 --- a/pttbbs/include/config.h +++ b/pttbbs/include/config.h @@ -246,8 +246,9 @@ #define MAX_FRIEND (256) /* 載入 cache 之最多朋友數目 */ #define MAX_REJECT (32) /* 載入 cache 之最多壞人數目 */ #define MAX_MSGS (10) /* 水球(熱訊)忍耐上限 */ -#define MAX_MOVIE (500) /* 最多動態看板數 */ -#define MAX_MOVIE_SECTION (10) /* 最多動態看板類別 */ +#define MAX_ADBANNER (500) /* 最多動態看板數 */ +#define MAX_ADBANNER_SECTION (10) /* 最多動態看板類別 */ +#define MAX_ADBANNER_HEIGHT (11) /* 最大動態看板內容高度 */ #define MAX_ITEMS (1000) /* 一個目錄最多有幾項 */ #define MAX_HISTORY (12) /* 動態看板保持 12 筆歷史記錄 */ #define MAX_CROSSNUM (9) /* 最多crosspost次數 */ diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index a3e87a7a..ea65837f 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -346,7 +346,7 @@ int query_file_money(const fileheader_t *pfh); /* menu */ void showtitle(const char *title, const char *mid); -void movie(int i); +void adbanner(int i); int main_menu(void); int admin(void); int Mail(void); diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h index 3ce9ecb4..1be9f2a1 100644 --- a/pttbbs/include/pttstruct.h +++ b/pttbbs/include/pttstruct.h @@ -548,14 +548,14 @@ typedef struct { time4_t close_vote_time; /* pttcache */ - char notes[MAX_MOVIE][256*11]; + char notes[MAX_ADBANNER][256*MAX_ADBANNER_HEIGHT]; char gap_18[sizeof(int)]; char today_is[20]; // FIXME remove it - int __never_used__n_notes[MAX_MOVIE_SECTION]; /* 一節中有幾個 看板 */ + int __never_used__n_notes[MAX_ADBANNER_SECTION]; /* 一節中有幾個 看板 */ char gap_19[sizeof(int)]; // FIXME remove it - int __never_used__next_refresh[MAX_MOVIE_SECTION]; /* 下一次要refresh的 看板 */ + int __never_used__next_refresh[MAX_ADBANNER_SECTION]; /* 下一次要refresh的 看板 */ char gap_20[sizeof(int)]; msgque_t loginmsg; /* 進站水球 */ int last_film; diff --git a/pttbbs/include/uflags.h b/pttbbs/include/uflags.h index 4b695658..d0414db0 100644 --- a/pttbbs/include/uflags.h +++ b/pttbbs/include/uflags.h @@ -21,7 +21,7 @@ //#define CLOAK_FLAG 0x00000008 /* deprecated by cuser.invisible: true if cloak was ON last session */ #define FRIEND_FLAG 0x00000010 /* true if show friends only */ #define BRDSORT_FLAG 0x00000020 /* true if the boards sorted alphabetical */ -#define MOVIE_FLAG 0x00000040 /* true if show movie */ +#define ADBANNER_FLAG 0x00000040 /* (was: MOVIE_FLAG, true if show advertisement banner */ /* deprecated flag */ //#define COLOR_FLAG 0x00000080 /* true if the color mode open */ //#define MIND_FLAG 0x00000100 /* true if mind search mode open <-Heat*/ diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index 108cd39f..8e7e8edb 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/mbbsd/board.c @@ -1168,7 +1168,7 @@ show_brdlist(int head, int clsflag, int newflag) currstat = CLASS; myrow = 6; showtitle("分類看板", BBSName); - movie(0); + adbanner(0); move(1, 0); // TODO remove ascii art here outs( diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c index 069107b1..b1ce89f1 100644 --- a/pttbbs/mbbsd/menu.c +++ b/pttbbs/mbbsd/menu.c @@ -234,45 +234,45 @@ show_status(void) } /* - * current caller of movie: - * board.c: movie(0); // called when IN_CLASSROOT() - * // with currstat = CLASS -> don't show movies - * xyz.c: movie(999999); // logout - * menu.c: movie(cmdmode); // ... + * current caller of adbanner: + * board.c: adbanner(0); // called when IN_CLASSROOT() + * // with currstat = CLASS -> don't show adbanners + * xyz.c: adbanner(999999); // logout + * menu.c: adbanner(cmdmode); // ... */ -#define N_SYSMOVIE (sizeof(movie_map) / sizeof(movie_map[0])) +#define N_SYSADBANNER (sizeof(adbanner_map) / sizeof(adbanner_map[0])) void -movie(int cmdmode) +adbanner(int cmdmode) { int i; - // movie 前幾筆是 Note 板精華區「<系統> 動態看板」(SYS) 目錄下的文章 - // movie_map 是用來依 cmdmode 挑出特定的動態看板,index 跟 mode_map 一樣。 - const int movie_map[] = { + // adbanner 前幾筆是 Note 板精華區「<系統> 動態看板」(SYS) 目錄下的文章 + // adbanner_map 是用來依 cmdmode 挑出特定的動態看板,index 跟 mode_map 一樣。 + const int adbanner_map[] = { 2, 10, 11, -1, 3, -1, 12, 7, 9, 8, 4, 5, 6, }; - // don't show if stat in class or user wants to skip movies - if (currstat == CLASS || !(cuser.uflag & MOVIE_FLAG)) + // don't show if stat in class or user wants to skip adbanners + if (currstat == CLASS || !(cuser.uflag & ADBANNER_FLAG)) return; // also prevent SHM busy status if (SHM->Pbusystate || SHM->last_film <= 0) return; - if (cmdmode < N_SYSMOVIE && - 0 < movie_map[cmdmode] && movie_map[cmdmode] <= SHM->last_film) { - i = movie_map[cmdmode]; + if (cmdmode < N_SYSADBANNER && + 0 < adbanner_map[cmdmode] && adbanner_map[cmdmode] <= SHM->last_film) { + i = adbanner_map[cmdmode]; } else if (cmdmode == 999999) { /* Goodbye my friend */ i = 0; } else { // do not use random. we work in slide show mode. // since menu is updated per hour, the total presentation time - // should be less than one hour. 3600/MAX_MOVIE(500)=7. + // should be less than one hour. 3600/MAX_ADBANNER(500)=7. // syncnow(); - if (SHM->last_film > N_SYSMOVIE) - i = N_SYSMOVIE + (now / (3600 / MAX_MOVIE) ) % - (SHM->last_film+1-N_SYSMOVIE); + if (SHM->last_film > N_SYSADBANNER) + i = N_SYSADBANNER + (now / (3600 / MAX_ADBANNER) ) % + (SHM->last_film+1-N_SYSADBANNER); else i = 0; // SHM->last_film; } @@ -298,12 +298,12 @@ typedef struct { } commands_t; static int -show_menu(int moviemode, const commands_t * p) +show_menu(int adbannermode, const commands_t * p) { register int n = 0; register char *s; - movie(moviemode); + adbanner(adbannermode); // seems not everyone likes the menu in center. #ifdef LARGETERM_CENTER_MENU @@ -337,11 +337,11 @@ static const int mode_map[] = { static void domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[]) { - int lastcmdptr, moviemode; + int lastcmdptr, adbannermode; int n, pos, total, i; int err; - moviemode = cmdmode; + adbannermode = cmdmode; assert(cmdmode < M_XMAX); cmdmode = mode_map[cmdmode]; @@ -349,7 +349,7 @@ domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[]) showtitle(cmdtitle, BBSName); - total = show_menu(moviemode, cmdtable); + total = show_menu(adbannermode, cmdtable); show_status(); lastcmdptr = pos = 0; @@ -471,7 +471,7 @@ domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[]) if (refscreen) { showtitle(cmdtitle, BBSName); - show_menu(moviemode, cmdtable); + show_menu(adbannermode, cmdtable); show_status(); refscreen = NA; } diff --git a/pttbbs/mbbsd/ordersong.c b/pttbbs/mbbsd/ordersong.c index d8122541..11918729 100644 --- a/pttbbs/mbbsd/ordersong.c +++ b/pttbbs/mbbsd/ordersong.c @@ -8,7 +8,7 @@ #define OSONGPATH "etc/SONGO" #define ORDER_SONG_COST (200) // how much to order a song -#define MAX_SONGS (MAX_MOVIE-100) // (400) XXX MAX_SONGS should be fewer than MAX_MOVIE. +#define MAX_SONGS (MAX_ADBANNER-100) // (400) XXX MAX_SONGS should be fewer than MAX_ADBANNER. static void sortsong(void); @@ -149,13 +149,13 @@ do_order_song(void) if (append_record(OSONGPATH "/" FN_DIR, &mail, sizeof(mail)) != -1) { pwcuSetLastSongTime(now); - /* Jaky 超過 MAX_MOVIE 首歌就開始砍 */ + /* Jaky 超過 MAX_ADBANNER 首歌就開始砍 */ // XXX 載入的順序會長得像是: // 3. ◆ <系統> 動態看板 SYSOP [01/23/08] // 4. ◆ <點歌> 動態看板 Ptt [08/26/09] // 5. ◆ <廣告> 動態看板 SYSOP [08/22/09] // 6. ◆ <看板> 動態看板 SYSOP [04/16/09] - // 由於點歌部份算是早載入的,不能直接用 MAX_MOVIE 不然後面都沒得玩。 + // 由於點歌部份算是早載入的,不能直接用 MAX_ADBANNER 不然後面都沒得玩。 nsongs = get_num_records(OSONGPATH "/" FN_DIR, sizeof(mail)); if (nsongs > MAX_SONGS) { // XXX race condition diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c index fcca3b6b..a81c8db5 100644 --- a/pttbbs/mbbsd/register.c +++ b/pttbbs/mbbsd/register.c @@ -653,12 +653,22 @@ new_register(void) memset(&newuser, 0, sizeof(newuser)); newuser.version = PASSWD_VERSION; newuser.userlevel = PERM_DEFAULT; - newuser.uflag = BRDSORT_FLAG | MOVIE_FLAG; + newuser.uflag = BRDSORT_FLAG | ADBANNER_FLAG; newuser.uflag2 = 0; newuser.firstlogin = newuser.lastlogin = now; newuser.pager = PAGER_ON; strlcpy(newuser.lasthost, fromhost, sizeof(newuser.lasthost)); + // XXX enable this when we complete the user flag of ADBANNER_USONG_FLAG. +#if 0 + clear(); + prints( "\n\t在使用 BBS 的過程中,您可能會在畫面上方看到一些動態的活動看板告示,\n" + "\n\t其內容是開放給各使用者申請的,所以包含非商業的活動訊息、各種使用者的\n" + "\n\t心情點播或政治言論;但這些文字與圖像並不代表站方立場。\n"); + if (vans("請問您希望看到此類使用者心情點播嗎? [y/N]: ") == 'y') + newuser.uflag |= ADBANNER_USONG_FLAG; +#endif + #ifdef DBCSAWARE if(u_detectDBCSAwareEvilClient()) newuser.uflag &= ~DBCSAWARE_FLAG; diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index c71cf6fe..a08217e5 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -367,7 +367,7 @@ void Customize(void) /* cuser.uflag settings */ static const unsigned int masks1[] = { - MOVIE_FLAG, + ADBANNER_FLAG, NO_MODMARK_FLAG , COLORED_MODMARK, #ifdef DBCSAWARE diff --git a/pttbbs/mbbsd/xyz.c b/pttbbs/mbbsd/xyz.c index 7f52a28d..6c1eaf04 100644 --- a/pttbbs/mbbsd/xyz.c +++ b/pttbbs/mbbsd/xyz.c @@ -263,7 +263,7 @@ Goodbye(void) if (*genbuf != 'y') return 0; - movie(999999); + adbanner(999999); if (cuser.userlevel) { getdata(b_lines - 1, 0, "(G)隨風而逝 (M)托夢站長 (N)酸甜苦辣流言板?[G] ", |