| 32 |
#define TITLE_INPUT_MAX_LEN 72 |
#define TITLE_INPUT_MAX_LEN 72 |
| 33 |
#define ARTICLE_CONTENT_MAX_LEN 1024 * 1024 * 4 // 4MB |
#define ARTICLE_CONTENT_MAX_LEN 1024 * 1024 * 4 // 4MB |
| 34 |
#define ARTICLE_QUOTE_MAX_LINES 20 |
#define ARTICLE_QUOTE_MAX_LINES 20 |
|
#define ARTICLE_QUOTE_LINE_MAX_LEN 76 |
|
| 35 |
|
|
| 36 |
#define MODIFY_DT_MAX_LEN 50 |
#define MODIFY_DT_MAX_LEN 50 |
| 37 |
|
|
| 89 |
{ |
{ |
| 90 |
clearscr(); |
clearscr(); |
| 91 |
moveto(21, 1); |
moveto(21, 1); |
| 92 |
prints("发表文章于 %s[%s] 讨论区,类型: %s,通知:%s", |
prints("发表文章于 %s[%s] 讨论区,类型: %s,回复通知:%s", |
| 93 |
p_section->stitle, p_section->sname, |
p_section->stitle, p_section->sname, |
| 94 |
(p_article_new->transship ? "转载" : "原创"), |
(p_article_new->transship ? "转载" : "原创"), |
| 95 |
(reply_note ? "开启" : "关闭")); |
(reply_note ? "开启" : "关闭")); |
| 105 |
moveto(24, 1); |
moveto(24, 1); |
| 106 |
prints("[1;32mT[m改标题, [1;32mC[m取消, [1;32mZ[m设为%s, [1;32mN[m%s, [1;32mEnter[m继续: ", |
prints("[1;32mT[m改标题, [1;32mC[m取消, [1;32mZ[m设为%s, [1;32mN[m%s, [1;32mEnter[m继续: ", |
| 107 |
(p_article_new->transship ? "原创" : "转载"), |
(p_article_new->transship ? "原创" : "转载"), |
| 108 |
(reply_note ? "通知关闭" : "通知开启")); |
(reply_note ? "关闭回复通知" : "开启回复通知")); |
| 109 |
iflush(); |
iflush(); |
| 110 |
ch = 0; |
ch = 0; |
| 111 |
} |
} |
| 118 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 119 |
goto cleanup; |
goto cleanup; |
| 120 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 121 |
break; |
break; |
| 122 |
case 'T': |
case 'T': |
| 123 |
len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN); |
len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN); |
| 181 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 182 |
goto cleanup; |
goto cleanup; |
| 183 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 184 |
case 'S': |
case 'S': |
| 185 |
break; |
break; |
| 186 |
case 'C': |
case 'C': |
| 520 |
{ |
{ |
| 521 |
clearscr(); |
clearscr(); |
| 522 |
moveto(1, 1); |
moveto(1, 1); |
| 523 |
prints("(S)保存, (C)取消, (N)通知%s or (E)再编辑? [S]: ", |
prints("(S)保存, (C)取消, (N)%s回复通知 or (E)再编辑? [S]: ", |
| 524 |
(reply_note ? "关闭" : "开启")); |
(reply_note ? "关闭" : "开启")); |
| 525 |
iflush(); |
iflush(); |
| 526 |
|
|
| 531 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 532 |
goto cleanup; |
goto cleanup; |
| 533 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 534 |
case 'S': |
case 'S': |
| 535 |
break; |
break; |
| 536 |
case 'C': |
case 'C': |
| 850 |
} |
} |
| 851 |
|
|
| 852 |
// Apply LML render to content body |
// Apply LML render to content body |
| 853 |
len = lml_render(row[1], content_f, ARTICLE_CONTENT_MAX_LEN, 0); |
len = lml_render(row[1], content_f, ARTICLE_CONTENT_MAX_LEN, SCREEN_COLS - 3, 1); |
| 854 |
content_f[len] = '\0'; |
content_f[len] = '\0'; |
| 855 |
|
|
| 856 |
// Remove control sequence |
// Remove control sequence |
| 860 |
"\n\n【 在 %s (%s) 的大作中提到: 】\n", |
"\n\n【 在 %s (%s) 的大作中提到: 】\n", |
| 861 |
p_article->username, p_article->nickname); |
p_article->username, p_article->nickname); |
| 862 |
|
|
| 863 |
quote_content_lines = split_data_lines(content_f, ARTICLE_QUOTE_LINE_MAX_LEN, line_offsets, ARTICLE_QUOTE_MAX_LINES + 1, 0, NULL); |
quote_content_lines = split_data_lines(content_f, SCREEN_COLS, line_offsets, ARTICLE_QUOTE_MAX_LINES + 1, 0, NULL); |
| 864 |
for (i = 0; i < quote_content_lines; i++) |
for (i = 0; i < quote_content_lines; i++) |
| 865 |
{ |
{ |
| 866 |
memcpy(content + len, ": ", 2); // quote line prefix |
memcpy(content + len, ": ", 2); // quote line prefix |
| 905 |
{ |
{ |
| 906 |
clearscr(); |
clearscr(); |
| 907 |
moveto(21, 1); |
moveto(21, 1); |
| 908 |
prints("回复文章于 %s[%s] 讨论区,通知:%s", p_section->stitle, p_section->sname, (reply_note ? "开启" : "关闭")); |
prints("回复文章于 %s[%s] 讨论区,回复通知:%s", p_section->stitle, p_section->sname, (reply_note ? "开启" : "关闭")); |
| 909 |
moveto(22, 1); |
moveto(22, 1); |
| 910 |
prints("标题: %s", (p_article_new->title[0] == '\0' ? "[无]" : p_article_new->title)); |
prints("标题: %s", (p_article_new->title[0] == '\0' ? "[无]" : p_article_new->title)); |
| 911 |
moveto(23, 1); |
moveto(23, 1); |
| 917 |
|
|
| 918 |
moveto(24, 1); |
moveto(24, 1); |
| 919 |
prints("[1;32mT[m改标题, [1;32mC[m取消, [1;32mN[m%s, [1;32mEnter[m继续: ", |
prints("[1;32mT[m改标题, [1;32mC[m取消, [1;32mN[m%s, [1;32mEnter[m继续: ", |
| 920 |
(reply_note ? "通知关闭" : "通知开启")); |
(reply_note ? "关闭回复通知" : "开启回复通知")); |
| 921 |
iflush(); |
iflush(); |
| 922 |
ch = 0; |
ch = 0; |
| 923 |
} |
} |
| 930 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 931 |
goto cleanup; |
goto cleanup; |
| 932 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 933 |
break; |
break; |
| 934 |
case 'T': |
case 'T': |
| 935 |
len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN); |
len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN); |
| 990 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 991 |
goto cleanup; |
goto cleanup; |
| 992 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 993 |
case 'S': |
case 'S': |
| 994 |
break; |
break; |
| 995 |
case 'C': |
case 'C': |
| 1205 |
{ |
{ |
| 1206 |
// Send notification message |
// Send notification message |
| 1207 |
len_msg = snprintf(msg, BBS_msg_max_len, |
len_msg = snprintf(msg, BBS_msg_max_len, |
| 1208 |
"[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的文章,快来" |
"有人回复了您所发表/回复的文章,快来" |
| 1209 |
"[article %d]看看[/article]《%s》吧!\n", |
"[article %d]看看[/article]《%s》吧!\n", |
| 1210 |
p_article_new->aid, title_f); |
p_article_new->aid, title_f); |
| 1211 |
|
|