| 705 |
long quote_content_lines; |
long quote_content_lines; |
| 706 |
long i; |
long i; |
| 707 |
long ret = 0; |
long ret = 0; |
| 708 |
|
int topic_locked = 0; |
| 709 |
|
|
| 710 |
if (p_section == NULL || p_article == NULL) |
if (p_section == NULL || p_article == NULL) |
| 711 |
{ |
{ |
| 722 |
return 0; |
return 0; |
| 723 |
} |
} |
| 724 |
|
|
|
if (p_article->lock) // Reply is not allowed |
|
|
{ |
|
|
clearscr(); |
|
|
moveto(1, 1); |
|
|
prints("该文章谢绝回复"); |
|
|
press_any_key(); |
|
|
|
|
|
return 0; |
|
|
} |
|
|
|
|
| 725 |
p_article_new->title[0] = '\0'; |
p_article_new->title[0] = '\0'; |
| 726 |
snprintf(title_input, sizeof(title_input), "Re: %s", p_article->title); |
snprintf(title_input, sizeof(title_input), "Re: %s", p_article->title); |
| 727 |
len = split_line(title_input, TITLE_INPUT_MAX_LEN, &eol, &display_len); |
len = split_line(title_input, TITLE_INPUT_MAX_LEN, &eol, &display_len); |
| 735 |
} |
} |
| 736 |
|
|
| 737 |
snprintf(sql, sizeof(sql), |
snprintf(sql, sizeof(sql), |
| 738 |
|
"SELECT `lock` FROM bbs WHERE AID = %d", |
| 739 |
|
(p_article->tid == 0 ? p_article->aid : p_article->tid)); |
| 740 |
|
|
| 741 |
|
if (mysql_query(db, sql) != 0) |
| 742 |
|
{ |
| 743 |
|
log_error("Query article status error: %s\n", mysql_error(db)); |
| 744 |
|
return -2; |
| 745 |
|
} |
| 746 |
|
if ((rs = mysql_store_result(db)) == NULL) |
| 747 |
|
{ |
| 748 |
|
log_error("Get article status data failed\n"); |
| 749 |
|
return -2; |
| 750 |
|
} |
| 751 |
|
|
| 752 |
|
if ((row = mysql_fetch_row(rs))) |
| 753 |
|
{ |
| 754 |
|
if (atoi(row[0]) != 0) |
| 755 |
|
{ |
| 756 |
|
topic_locked = 1; |
| 757 |
|
} |
| 758 |
|
} |
| 759 |
|
mysql_free_result(rs); |
| 760 |
|
rs = NULL; |
| 761 |
|
|
| 762 |
|
if (topic_locked) // Reply is not allowed |
| 763 |
|
{ |
| 764 |
|
clearscr(); |
| 765 |
|
moveto(1, 1); |
| 766 |
|
prints("该主题谢绝回复"); |
| 767 |
|
press_any_key(); |
| 768 |
|
|
| 769 |
|
goto cleanup; |
| 770 |
|
} |
| 771 |
|
|
| 772 |
|
snprintf(sql, sizeof(sql), |
| 773 |
"SELECT bbs_content.CID, bbs_content.content " |
"SELECT bbs_content.CID, bbs_content.content " |
| 774 |
"FROM bbs INNER JOIN bbs_content ON bbs.CID = bbs_content.CID " |
"FROM bbs INNER JOIN bbs_content ON bbs.CID = bbs_content.CID " |
| 775 |
"WHERE bbs.AID = %d", |
"WHERE bbs.AID = %d", |